1 | import { Injectable, NgModule, InjectionToken, Inject, Component, Input, Output, EventEmitter } from '@angular/core';
|
2 | import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
3 | import { CommonModule } from '@angular/common';
|
4 | import { FormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
5 | import { SlideComponent } from 'ngx-bootstrap/carousel/slide.component';
|
6 | import { CarouselComponent } from 'ngx-bootstrap/carousel/carousel.component';
|
7 | import { CarouselConfig } from 'ngx-bootstrap/carousel/carousel.config';
|
8 | import { Http } from '@angular/http';
|
9 | import 'rxjs/add/operator/map';
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | class SimulatorState {
|
16 | constructor() {
|
17 | this.nonRelevantDataElementIds = [];
|
18 | this.endPointId = '';
|
19 | this.selectedDecisionPointId = '';
|
20 | this.selectedDecisionPointLabel = '';
|
21 | this.selectedBranchLabel = '';
|
22 | }
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | class DataElementValues {
|
30 | |
31 |
|
32 |
|
33 | constructor(values) {
|
34 | this.values = values;
|
35 | }
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 | addOrUpdate(key, value) {
|
42 | this.values[key] = value;
|
43 | }
|
44 | |
45 |
|
46 |
|
47 |
|
48 | get(key) {
|
49 | return this.values[key];
|
50 | }
|
51 | |
52 |
|
53 |
|
54 |
|
55 | delete(key) {
|
56 | return this.values.delete(key);
|
57 | }
|
58 | |
59 |
|
60 |
|
61 | getAll() {
|
62 | return this.values;
|
63 | }
|
64 | }
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | class SimulatorEngineService {
|
71 | constructor() {
|
72 | this.endOfRoadReached = false;
|
73 | this.lastConditionMetBranchLevel = 1;
|
74 | this.simulatorStateChanged = new BehaviorSubject(new SimulatorState());
|
75 | this.dataElementValues = new Map();
|
76 | this.dataElementTexts = new Map();
|
77 | }
|
78 | |
79 |
|
80 |
|
81 | getAllDataElementValues() {
|
82 | return this.dataElementValues;
|
83 | }
|
84 | |
85 |
|
86 |
|
87 | getAllDataElementTexts() {
|
88 | return this.dataElementTexts;
|
89 | }
|
90 | |
91 |
|
92 |
|
93 |
|
94 | getDataElementValue(dataElementId) {
|
95 | return this.dataElementValues[dataElementId];
|
96 | }
|
97 | |
98 |
|
99 |
|
100 |
|
101 | getDataElementText(dataElementId) {
|
102 | return this.dataElementTexts[dataElementId];
|
103 | }
|
104 | |
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | addOrUpdateDataElement(dataElementId, value, text) {
|
111 | this.dataElementValues[dataElementId] = value;
|
112 | this.dataElementTexts[dataElementId] = text;
|
113 | this.evaluateDecisionPoints();
|
114 | }
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 | evaluateDecisionPoint(decisionPoint, branchingLevel, nonRelevantDataElementIds = []) {
|
122 | let currentBranchCount = 0;
|
123 | const totalBranchesInDecisionPoint = decisionPoint.branches.length;
|
124 | for (const branch of decisionPoint.branches) {
|
125 | currentBranchCount++;
|
126 | let conditionMet = false;
|
127 | if (this.endOfRoadReached) {
|
128 | break;
|
129 | }
|
130 | if (branch.compositeCondition !== undefined) {
|
131 | conditionMet = branch.compositeCondition.evaluate(new DataElementValues(this.dataElementValues));
|
132 | }
|
133 | else if (branch.condition !== undefined) {
|
134 | conditionMet = branch.condition.evaluate(new DataElementValues(this.dataElementValues));
|
135 | }
|
136 |
|
137 | if (conditionMet) {
|
138 | this.lastConditionMetBranchLevel = branchingLevel;
|
139 | if (nonRelevantDataElementIds === undefined) {
|
140 | nonRelevantDataElementIds = new Array();
|
141 | }
|
142 | if (branch.notRelevantDataElements !== undefined) {
|
143 | for (const nonRelevantDataElementReference of branch.notRelevantDataElements.dataElementReferences) {
|
144 | nonRelevantDataElementIds.push(nonRelevantDataElementReference.dataElementId);
|
145 | }
|
146 | }
|
147 | if (branch.decisionPoints !== undefined) {
|
148 | for (const branchDecisionPoint of branch.decisionPoints) {
|
149 | const newBranchingLevel = branchingLevel + 1;
|
150 | this.evaluateDecisionPoint(branchDecisionPoint, newBranchingLevel, nonRelevantDataElementIds);
|
151 | }
|
152 | }
|
153 | else if (branch.endPointRef !== undefined) {
|
154 | const simulatorState = new SimulatorState();
|
155 | simulatorState.endPointId = branch.endPointRef.endPointId;
|
156 | simulatorState.nonRelevantDataElementIds = nonRelevantDataElementIds;
|
157 | simulatorState.selectedBranchLabel = branch.label;
|
158 | simulatorState.selectedDecisionPointId = decisionPoint.id;
|
159 | simulatorState.selectedDecisionPointLabel = decisionPoint.label;
|
160 | this.resetValuesOfNonRelevantDataElements(nonRelevantDataElementIds);
|
161 | this.simulatorStateChanged.next(simulatorState);
|
162 | this.endOfRoadReached = true;
|
163 | break;
|
164 | }
|
165 | }
|
166 | else {
|
167 | if (currentBranchCount >= totalBranchesInDecisionPoint) {
|
168 | this.endOfRoadReached = true;
|
169 | const simulatorState = new SimulatorState();
|
170 | simulatorState.nonRelevantDataElementIds = nonRelevantDataElementIds;
|
171 | this.resetValuesOfNonRelevantDataElements(nonRelevantDataElementIds);
|
172 | this.simulatorStateChanged.next(simulatorState);
|
173 | return;
|
174 | }
|
175 | else {
|
176 | continue;
|
177 | }
|
178 | }
|
179 | }
|
180 | }
|
181 | |
182 |
|
183 |
|
184 |
|
185 | resetValuesOfNonRelevantDataElements(nonRelevantDataElementIds) {
|
186 | for (const nonRelevantDataElementId of nonRelevantDataElementIds) {
|
187 | let defaultValue;
|
188 | for (const dataElement of this.template.dataElements) {
|
189 | if (dataElement.id === nonRelevantDataElementId) {
|
190 | defaultValue = dataElement.defaultValue;
|
191 | break;
|
192 | }
|
193 | }
|
194 | this.dataElementValues[nonRelevantDataElementId] = defaultValue;
|
195 | }
|
196 | }
|
197 | |
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | evaluateComputedElementDecisionPoint(elementId, decisionPoint, branchingLevel) {
|
204 | let currentBranchCount = 0;
|
205 | const totalBranchesInDecisionPoint = decisionPoint.branches.length;
|
206 | for (const branch of decisionPoint.branches) {
|
207 | currentBranchCount++;
|
208 | let conditionMet = false;
|
209 | if (this.endOfRoadReached) {
|
210 | break;
|
211 | }
|
212 | if (branch.compositeCondition !== undefined) {
|
213 | conditionMet = branch.compositeCondition.evaluate(new DataElementValues(this.dataElementValues));
|
214 | }
|
215 | else if (branch.condition !== undefined) {
|
216 | conditionMet = branch.condition.evaluate(new DataElementValues(this.dataElementValues));
|
217 | }
|
218 | if (conditionMet) {
|
219 | this.lastConditionMetBranchLevel = branchingLevel;
|
220 | if (branch.decisionPoints !== undefined) {
|
221 | for (const branchDecisionPoint of branch.decisionPoints) {
|
222 | const newBranchingLevel = branchingLevel + 1;
|
223 | this.evaluateComputedElementDecisionPoint(elementId, branchDecisionPoint, newBranchingLevel);
|
224 | }
|
225 | }
|
226 | else if (branch.computedValue !== undefined) {
|
227 | this.dataElementValues[elementId] = branch.computedValue.expressionText;
|
228 | this.endOfRoadReached = true;
|
229 | break;
|
230 | }
|
231 | }
|
232 | else {
|
233 | if (currentBranchCount >= totalBranchesInDecisionPoint) {
|
234 | this.endOfRoadReached = true;
|
235 | this.dataElementValues[elementId] = undefined;
|
236 | return;
|
237 | }
|
238 | else {
|
239 | continue;
|
240 | }
|
241 | }
|
242 | }
|
243 | }
|
244 | |
245 |
|
246 |
|
247 | evaluateComputedExpressions() {
|
248 | this.endOfRoadReached = false;
|
249 | for (const element of this.template.dataElements) {
|
250 | if (element.dataElementType === 'ComputedDataElement') {
|
251 | const computedElement = (element);
|
252 | for (const decisionPoint of computedElement.decisionPoints) {
|
253 | this.evaluateComputedElementDecisionPoint(element.id, decisionPoint, 1);
|
254 | if (this.dataElementValues[element.id] === undefined && decisionPoint.defaultBranch &&
|
255 | decisionPoint.defaultBranch.computedValue) {
|
256 | this.dataElementValues[element.id] = decisionPoint.defaultBranch.computedValue.expressionText;
|
257 | }
|
258 | this.endOfRoadReached = false;
|
259 | }
|
260 | }
|
261 | }
|
262 | }
|
263 | |
264 |
|
265 |
|
266 | evaluateDecisionPoints() {
|
267 | this.evaluateComputedExpressions();
|
268 | this.endOfRoadReached = false;
|
269 | for (const decisionPoint of this.template.rules.decisionPoints) {
|
270 | if (this.evaluateDecisionPoint(decisionPoint, 1, new Array())) {
|
271 | break;
|
272 | }
|
273 | }
|
274 | }
|
275 | |
276 |
|
277 |
|
278 |
|
279 | initialize(template) {
|
280 | this.template = template;
|
281 | for (const dataElement of this.template.dataElements) {
|
282 | this.dataElementValues[dataElement.id] = dataElement.currentValue;
|
283 | }
|
284 | }
|
285 | }
|
286 | SimulatorEngineService.decorators = [
|
287 | { type: Injectable },
|
288 | ];
|
289 |
|
290 | SimulatorEngineService.ctorParameters = () => [];
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | class CoreModule {
|
297 | |
298 |
|
299 |
|
300 | static forRoot() {
|
301 | return {
|
302 | ngModule: CoreModule,
|
303 | providers: [SimulatorEngineService]
|
304 | };
|
305 | }
|
306 | }
|
307 | CoreModule.decorators = [
|
308 | { type: NgModule, args: [{
|
309 | imports: [
|
310 | CommonModule
|
311 | ],
|
312 | declarations: []
|
313 | },] },
|
314 | ];
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 | class Template {
|
321 | }
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 | class Metadata {
|
328 | }
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 | class Diagram {
|
335 | }
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 | class ArrayCheckerService {
|
342 | constructor() { }
|
343 | |
344 |
|
345 |
|
346 |
|
347 | isArray(item) {
|
348 | return item instanceof Array;
|
349 | }
|
350 | }
|
351 | ArrayCheckerService.decorators = [
|
352 | { type: Injectable },
|
353 | ];
|
354 |
|
355 | ArrayCheckerService.ctorParameters = () => [];
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 | class DiagramService {
|
362 | |
363 |
|
364 |
|
365 | constructor(arrayCheckerSeviceService) {
|
366 | this.arrayCheckerSeviceService = arrayCheckerSeviceService;
|
367 | }
|
368 | |
369 |
|
370 |
|
371 |
|
372 | returnDiagram(diagramJSON) {
|
373 | const diagram = new Diagram();
|
374 | if (diagramJSON.Attr) {
|
375 | diagram.displaySequence = diagramJSON.Attr.DisplaySequence;
|
376 | diagram.keyDiagram = diagramJSON.Attr.IsKeyDiagram ? diagramJSON.Attr.IsKeyDiagram : false;
|
377 | }
|
378 | else {
|
379 | diagram.displaySequence = undefined;
|
380 | diagram.keyDiagram = false;
|
381 | }
|
382 | diagram.label = diagramJSON.Label;
|
383 | diagram.location = diagramJSON.Location;
|
384 | return diagram;
|
385 | }
|
386 | |
387 |
|
388 |
|
389 |
|
390 | returnDiagrams(diagramsAsJSON) {
|
391 | const diagrams = new Array();
|
392 | if (diagramsAsJSON !== undefined) {
|
393 | if (this.arrayCheckerSeviceService.isArray(diagramsAsJSON)) {
|
394 | for (const diagram of diagramsAsJSON) {
|
395 | diagrams.push(this.returnDiagram(diagram));
|
396 | }
|
397 | }
|
398 | else {
|
399 | diagrams.push(this.returnDiagram(diagramsAsJSON));
|
400 | }
|
401 | }
|
402 | return diagrams;
|
403 | }
|
404 | }
|
405 | DiagramService.decorators = [
|
406 | { type: Injectable },
|
407 | ];
|
408 |
|
409 | DiagramService.ctorParameters = () => [
|
410 | { type: ArrayCheckerService, },
|
411 | ];
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 | const CreationServiceInjectorToken = new InjectionToken('one');
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 | class DecisionPoint {
|
424 | }
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 | class Branch {
|
431 | }
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 | class EndPointRef {
|
438 | }
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 | class DataElementRef {
|
445 | }
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 | class NotRelevantDataElements {
|
452 | }
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 | class EqualCondition {
|
459 | |
460 |
|
461 |
|
462 | constructor(conditionType) {
|
463 | this.conditionType = conditionType;
|
464 | }
|
465 | |
466 |
|
467 |
|
468 |
|
469 | evaluate(dataElementValues) {
|
470 | const value = dataElementValues.get(this.conditionType.dataElementId);
|
471 | return value === this.conditionType.comparisonValue;
|
472 | }
|
473 | }
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 | class ConditionType {
|
480 | }
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 | class GreaterThanCondition {
|
487 | |
488 |
|
489 |
|
490 | constructor(conditionType) {
|
491 | this.conditionType = conditionType;
|
492 | }
|
493 | |
494 |
|
495 |
|
496 |
|
497 | evaluate(dataElementValues) {
|
498 | const value = (+dataElementValues.get(this.conditionType.dataElementId));
|
499 | let comparisonValue = -1;
|
500 | if (isNaN(this.conditionType.comparisonValue)) {
|
501 | comparisonValue = (+dataElementValues.get(this.conditionType.comparisonValue));
|
502 | }
|
503 | else {
|
504 | comparisonValue = (+this.conditionType.comparisonValue);
|
505 | }
|
506 | return value > comparisonValue;
|
507 | }
|
508 | }
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 | class LessThanCondition {
|
515 | |
516 |
|
517 |
|
518 | constructor(conditionType) {
|
519 | this.conditionType = conditionType;
|
520 | }
|
521 | |
522 |
|
523 |
|
524 |
|
525 | evaluate(dataElementValues) {
|
526 | const value = (+dataElementValues.get(this.conditionType.dataElementId));
|
527 | let comparisonValue = -1;
|
528 | if (isNaN(this.conditionType.comparisonValue)) {
|
529 | comparisonValue = (+dataElementValues.get(this.conditionType.comparisonValue));
|
530 | }
|
531 | else {
|
532 | comparisonValue = (+this.conditionType.comparisonValue);
|
533 | }
|
534 | return value < comparisonValue;
|
535 | }
|
536 | }
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 | class GreaterThanOrEqualsCondition {
|
543 | |
544 |
|
545 |
|
546 | constructor(conditionType) {
|
547 | this.conditionType = conditionType;
|
548 | }
|
549 | |
550 |
|
551 |
|
552 |
|
553 | evaluate(dataElementValues) {
|
554 | const value = (+dataElementValues.get(this.conditionType.dataElementId));
|
555 | let comparisonValue = -1;
|
556 | if (isNaN(this.conditionType.comparisonValue)) {
|
557 | comparisonValue = (+dataElementValues.get(this.conditionType.comparisonValue));
|
558 | }
|
559 | else {
|
560 | comparisonValue = (+this.conditionType.comparisonValue);
|
561 | }
|
562 | return value >= comparisonValue;
|
563 | }
|
564 | }
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 | class LessThanOrEqualsCondition {
|
571 | |
572 |
|
573 |
|
574 | constructor(conditionType) {
|
575 | this.conditionType = conditionType;
|
576 | }
|
577 | |
578 |
|
579 |
|
580 |
|
581 | evaluate(dataElementValues) {
|
582 | const value = (+dataElementValues.get(this.conditionType.dataElementId));
|
583 | let comparisonValue = -1;
|
584 | if (isNaN(this.conditionType.comparisonValue)) {
|
585 | comparisonValue = (+dataElementValues.get(this.conditionType.comparisonValue));
|
586 | }
|
587 | else {
|
588 | comparisonValue = (+this.conditionType.comparisonValue);
|
589 | }
|
590 | return value <= comparisonValue;
|
591 | }
|
592 | }
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 | class ContainsCondition {
|
599 | |
600 |
|
601 |
|
602 | constructor(conditionType) {
|
603 | this.conditionType = conditionType;
|
604 | }
|
605 | |
606 |
|
607 |
|
608 |
|
609 | evaluate(dataElementValues) {
|
610 | let returnValue = false;
|
611 | const value = dataElementValues.get(this.conditionType.dataElementId);
|
612 | if (value !== undefined) {
|
613 | returnValue = value.indexOf(this.conditionType.comparisonValue) >= 0;
|
614 | }
|
615 | return returnValue;
|
616 | }
|
617 | }
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 | class AndCondition {
|
624 | constructor() {
|
625 | this.conditions = [];
|
626 | this.conditionType = 'AndCondition';
|
627 | }
|
628 | |
629 |
|
630 |
|
631 |
|
632 | evaluate(dataElementValues) {
|
633 | let returnValue = true;
|
634 | for (let conditionCounter = 0; conditionCounter < this.conditions.length; conditionCounter++) {
|
635 | const condition = this.conditions[conditionCounter];
|
636 | const executedCondition = condition.evaluate(dataElementValues);
|
637 | returnValue = (!executedCondition) ? false : (returnValue && executedCondition);
|
638 | if (!returnValue) {
|
639 | break;
|
640 | }
|
641 | }
|
642 | return returnValue;
|
643 | }
|
644 | }
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 | class OrCondition {
|
651 | constructor() {
|
652 | this.conditions = [];
|
653 | this.conditionType = 'OrCondition';
|
654 | }
|
655 | |
656 |
|
657 |
|
658 |
|
659 | evaluate(dataElementValues) {
|
660 | let returnValue = false;
|
661 | for (let conditionCounter = 0; conditionCounter < this.conditions.length; conditionCounter++) {
|
662 | const condition = this.conditions[conditionCounter];
|
663 | const executedCondition = condition.evaluate(dataElementValues);
|
664 | returnValue = (returnValue || executedCondition);
|
665 | if (returnValue) {
|
666 | break;
|
667 | }
|
668 | }
|
669 | return returnValue;
|
670 | }
|
671 | }
|
672 |
|
673 |
|
674 |
|
675 |
|
676 |
|
677 | class NotCondition {
|
678 | constructor() {
|
679 | this.conditions = [];
|
680 | this.conditionType = 'NotCondition';
|
681 | }
|
682 | |
683 |
|
684 |
|
685 |
|
686 | evaluate(dataElementValues) {
|
687 | const results = new Array();
|
688 | for (const condition of this.conditions) {
|
689 | results.push(condition.evaluate(dataElementValues));
|
690 | }
|
691 | return !(results[0]);
|
692 | }
|
693 | }
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 | class ConditionsCreationService {
|
700 | |
701 |
|
702 |
|
703 | constructor(arrayCheckerService) {
|
704 | this.arrayCheckerService = arrayCheckerService;
|
705 | }
|
706 | |
707 |
|
708 |
|
709 |
|
710 | returnConditionType(conditionJSON) {
|
711 | const conditionType = new ConditionType();
|
712 | conditionType.comparisonValue = conditionJSON.Attr.ComparisonValue;
|
713 | conditionType.dataElementId = conditionJSON.Attr.DataElementId;
|
714 | return conditionType;
|
715 | }
|
716 | |
717 |
|
718 |
|
719 |
|
720 | returnCondition(branchJSON) {
|
721 | let condition;
|
722 | if (branchJSON.hasOwnProperty('EqualCondition')) {
|
723 | condition = new EqualCondition(this.returnConditionType(branchJSON.EqualCondition));
|
724 | }
|
725 | if (branchJSON.hasOwnProperty('GreaterThanCondition')) {
|
726 | condition = new GreaterThanCondition(this.returnConditionType(branchJSON.GreaterThanCondition));
|
727 | }
|
728 | if (branchJSON.hasOwnProperty('LessThanCondition')) {
|
729 | condition = new LessThanCondition(this.returnConditionType(branchJSON.LessThanCondition));
|
730 | }
|
731 | if (branchJSON.hasOwnProperty('GreaterThanOrEqualsCondition')) {
|
732 | condition = new GreaterThanOrEqualsCondition(this.returnConditionType(branchJSON.GreaterThanOrEqualsCondition));
|
733 | }
|
734 | if (branchJSON.hasOwnProperty('LessThanOrEqualsCondition')) {
|
735 | condition = new LessThanOrEqualsCondition(this.returnConditionType(branchJSON.LessThanOrEqualsCondition));
|
736 | }
|
737 | if (branchJSON.hasOwnProperty('ContainsCondition')) {
|
738 | condition = new ContainsCondition(this.returnConditionType(branchJSON.ContainsCondition));
|
739 | }
|
740 | return condition;
|
741 | }
|
742 | |
743 |
|
744 |
|
745 |
|
746 | isComposite(compositeElementJSON) {
|
747 | return compositeElementJSON.hasOwnProperty('AndCondition') ||
|
748 | compositeElementJSON.hasOwnProperty('OrCondition') ||
|
749 | compositeElementJSON.hasOwnProperty('NotCondition');
|
750 | }
|
751 | |
752 |
|
753 |
|
754 |
|
755 |
|
756 | returnConditionFromJSON(conditionIdentifier, conditionJSON) {
|
757 | let condition;
|
758 | if (conditionIdentifier === 'EqualCondition') {
|
759 | condition = new EqualCondition(this.returnConditionType(conditionJSON));
|
760 | }
|
761 | if (conditionIdentifier === 'GreaterThanCondition') {
|
762 | condition = new GreaterThanCondition(this.returnConditionType(conditionJSON));
|
763 | }
|
764 | if (conditionIdentifier === 'LessThanCondition') {
|
765 | condition = new LessThanCondition(this.returnConditionType(conditionJSON));
|
766 | }
|
767 | if (conditionIdentifier === 'GreaterThanOrEqualsCondition') {
|
768 | condition = new GreaterThanOrEqualsCondition(this.returnConditionType(conditionJSON));
|
769 | }
|
770 | if (conditionIdentifier === 'LessThanOrEqualsCondition') {
|
771 | condition = new LessThanOrEqualsCondition(this.returnConditionType(conditionJSON));
|
772 | }
|
773 | if (conditionIdentifier === 'ContainsCondition') {
|
774 | condition = new ContainsCondition(this.returnConditionType(conditionJSON));
|
775 | }
|
776 | return condition;
|
777 | }
|
778 | |
779 |
|
780 |
|
781 |
|
782 | returnConditions(conditionsJSON) {
|
783 | let conditions;
|
784 | const conditionIdentifiers = ['EqualCondition', 'GreaterThanCondition', 'LessThanCondition',
|
785 | 'GreaterThanOrEqualsCondition', 'LessThanOrEqualsCondition', 'ContainsCondition'];
|
786 | for (const conditionIdentifier of conditionIdentifiers) {
|
787 | const conditionJSON = conditionsJSON[conditionIdentifier];
|
788 | if (conditionJSON !== undefined) {
|
789 | conditions = new Array();
|
790 | if (this.arrayCheckerService.isArray(conditionJSON)) {
|
791 | for (const jsonValue of conditionJSON) {
|
792 | conditions.push(this.returnConditionFromJSON(conditionIdentifier, jsonValue));
|
793 | }
|
794 | }
|
795 | else {
|
796 | conditions.push(this.returnConditionFromJSON(conditionIdentifier, conditionJSON));
|
797 | }
|
798 | }
|
799 | }
|
800 | return conditions;
|
801 | }
|
802 | |
803 |
|
804 |
|
805 |
|
806 | isHybrid(compositeElementJSON) {
|
807 | const compositeExists = compositeElementJSON.hasOwnProperty('AndCondition') ||
|
808 | compositeElementJSON.hasOwnProperty('OrCondition') ||
|
809 | compositeElementJSON.hasOwnProperty('NotCondition');
|
810 | const primitiveExists = compositeElementJSON.hasOwnProperty('EqualCondition') ||
|
811 | compositeElementJSON.hasOwnProperty('GreaterThanCondition') ||
|
812 | compositeElementJSON.hasOwnProperty('LessThanCondition') ||
|
813 | compositeElementJSON.hasOwnProperty('GreaterThanOrEqualsCondition') ||
|
814 | compositeElementJSON.hasOwnProperty('LessThanOrEqualsCondition') ||
|
815 | compositeElementJSON.hasOwnProperty('ContainsCondition');
|
816 | return compositeExists && primitiveExists;
|
817 | }
|
818 | |
819 |
|
820 |
|
821 |
|
822 | returnCompositeCondition(data) {
|
823 | if (!this.isComposite(data)) {
|
824 | return;
|
825 | }
|
826 | let compositeConditionJSON;
|
827 | let compositeCondition;
|
828 | if (data.hasOwnProperty('AndCondition')) {
|
829 | compositeConditionJSON = data.AndCondition;
|
830 | compositeCondition = new AndCondition();
|
831 | }
|
832 | else if (data.hasOwnProperty('OrCondition')) {
|
833 | compositeConditionJSON = data.OrCondition;
|
834 | compositeCondition = new OrCondition();
|
835 | }
|
836 | else if (data.hasOwnProperty('NotCondition')) {
|
837 | compositeConditionJSON = data.NotCondition;
|
838 | compositeCondition = new NotCondition();
|
839 | }
|
840 | if (!this.isComposite(compositeConditionJSON)) {
|
841 | compositeCondition.conditions = this.returnConditions(compositeConditionJSON);
|
842 | }
|
843 | else if (this.isHybrid(compositeConditionJSON)) {
|
844 | const jsonKeys = Object.keys(compositeConditionJSON);
|
845 | for (const jsonKey of jsonKeys) {
|
846 | const jsonValue = compositeConditionJSON[jsonKey];
|
847 | const jsonString = '{"' + jsonKey + '":' + JSON.stringify(jsonValue) + '}';
|
848 | const jsonObject = JSON.parse(jsonString);
|
849 | if (this.isComposite(jsonObject)) {
|
850 | this.returnInnerConditions(jsonObject, compositeCondition);
|
851 | }
|
852 | else {
|
853 | if (this.arrayCheckerService.isArray(jsonValue)) {
|
854 | for (const arrayValue of jsonValue) {
|
855 | compositeCondition.conditions.push(this.returnConditionFromJSON(jsonKey, arrayValue));
|
856 | }
|
857 | }
|
858 | else {
|
859 | compositeCondition.conditions.push(this.returnConditionFromJSON(jsonKey, jsonValue));
|
860 | }
|
861 | }
|
862 | }
|
863 | }
|
864 | else {
|
865 | this.returnInnerConditions(compositeConditionJSON, compositeCondition);
|
866 | }
|
867 | return compositeCondition;
|
868 | }
|
869 | |
870 |
|
871 |
|
872 |
|
873 | returnCompositeConditionFromName(elementName) {
|
874 | let compositeCondition;
|
875 | switch (elementName) {
|
876 | case 'AndCondition':
|
877 | {
|
878 | compositeCondition = new AndCondition();
|
879 | break;
|
880 | }
|
881 | case 'OrCondition':
|
882 | {
|
883 | compositeCondition = new OrCondition();
|
884 | break;
|
885 | }
|
886 | case 'NotCondition':
|
887 | {
|
888 | compositeCondition = new NotCondition();
|
889 | }
|
890 | }
|
891 | return compositeCondition;
|
892 | }
|
893 | |
894 |
|
895 |
|
896 |
|
897 |
|
898 |
|
899 | addConditionsToInnerConditions(key, value, compositeCondition) {
|
900 | const condition = this.returnCompositeConditionFromName(key);
|
901 | compositeCondition.conditions.push(condition);
|
902 | if (this.isHybrid(value)) {
|
903 | const jsonKeys = Object.keys(value);
|
904 | for (const jsonKey of jsonKeys) {
|
905 | const jsonValue = value[jsonKey];
|
906 | const jsonString = '{"' + jsonKey + '":' + JSON.stringify(jsonValue) + '}';
|
907 | const jsonObject = JSON.parse(jsonString);
|
908 | if (this.isComposite(jsonObject)) {
|
909 | this.returnInnerConditions(jsonObject, condition);
|
910 | }
|
911 | else {
|
912 | if (this.arrayCheckerService.isArray(jsonValue)) {
|
913 | for (const arrayValue of jsonValue) {
|
914 | condition.conditions.push(this.returnConditionFromJSON(jsonKey, arrayValue));
|
915 | }
|
916 | }
|
917 | else {
|
918 | condition.conditions.push(this.returnConditionFromJSON(jsonKey, jsonValue));
|
919 | }
|
920 | }
|
921 | }
|
922 | }
|
923 | else if (this.isComposite(value)) {
|
924 |
|
925 | }
|
926 | else {
|
927 | condition.conditions = this.returnConditions(value);
|
928 | }
|
929 | }
|
930 | |
931 |
|
932 |
|
933 |
|
934 |
|
935 | returnInnerConditions(innerConditionsJSON, compositeCondition) {
|
936 | const jsonKeys = Object.keys(innerConditionsJSON);
|
937 | for (const key of jsonKeys) {
|
938 | const values = innerConditionsJSON[key];
|
939 | if (this.arrayCheckerService.isArray(values)) {
|
940 | for (const value of values) {
|
941 | this.addConditionsToInnerConditions(key, value, compositeCondition);
|
942 | }
|
943 | }
|
944 | else {
|
945 | this.addConditionsToInnerConditions(key, innerConditionsJSON[key], compositeCondition);
|
946 | }
|
947 | }
|
948 | }
|
949 | }
|
950 | ConditionsCreationService.decorators = [
|
951 | { type: Injectable },
|
952 | ];
|
953 |
|
954 | ConditionsCreationService.ctorParameters = () => [
|
955 | { type: ArrayCheckerService, },
|
956 | ];
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 | class TextExpression {
|
963 | }
|
964 |
|
965 |
|
966 |
|
967 |
|
968 |
|
969 | class ArithmeticExpression {
|
970 | }
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 | class ComputedValueCreationService {
|
977 | constructor() { }
|
978 | |
979 |
|
980 |
|
981 |
|
982 | createComputedValue(dataAsJSON) {
|
983 | if (dataAsJSON['TextExpression'] !== undefined) {
|
984 | const computedValue = new TextExpression();
|
985 | computedValue.expressionText = dataAsJSON.TextExpression;
|
986 | return computedValue;
|
987 | }
|
988 | if (dataAsJSON['ArithmeticExpression'] !== undefined) {
|
989 | {
|
990 | const computedValue = new ArithmeticExpression();
|
991 | computedValue.expressionText = dataAsJSON.ArithmeticExpression;
|
992 | return computedValue;
|
993 | }
|
994 | }
|
995 | }
|
996 | }
|
997 | ComputedValueCreationService.decorators = [
|
998 | { type: Injectable },
|
999 | ];
|
1000 |
|
1001 | ComputedValueCreationService.ctorParameters = () => [];
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 | class DecisionPointsCreationService {
|
1008 | |
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 | constructor(arrayCheckerService, conditionsCreationService, computedValueCreationService) {
|
1014 | this.arrayCheckerService = arrayCheckerService;
|
1015 | this.conditionsCreationService = conditionsCreationService;
|
1016 | this.computedValueCreationService = computedValueCreationService;
|
1017 | }
|
1018 | |
1019 |
|
1020 |
|
1021 |
|
1022 | createRelevantDataElementReferences(dataElementRefJSON) {
|
1023 | const dataElementRef = new DataElementRef();
|
1024 | dataElementRef.dataElementId = dataElementRefJSON.Attr.DataElementId;
|
1025 | return dataElementRef;
|
1026 | }
|
1027 | |
1028 |
|
1029 |
|
1030 |
|
1031 | returnBranch(branchJSON) {
|
1032 | const branch = new Branch();
|
1033 | branch.label = branchJSON.Label;
|
1034 | if (branchJSON.EndPointRef) {
|
1035 | branch.endPointRef = new EndPointRef();
|
1036 | branch.endPointRef.endPointId = branchJSON.EndPointRef.Attr.EndPointId;
|
1037 | }
|
1038 | branch.condition = this.conditionsCreationService.returnCondition(branchJSON);
|
1039 | branch.computedValue = this.computedValueCreationService.createComputedValue(branchJSON);
|
1040 | if (this.conditionsCreationService.isComposite(branchJSON)) {
|
1041 | branch.compositeCondition = this.conditionsCreationService.returnCompositeCondition(branchJSON);
|
1042 | }
|
1043 | if (branchJSON.NotRelevantDataElements) {
|
1044 | const notRelevantDataElements = new NotRelevantDataElements();
|
1045 | notRelevantDataElements.dataElementReferences = new Array();
|
1046 | const dataElementRefs = branchJSON.NotRelevantDataElements.DataElementRef;
|
1047 | if (this.arrayCheckerService.isArray(dataElementRefs)) {
|
1048 | for (const dataElementRefJSON of dataElementRefs) {
|
1049 | notRelevantDataElements.dataElementReferences.push(this.createRelevantDataElementReferences(dataElementRefJSON));
|
1050 | }
|
1051 | }
|
1052 | else {
|
1053 | notRelevantDataElements.dataElementReferences.push(this.createRelevantDataElementReferences(dataElementRefs));
|
1054 | }
|
1055 | branch.notRelevantDataElements = notRelevantDataElements;
|
1056 | }
|
1057 | if (branchJSON.DecisionPoint) {
|
1058 | branch.decisionPoints = new Array();
|
1059 | this.addDecisionPoints(branchJSON.DecisionPoint, branch.decisionPoints);
|
1060 | }
|
1061 | return branch;
|
1062 | }
|
1063 | |
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 | addDecisionPoint(decsionPointAsJSON, decisionPoints) {
|
1069 | const decisionPoint = new DecisionPoint();
|
1070 | if (decsionPointAsJSON.Attr && decsionPointAsJSON.Attr.Id) {
|
1071 | decisionPoint.id = decsionPointAsJSON.Attr.Id;
|
1072 | }
|
1073 | decisionPoint.label = decsionPointAsJSON.Label;
|
1074 | const branchesJSON = decsionPointAsJSON.Branch;
|
1075 | if (branchesJSON !== undefined) {
|
1076 | decisionPoint.branches = new Array();
|
1077 | if (this.arrayCheckerService.isArray(branchesJSON)) {
|
1078 | for (const branchJSON of branchesJSON) {
|
1079 | decisionPoint.branches.push(this.returnBranch(branchJSON));
|
1080 | }
|
1081 | }
|
1082 | else {
|
1083 | decisionPoint.branches.push(this.returnBranch(branchesJSON));
|
1084 | }
|
1085 | const defaultBranchJSON = decsionPointAsJSON.DefaultBranch;
|
1086 | if (defaultBranchJSON !== undefined) {
|
1087 | decisionPoint.defaultBranch = this.createDefaultBranch(defaultBranchJSON);
|
1088 | }
|
1089 | }
|
1090 | decisionPoints.push(decisionPoint);
|
1091 | }
|
1092 | |
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 | addDecisionPoints(decsionPointsAsJSON, decisionPoints) {
|
1098 | if (this.arrayCheckerService.isArray(decsionPointsAsJSON)) {
|
1099 | for (const decisionPoint of decsionPointsAsJSON) {
|
1100 | this.addDecisionPoint(decisionPoint, decisionPoints);
|
1101 | }
|
1102 | }
|
1103 | else {
|
1104 | this.addDecisionPoint(decsionPointsAsJSON, decisionPoints);
|
1105 | }
|
1106 | }
|
1107 | |
1108 |
|
1109 |
|
1110 |
|
1111 | createDecisionPoints(data) {
|
1112 | const decisionPoints = new Array();
|
1113 | this.addDecisionPoints(data, decisionPoints);
|
1114 | return decisionPoints;
|
1115 | }
|
1116 | |
1117 |
|
1118 |
|
1119 |
|
1120 | createDefaultBranch(data) {
|
1121 | const defaultBranch = new Branch();
|
1122 | defaultBranch.label = 'Default Branch';
|
1123 | defaultBranch.computedValue = this.computedValueCreationService.createComputedValue(data);
|
1124 | return defaultBranch;
|
1125 | }
|
1126 | }
|
1127 | DecisionPointsCreationService.decorators = [
|
1128 | { type: Injectable },
|
1129 | ];
|
1130 |
|
1131 | DecisionPointsCreationService.ctorParameters = () => [
|
1132 | { type: ArrayCheckerService, },
|
1133 | { type: ConditionsCreationService, },
|
1134 | { type: ComputedValueCreationService, },
|
1135 | ];
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 | class Rules {
|
1142 | }
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 | class TemplatePartial {
|
1149 | }
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 | class TemplateManagerService {
|
1156 | |
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 | constructor(diagramService, elememtcreationService, arrayCheckerService, decisionPointsCreationService) {
|
1163 | this.diagramService = diagramService;
|
1164 | this.elememtcreationService = elememtcreationService;
|
1165 | this.arrayCheckerService = arrayCheckerService;
|
1166 | this.decisionPointsCreationService = decisionPointsCreationService;
|
1167 | this.endPointXMLString = [];
|
1168 | this.stringParser = require('string');
|
1169 | }
|
1170 | |
1171 |
|
1172 |
|
1173 |
|
1174 | getTemplate(templateContent) {
|
1175 | const template = new Template();
|
1176 | let templateContentAsJSON;
|
1177 | templateContentAsJSON = this.parseToJson(templateContent);
|
1178 | if (template === undefined) {
|
1179 | throw new Error('Unable to parse the template');
|
1180 | }
|
1181 | template.metadata = this.getMetaData(templateContentAsJSON.Metadata);
|
1182 | template.dataElements = this.getDataElements(templateContentAsJSON.DataElements);
|
1183 | if (templateContentAsJSON.Rules) {
|
1184 | template.rules = new Rules();
|
1185 | template.rules.decisionPoints = this.decisionPointsCreationService.
|
1186 | createDecisionPoints(templateContentAsJSON.Rules.DecisionPoint);
|
1187 | }
|
1188 | template.templatePartial = this.returnEndpoints(templateContent);
|
1189 | template.endPointsString = this.endPointXMLString;
|
1190 | template.xmlContent = templateContent;
|
1191 | return template;
|
1192 | }
|
1193 | |
1194 |
|
1195 |
|
1196 |
|
1197 | getTemplatePartial(templatePartialJSON) {
|
1198 | const templatePartial = new TemplatePartial;
|
1199 | templatePartial.id = templatePartialJSON.Attr.Id;
|
1200 | templatePartial.sectionIfNotValue = templatePartialJSON.SectionIfValueNot;
|
1201 | templatePartial.sectionIfValues = templatePartialJSON.SectionIfValue;
|
1202 | return templatePartial;
|
1203 | }
|
1204 | |
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 | returnEndPointContents(content, startToken, endToken) {
|
1211 | const contents = new Array();
|
1212 | let templateSearchIndexPosition = 0;
|
1213 | while (true) {
|
1214 | const contentStartPosition = content.indexOf(startToken, templateSearchIndexPosition);
|
1215 | const contentEndPosition = content.indexOf(endToken, templateSearchIndexPosition);
|
1216 | if (contentStartPosition >= 0 && contentEndPosition >= 0) {
|
1217 | const endPosition = contentEndPosition + endToken.length;
|
1218 | const contentData = content.substring(contentStartPosition, endPosition);
|
1219 | contents.push(contentData);
|
1220 | templateSearchIndexPosition = endPosition + 1;
|
1221 | }
|
1222 | else {
|
1223 | break;
|
1224 | }
|
1225 | }
|
1226 | return contents;
|
1227 | }
|
1228 | |
1229 |
|
1230 |
|
1231 |
|
1232 | returnTemplatePartials(templatePartialArray) {
|
1233 | const templatePartials = new Array();
|
1234 | for (const arrayItem of templatePartialArray) {
|
1235 | const templatePartial = new TemplatePartial();
|
1236 | const templatePartialAsJSON = this.parseToJson(arrayItem);
|
1237 | templatePartial.id = templatePartialAsJSON.Attr.Id;
|
1238 | }
|
1239 | return templatePartials;
|
1240 | }
|
1241 | |
1242 |
|
1243 |
|
1244 |
|
1245 | returnEndpoints(xmlData) {
|
1246 | const endPointStartToken = '<EndPoints>';
|
1247 | const endPointEndToken = '</EndPoints>';
|
1248 | const endPointStartTokenPosition = xmlData.indexOf(endPointStartToken);
|
1249 | const endPointEndTokenPosition = xmlData.indexOf(endPointEndToken);
|
1250 | if (endPointStartTokenPosition >= 0 && endPointEndTokenPosition >= 0) {
|
1251 | const contentStartPosition = (endPointStartTokenPosition + endPointStartToken.length);
|
1252 | const endPointContent = xmlData.substring(contentStartPosition, endPointEndTokenPosition);
|
1253 | if (endPointContent.length > 0) {
|
1254 | const templatePartials = this.returnEndPointContents(endPointContent, '<TemplatePartial', '</TemplatePartial>');
|
1255 | this.endPointXMLString = this.returnEndPointContents(endPointContent, '<EndPoint', '</EndPoint>');
|
1256 | return templatePartials;
|
1257 | }
|
1258 | }
|
1259 | }
|
1260 | |
1261 |
|
1262 |
|
1263 |
|
1264 | parseToJson(xmlData) {
|
1265 | let jsonResult;
|
1266 | const parseString = require('xml2js').parseString;
|
1267 | parseString(xmlData, { explicitRoot: false, explicitArray: false, attrkey: 'Attr' }, function (err, result) {
|
1268 | jsonResult = result;
|
1269 | });
|
1270 | return jsonResult;
|
1271 | }
|
1272 | |
1273 |
|
1274 |
|
1275 |
|
1276 | getMetaData(metadataJSON) {
|
1277 | const metadata = new Metadata();
|
1278 | metadata.label = metadataJSON.Label;
|
1279 | metadata.id = metadataJSON.ID;
|
1280 | metadata.schemaVersion = metadataJSON.SchemaVersion;
|
1281 | metadata.ruleVersion = metadataJSON.RuleVersion;
|
1282 | const diagramsAsJSON = metadataJSON.Info.Diagrams.Diagram;
|
1283 | metadata.diagrams = this.diagramService.returnDiagrams(diagramsAsJSON);
|
1284 | return metadata;
|
1285 | }
|
1286 | |
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 | returnDataElement(elementType, dataElementsJSON) {
|
1292 | const dataElements = new Array();
|
1293 | let dataElementCreationServiceInstance;
|
1294 | for (const dataElementCreationService of this.elememtcreationService) {
|
1295 | if (dataElementCreationService.elementType === elementType) {
|
1296 | dataElementCreationServiceInstance = dataElementCreationService;
|
1297 | break;
|
1298 | }
|
1299 | }
|
1300 | if (dataElementCreationServiceInstance !== undefined && dataElementsJSON !== undefined) {
|
1301 | if (this.arrayCheckerService.isArray(dataElementsJSON)) {
|
1302 | for (const dataElementJSON of dataElementsJSON) {
|
1303 | const dataElement = dataElementCreationServiceInstance.createElement(dataElementJSON);
|
1304 | dataElements.push(dataElement);
|
1305 | }
|
1306 | }
|
1307 | else {
|
1308 | const dataElement = dataElementCreationServiceInstance.createElement(dataElementsJSON);
|
1309 | dataElements.push(dataElement);
|
1310 | }
|
1311 | }
|
1312 | return dataElements;
|
1313 | }
|
1314 | |
1315 |
|
1316 |
|
1317 |
|
1318 | getDataElements(dataElementsJSON) {
|
1319 | let dataElements = new Array();
|
1320 | dataElements = dataElements.concat(this.returnDataElement('ChoiceDataElement', dataElementsJSON.ChoiceDataElement));
|
1321 | dataElements = dataElements.concat(this.returnDataElement('MultiChoiceDataElement', dataElementsJSON.MultiChoiceDataElement));
|
1322 | dataElements = dataElements.concat(this.returnDataElement('NumericDataElement', dataElementsJSON.NumericDataElement));
|
1323 | dataElements = dataElements.concat(this.returnDataElement('GlobalValue', dataElementsJSON.GlobalValue));
|
1324 | dataElements = dataElements.concat(this.returnDataElement('ComputedDataElement', dataElementsJSON.ComputedDataElement));
|
1325 | dataElements = dataElements.concat(this.returnDataElement('IntegerDataElement', dataElementsJSON.IntegerDataElement));
|
1326 | return dataElements;
|
1327 | }
|
1328 | }
|
1329 | TemplateManagerService.decorators = [
|
1330 | { type: Injectable },
|
1331 | ];
|
1332 |
|
1333 | TemplateManagerService.ctorParameters = () => [
|
1334 | { type: DiagramService, },
|
1335 | { type: Array, decorators: [{ type: Inject, args: [CreationServiceInjectorToken,] },] },
|
1336 | { type: ArrayCheckerService, },
|
1337 | { type: DecisionPointsCreationService, },
|
1338 | ];
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 | class AllTextReport {
|
1345 | }
|
1346 |
|
1347 | const ReportTextPosition = {
|
1348 | Down: 0,
|
1349 | Right: 1,
|
1350 | };
|
1351 | ReportTextPosition[ReportTextPosition.Down] = "Down";
|
1352 | ReportTextPosition[ReportTextPosition.Right] = "Right";
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 | class AcrAssistSimulatorComponent {
|
1359 | |
1360 |
|
1361 |
|
1362 |
|
1363 | constructor(templateManagerService, simulatorEngineService) {
|
1364 | this.templateManagerService = templateManagerService;
|
1365 | this.simulatorEngineService = simulatorEngineService;
|
1366 | this.returnExecutionHistory = new EventEmitter();
|
1367 | this.returnDefaultElements = new EventEmitter();
|
1368 | this.inputValues = [];
|
1369 | this.position = ReportTextPosition;
|
1370 | }
|
1371 | |
1372 |
|
1373 |
|
1374 |
|
1375 | ngOnChanges(changes) {
|
1376 | this.isReset = true;
|
1377 | this.isEmptyContent = this.templateContent === undefined || this.templateContent.length === 0 && this.inputValues.length === 0 &&
|
1378 | this.inputData === undefined;
|
1379 | if (this.isEmptyContent) {
|
1380 | return;
|
1381 | }
|
1382 | if (this.inputData !== undefined) {
|
1383 | if (this.inputData.length > 0) {
|
1384 | this.inputValues = JSON.parse(this.inputData);
|
1385 | }
|
1386 | }
|
1387 | this.template = this.templateManagerService.getTemplate(this.templateContent);
|
1388 | this.simulatorEngineService.initialize(this.template);
|
1389 | if (this.inputValues.length !== 0) {
|
1390 | for (const dataeElement of this.template.dataElements) {
|
1391 | const inputValue = this.inputValues.filter(x => x.dataElementId === dataeElement.id);
|
1392 | if (inputValue !== undefined && inputValue.length > 0) {
|
1393 | dataeElement.currentValue = inputValue[0].dataElementValue;
|
1394 | }
|
1395 | }
|
1396 | }
|
1397 | this.dataElements = this.template.dataElements;
|
1398 | for (let index = 0; index < this.template.metadata.diagrams.length; index++) {
|
1399 | if (this.template.metadata.diagrams[index].keyDiagram) {
|
1400 | const element = new Diagram();
|
1401 | element.label = this.template.metadata.diagrams[index].label;
|
1402 | element.location = this.imagePath + '/' + this.template.metadata.diagrams[index].location;
|
1403 | element.keyDiagram = this.template.metadata.diagrams[index].keyDiagram;
|
1404 | this.keyDiagram = element;
|
1405 | break;
|
1406 | }
|
1407 | }
|
1408 | this.resultText = undefined;
|
1409 | }
|
1410 | |
1411 |
|
1412 |
|
1413 | resetElements() {
|
1414 | this.template = this.templateManagerService.getTemplate(this.templateContent);
|
1415 | this.simulatorEngineService.initialize(this.template);
|
1416 | this.dataElements = this.template.dataElements;
|
1417 | this.resultText = undefined;
|
1418 | this.returnDefaultElements.emit();
|
1419 | }
|
1420 | |
1421 |
|
1422 |
|
1423 |
|
1424 | recieveReportText(textReport) {
|
1425 | this.resultText = textReport;
|
1426 | }
|
1427 | |
1428 |
|
1429 |
|
1430 |
|
1431 | recievedExecutionHistory(finalExecutionHistory) {
|
1432 | this.returnExecutionHistory.emit(finalExecutionHistory);
|
1433 | }
|
1434 | }
|
1435 | AcrAssistSimulatorComponent.decorators = [
|
1436 | { type: Component, args: [{
|
1437 | selector: 'acr-assist-simulator',
|
1438 | template: `<ng-container *ngIf="!isEmptyContent">
|
1439 | <div class="ibox-content">
|
1440 | <div class="box box-primary">
|
1441 | <ng-container *ngIf="resultText !== undefined">
|
1442 | <acr-assist-report-text [reportText]="resultText"></acr-assist-report-text>
|
1443 | </ng-container>
|
1444 | </div>
|
1445 | <div class="box box-primary box-solid margin-b-0">
|
1446 | <div class="box-body">
|
1447 | <div id="div-simulator-form" class="padding-r-10">
|
1448 | <form class="form-horizontal">
|
1449 | <div class="row content-area">
|
1450 | <div class="border-0">
|
1451 | <ng-container>
|
1452 | <acr-assist-data-element [dataElements]="dataElements" [templatePartial]="template.templatePartial" [endPointXMLString]="template.endPointsString"
|
1453 | [imagePath]="imagePath" [xmlContent]="template.xmlContent" (returnReportText)='recieveReportText($event)'
|
1454 | [inputValues]="inputValues" [isReset]="isReset" (returnExecutionHistory)='recievedExecutionHistory($event)'></acr-assist-data-element>
|
1455 | </ng-container>
|
1456 | </div>
|
1457 |
|
1458 | <div class="col-sm-6 text-right border-0 fixed-report-text-sidebar">
|
1459 | <div *ngIf=" showKeyDiagram === true" class="keydiagram">
|
1460 | <img class="img-max-width" src="../../../../assets/XMLFIles/Hello_RADS/LIRADS.png">
|
1461 | </div>
|
1462 | </div>
|
1463 | </div>
|
1464 | </form>
|
1465 | </div>
|
1466 | </div>
|
1467 | </div>
|
1468 | </div>
|
1469 | </ng-container>
|
1470 | `,
|
1471 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
1472 | },] },
|
1473 | ];
|
1474 |
|
1475 | AcrAssistSimulatorComponent.ctorParameters = () => [
|
1476 | { type: TemplateManagerService, },
|
1477 | { type: SimulatorEngineService, },
|
1478 | ];
|
1479 | AcrAssistSimulatorComponent.propDecorators = {
|
1480 | "templateContent": [{ type: Input },],
|
1481 | "imagePath": [{ type: Input },],
|
1482 | "showKeyDiagram": [{ type: Input },],
|
1483 | "reportTextPosition": [{ type: Input },],
|
1484 | "returnExecutionHistory": [{ type: Output },],
|
1485 | "returnDefaultElements": [{ type: Output },],
|
1486 | "inputValues": [{ type: Input },],
|
1487 | "inputData": [{ type: Input },],
|
1488 | };
|
1489 |
|
1490 |
|
1491 |
|
1492 |
|
1493 |
|
1494 |
|
1495 |
|
1496 |
|
1497 | class DataElementCreationBaseService {
|
1498 | |
1499 |
|
1500 |
|
1501 | constructor(diagramService) {
|
1502 | this.diagramService = diagramService;
|
1503 | }
|
1504 | |
1505 |
|
1506 |
|
1507 |
|
1508 | returnDiagram(diagramJSON) {
|
1509 | const metadataDiagram = new Diagram();
|
1510 | metadataDiagram.displaySequence = diagramJSON.Attr.DisplaySequence;
|
1511 | metadataDiagram.keyDiagram = diagramJSON.Attr.IsKeyDiagram ? diagramJSON.Attr.IsKeyDiagram : false;
|
1512 | metadataDiagram.label = diagramJSON.Label;
|
1513 | metadataDiagram.location = diagramJSON.Location;
|
1514 | return metadataDiagram;
|
1515 | }
|
1516 | |
1517 |
|
1518 |
|
1519 |
|
1520 |
|
1521 | populateBasicData(data, dataElement) {
|
1522 | dataElement.dataElementType = this.elementType;
|
1523 | dataElement.displaySequence = data.Attr.DisplaySequence;
|
1524 | dataElement.id = data.Attr.Id;
|
1525 | dataElement.isRequired = data.Attr.IsRequired === 'true' ? true : false;
|
1526 | dataElement.label = data.Label;
|
1527 | dataElement.hint = data.Hint;
|
1528 | dataElement.cdeId = data.Attr.CdeId;
|
1529 | if (data.Diagrams) {
|
1530 | dataElement.diagrams = this.diagramService.returnDiagrams(data.Diagrams.Diagram);
|
1531 | }
|
1532 | dataElement.currentValue = undefined;
|
1533 | dataElement.defaultValue = undefined;
|
1534 | }
|
1535 | }
|
1536 | DataElementCreationBaseService.decorators = [
|
1537 | { type: Injectable },
|
1538 | ];
|
1539 |
|
1540 | DataElementCreationBaseService.ctorParameters = () => [
|
1541 | { type: DiagramService, },
|
1542 | ];
|
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 | class BaseDataElement {
|
1549 | constructor() {
|
1550 | this.isVisible = true;
|
1551 | }
|
1552 | }
|
1553 |
|
1554 |
|
1555 |
|
1556 |
|
1557 |
|
1558 | class ChoiceDataElement extends BaseDataElement {
|
1559 | constructor() {
|
1560 | super(...arguments);
|
1561 | this.allowFreetext = false;
|
1562 | }
|
1563 | }
|
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 |
|
1569 | class Choice {
|
1570 | }
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 | class ImageElements {
|
1577 | }
|
1578 |
|
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 | class ImageMap extends ImageElements {
|
1584 | }
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 | class Area {
|
1591 | }
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 | class AreaMap {
|
1598 | }
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 | class ChoiceDataElementCreationService extends DataElementCreationBaseService {
|
1605 | |
1606 |
|
1607 |
|
1608 |
|
1609 | constructor(diagramService, arrayCheckerService) {
|
1610 | super(diagramService);
|
1611 | this.arrayCheckerService = arrayCheckerService;
|
1612 | this.elementType = 'ChoiceDataElement';
|
1613 | }
|
1614 | |
1615 |
|
1616 |
|
1617 |
|
1618 | returnChoice(choiceItem) {
|
1619 | const choice = new Choice();
|
1620 | choice.label = choiceItem.Label;
|
1621 | choice.value = choiceItem.Value;
|
1622 | choice.hint = choiceItem.Hint;
|
1623 | choice.reportText = choiceItem.ReportText;
|
1624 | choice.default = false;
|
1625 | if (choiceItem.Attr && choiceItem.Attr.IsDefault) {
|
1626 | choice.default = choiceItem.Attr.IsDefault;
|
1627 | }
|
1628 | return choice;
|
1629 | }
|
1630 | |
1631 |
|
1632 |
|
1633 |
|
1634 | returnArea(areaJSON) {
|
1635 | const area = new Area();
|
1636 | area.choiceValue = areaJSON.Attr.ChoiceValue;
|
1637 | area.coords = areaJSON.Attr.Coords;
|
1638 | area.shape = areaJSON.Attr.Shape;
|
1639 | return area;
|
1640 | }
|
1641 | |
1642 |
|
1643 |
|
1644 |
|
1645 | createElement(data) {
|
1646 | const dataElement = new ChoiceDataElement();
|
1647 | super.populateBasicData(data, dataElement);
|
1648 | dataElement.allowFreetext = data.Attr.AllowFreetext ? data.Attr.AllowFreetext : false;
|
1649 | const choiceItems = data.ChoiceInfo.Choice;
|
1650 | let defaultValue;
|
1651 | if (choiceItems !== undefined) {
|
1652 | dataElement.choiceInfo = new Array();
|
1653 | if (this.arrayCheckerService.isArray(choiceItems)) {
|
1654 | for (const choiceItem of choiceItems) {
|
1655 | const choice = this.returnChoice(choiceItem);
|
1656 | if (choice.default) {
|
1657 | defaultValue = choice.value;
|
1658 | }
|
1659 | dataElement.choiceInfo.push(choice);
|
1660 | }
|
1661 | }
|
1662 | else {
|
1663 | const choice = this.returnChoice(choiceItems);
|
1664 | if (choice.default) {
|
1665 | defaultValue = choice.value;
|
1666 | }
|
1667 | dataElement.choiceInfo.push(choice);
|
1668 | }
|
1669 | }
|
1670 | dataElement.defaultValue = defaultValue;
|
1671 | dataElement.currentValue = defaultValue;
|
1672 | const imageMap = data.ImageMap;
|
1673 | if (imageMap !== undefined) {
|
1674 | dataElement.imageMap = new ImageMap();
|
1675 | dataElement.imageMap.location = imageMap.Location;
|
1676 | const areaMaps = imageMap.Map.Area;
|
1677 | if (areaMaps !== undefined) {
|
1678 | dataElement.imageMap.map = new AreaMap();
|
1679 | dataElement.imageMap.map.areas = new Array();
|
1680 | if (this.arrayCheckerService.isArray(areaMaps)) {
|
1681 | for (const areaMap of areaMaps) {
|
1682 | dataElement.imageMap.map.areas.push(this.returnArea(areaMap));
|
1683 | }
|
1684 | }
|
1685 | else {
|
1686 | dataElement.imageMap.map.areas.push(this.returnArea(areaMaps));
|
1687 | }
|
1688 | }
|
1689 | }
|
1690 | return dataElement;
|
1691 | }
|
1692 | }
|
1693 | ChoiceDataElementCreationService.decorators = [
|
1694 | { type: Injectable },
|
1695 | ];
|
1696 |
|
1697 | ChoiceDataElementCreationService.ctorParameters = () => [
|
1698 | { type: DiagramService, },
|
1699 | { type: ArrayCheckerService, },
|
1700 | ];
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 | class MultipleChoiceDataElementCreationService extends ChoiceDataElementCreationService {
|
1707 | |
1708 |
|
1709 |
|
1710 |
|
1711 | constructor(diagramService, arrayCheckerService) {
|
1712 | super(diagramService, arrayCheckerService);
|
1713 | this.elementType = 'MultiChoiceDataElement';
|
1714 | }
|
1715 | }
|
1716 | MultipleChoiceDataElementCreationService.decorators = [
|
1717 | { type: Injectable },
|
1718 | ];
|
1719 |
|
1720 | MultipleChoiceDataElementCreationService.ctorParameters = () => [
|
1721 | { type: DiagramService, },
|
1722 | { type: ArrayCheckerService, },
|
1723 | ];
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 |
|
1729 | class NumericDataElement extends BaseDataElement {
|
1730 | }
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 | class NumericDataElementCreationService extends DataElementCreationBaseService {
|
1737 | |
1738 |
|
1739 |
|
1740 | constructor(diagramService) {
|
1741 | super(diagramService);
|
1742 | this.elementType = 'NumericDataElement';
|
1743 | }
|
1744 | |
1745 |
|
1746 |
|
1747 |
|
1748 | createElement(data) {
|
1749 | const dataElement = new NumericDataElement();
|
1750 | super.populateBasicData(data, dataElement);
|
1751 | dataElement.minimum = data.Minimum;
|
1752 | dataElement.maximum = data.Maximum;
|
1753 | return dataElement;
|
1754 | }
|
1755 | }
|
1756 | NumericDataElementCreationService.decorators = [
|
1757 | { type: Injectable },
|
1758 | ];
|
1759 |
|
1760 | NumericDataElementCreationService.ctorParameters = () => [
|
1761 | { type: DiagramService, },
|
1762 | ];
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 | class IntegerDataElement extends BaseDataElement {
|
1769 | }
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 | class IntegerDataElementCreationService extends DataElementCreationBaseService {
|
1776 | |
1777 |
|
1778 |
|
1779 | constructor(diagramService) {
|
1780 | super(diagramService);
|
1781 | this.elementType = 'IntegerDataElement';
|
1782 | }
|
1783 | |
1784 |
|
1785 |
|
1786 |
|
1787 | createElement(data) {
|
1788 | const dataElement = new IntegerDataElement();
|
1789 | super.populateBasicData(data, dataElement);
|
1790 | dataElement.minimum = data.Minimum;
|
1791 | dataElement.maximum = data.Maximum;
|
1792 | return dataElement;
|
1793 | }
|
1794 | }
|
1795 | IntegerDataElementCreationService.decorators = [
|
1796 | { type: Injectable },
|
1797 | ];
|
1798 |
|
1799 | IntegerDataElementCreationService.ctorParameters = () => [
|
1800 | { type: DiagramService, },
|
1801 | ];
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 | const $ = require('jquery');
|
1808 | class AssistDataElementComponent {
|
1809 | |
1810 |
|
1811 |
|
1812 | constructor(simulatorEngineService) {
|
1813 | this.simulatorEngineService = simulatorEngineService;
|
1814 | this.Endpoints = [];
|
1815 | this.returnReportText = new EventEmitter();
|
1816 | this.returnExecutionHistory = new EventEmitter();
|
1817 | this.comparisonValues = [];
|
1818 | this.selectedChoiceValues = [];
|
1819 | this.executedResultIds = [];
|
1820 | this.executedResultHistories = [];
|
1821 | this.inputValues = [];
|
1822 | }
|
1823 | |
1824 |
|
1825 |
|
1826 | ngOnInit() {
|
1827 | this.simulatorEngineService.simulatorStateChanged.subscribe((message) => {
|
1828 | this.simulatorState = (message);
|
1829 | this.dataElementValues = this.simulatorEngineService.getAllDataElementValues();
|
1830 | for (const dataElement of this.dataElements) {
|
1831 | if (this.simulatorState.nonRelevantDataElementIds && this.simulatorState.nonRelevantDataElementIds.length > 0) {
|
1832 | if (this.simulatorState.nonRelevantDataElementIds.indexOf(dataElement.id) >= 0) {
|
1833 | dataElement.isVisible = false;
|
1834 | }
|
1835 | else {
|
1836 | dataElement.isVisible = true;
|
1837 | }
|
1838 | }
|
1839 | else {
|
1840 | dataElement.isVisible = true;
|
1841 | }
|
1842 | dataElement.currentValue = (dataElement.currentValue !== undefined) ? dataElement.currentValue : this.dataElementValues[dataElement.id];
|
1843 | }
|
1844 | if (this.simulatorState.endPointId && this.simulatorState.endPointId.length > 0) {
|
1845 | this.generateReportText(this.simulatorState.endPointId);
|
1846 | }
|
1847 | else {
|
1848 | this.returnReportText.emit(undefined);
|
1849 | }
|
1850 | });
|
1851 | }
|
1852 | |
1853 |
|
1854 |
|
1855 |
|
1856 | ngOnChanges(changes) {
|
1857 | this.dataElements = this.dataElements.filter(x => x.displaySequence != null).sort(function (DE_1, DE_2) { return DE_1.displaySequence - DE_2.displaySequence; });
|
1858 | this.executedResultIds = [];
|
1859 | }
|
1860 | |
1861 |
|
1862 |
|
1863 |
|
1864 | choiceSelected($event) {
|
1865 | if ($event.receivedElement !== undefined && $event.selectedCondition !== undefined) {
|
1866 | this.selectedChoiceValues[$event.receivedElement.elementId + 'SelectedValue'] = $event.receivedElement.selectedText;
|
1867 | this.simulatorEngineService.addOrUpdateDataElement($event.receivedElement.elementId, $event.receivedElement.selectedValue, $event.receivedElement.selectedText);
|
1868 | const executedResults = [];
|
1869 | executedResults[$event.selectedCondition.selectedCondition] = $event.selectedCondition.selectedValue;
|
1870 | this.executedResultIds[$event.selectedCondition.selectedConditionId] = executedResults;
|
1871 | if (this.simulatorState.endPointId && this.simulatorState.endPointId.length > 0) {
|
1872 | this.generateExecutionHistory();
|
1873 | }
|
1874 | }
|
1875 | }
|
1876 | |
1877 |
|
1878 |
|
1879 |
|
1880 | numericSelected($event) {
|
1881 | if ($event.receivedElement !== undefined && $event.selectedCondition !== undefined) {
|
1882 | this.simulatorEngineService.addOrUpdateDataElement($event.receivedElement.elementId, $event.receivedElement.selectedValue, $event.receivedElement.selectedValue);
|
1883 | const executedResults = [];
|
1884 | executedResults[$event.selectedCondition.selectedCondition] = $event.selectedCondition.selectedValue;
|
1885 | this.executedResultIds[$event.selectedCondition.selectedConditionId] = executedResults;
|
1886 | if (this.simulatorState.endPointId && this.simulatorState.endPointId.length > 0) {
|
1887 | this.generateExecutionHistory();
|
1888 | }
|
1889 | }
|
1890 | }
|
1891 | |
1892 |
|
1893 |
|
1894 |
|
1895 | multiSelected($event) {
|
1896 | if ($event.receivedElement !== undefined && $event.selectedCondition !== undefined) {
|
1897 | this.comparisonValues[$event.receivedElement.elementId + 'ComparisonValue'] = $event.receivedElement.selectedComparisonValues;
|
1898 | this.simulatorEngineService.addOrUpdateDataElement($event.receivedElement.elementId, $event.receivedElement.selectedComparisonValues, $event.receivedElement.selectedValues);
|
1899 | const executedResults = [];
|
1900 | executedResults[$event.selectedCondition.selectedCondition] = $event.selectedCondition.selectedValue;
|
1901 | this.executedResultIds[$event.selectedCondition.selectedConditionId] = executedResults;
|
1902 | if (this.simulatorState.endPointId && this.simulatorState.endPointId.length > 0) {
|
1903 | this.generateExecutionHistory();
|
1904 | }
|
1905 | }
|
1906 | }
|
1907 | |
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 | load(inputValues, isReset) {
|
1913 | if (inputValues !== undefined) {
|
1914 | if (isReset) {
|
1915 | $('select').prop('selectedIndex', 0);
|
1916 | }
|
1917 | this.returnReportText.emit(undefined);
|
1918 | for (const inputValue of inputValues) {
|
1919 | if (inputValue !== undefined) {
|
1920 | for (const dataElement of this.dataElements) {
|
1921 | if (dataElement.id === inputValue.dataElementId) {
|
1922 | switch (dataElement.dataElementType) {
|
1923 | case 'ChoiceDataElement':
|
1924 | if (inputValue.dataElementValue !== undefined) {
|
1925 | if (!isReset) {
|
1926 | $('#' + inputValue.dataElementValue + '_' + inputValue.dataElementId).prop('checked', true);
|
1927 | this.simulatorEngineService.addOrUpdateDataElement(inputValue.dataElementId, inputValue.dataElementValue, inputValue.dataElementValue);
|
1928 | }
|
1929 | else {
|
1930 | $('#' + inputValue.dataElementValue + '_' + inputValue.dataElementId).prop('checked', false);
|
1931 |
|
1932 | this.isReset = true;
|
1933 | }
|
1934 | }
|
1935 | break;
|
1936 | case 'IntegerDataElement':
|
1937 | if (inputValue.dataElementValue !== undefined) {
|
1938 | if (!isReset) {
|
1939 | $('#' + inputValue.dataElementId).val(inputValue.dataElementValue);
|
1940 | this.simulatorEngineService.addOrUpdateDataElement(inputValue.dataElementId, inputValue.dataElementValue, inputValue.dataElementValue);
|
1941 | $('#' + inputValue.dataElementId).trigger('change');
|
1942 | }
|
1943 | else {
|
1944 | $('#' + inputValue.dataElementId).val('');
|
1945 | $('#' + inputValue.dataElementId).trigger('change');
|
1946 | }
|
1947 | const customEvent = document.createEvent('Event');
|
1948 | customEvent.initEvent('change', true, true);
|
1949 | $('#' + inputValue.dataElementId)[0].dispatchEvent(customEvent);
|
1950 | }
|
1951 | break;
|
1952 | case 'NumericDataElement':
|
1953 | if (inputValue.dataElementValue !== undefined) {
|
1954 | if (!isReset) {
|
1955 | $('#' + inputValue.dataElementId).val(inputValue.dataElementValue);
|
1956 | this.simulatorEngineService.addOrUpdateDataElement(inputValue.dataElementId, inputValue.dataElementValue, inputValue.dataElementValue);
|
1957 | $('#' + inputValue.dataElementId).trigger('keyup');
|
1958 | }
|
1959 | else {
|
1960 | $('#' + inputValue.dataElementId).val('');
|
1961 | $('#' + inputValue.dataElementId).trigger('keyup');
|
1962 | }
|
1963 | const customEvent = document.createEvent('Event');
|
1964 | customEvent.initEvent('change', true, true);
|
1965 | $('#' + inputValue.dataElementId)[0].dispatchEvent(customEvent);
|
1966 | }
|
1967 | break;
|
1968 | case 'MultiChoiceDataElement':
|
1969 | if (inputValue.dataElementValue !== undefined) {
|
1970 | const customEvent = document.createEvent('Event');
|
1971 | customEvent.initEvent('change', true, true);
|
1972 | if (inputValue.dataElementValue.length !== undefined && inputValue.dataElementValue.length > 0) {
|
1973 | if (!isReset) {
|
1974 | if (Array.isArray(inputValue.dataElementValue)) {
|
1975 | for (const element in inputValue.dataElementValue) {
|
1976 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue[element]).prop('checked', true);
|
1977 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue[element])[0].dispatchEvent(customEvent);
|
1978 | }
|
1979 | }
|
1980 | else {
|
1981 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue).prop('checked', true);
|
1982 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue)[0].dispatchEvent(customEvent);
|
1983 | }
|
1984 | }
|
1985 | else {
|
1986 | if (Array.isArray(inputValue.dataElementValue)) {
|
1987 | for (const element in inputValue.dataElementValue) {
|
1988 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue[element]).prop('checked', false);
|
1989 | customEvent.initEvent('change', true, true);
|
1990 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue[element])[0].dispatchEvent(customEvent);
|
1991 | }
|
1992 | }
|
1993 | else {
|
1994 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue).prop('checked', false);
|
1995 | $('#' + inputValue.dataElementId + '_' + inputValue.dataElementValue)[0].dispatchEvent(customEvent);
|
1996 | }
|
1997 | }
|
1998 | }
|
1999 | }
|
2000 | break;
|
2001 | }
|
2002 | }
|
2003 | }
|
2004 | }
|
2005 | }
|
2006 | }
|
2007 | else {
|
2008 | throw console.error('Invalid values');
|
2009 | }
|
2010 | }
|
2011 | |
2012 |
|
2013 |
|
2014 |
|
2015 | generateReportText(endpointId) {
|
2016 | const endpointContent = this.returnEndPointContents(this.xmlContent, '<EndPoint Id="' + endpointId + '">', '</EndPoint>');
|
2017 | this.parseXml(endpointId, endpointContent);
|
2018 | }
|
2019 | |
2020 |
|
2021 |
|
2022 | generateExecutionHistory() {
|
2023 | this.executedResultHistories = [];
|
2024 | let isNonRelevant;
|
2025 | isNonRelevant = false;
|
2026 | for (const resultId in this.executedResultIds) {
|
2027 | for (const nonRelevantDataElement of this.simulatorState.nonRelevantDataElementIds) {
|
2028 | if (nonRelevantDataElement === resultId) {
|
2029 | isNonRelevant = true;
|
2030 | break;
|
2031 | }
|
2032 | else {
|
2033 | isNonRelevant = false;
|
2034 | }
|
2035 | }
|
2036 | if (!isNonRelevant) {
|
2037 | for (const label in this.executedResultIds[resultId]) {
|
2038 | const executedResultHistory = new ExecutedResultHistory();
|
2039 | executedResultHistory.resultCondition = label;
|
2040 | executedResultHistory.resultValue = this.executedResultIds[resultId][label];
|
2041 | this.executedResultHistories.push(executedResultHistory);
|
2042 | }
|
2043 | }
|
2044 | }
|
2045 | const finalExecution = new FinalExecutedHistory();
|
2046 | if (this.executedResultHistories.length > 0) {
|
2047 | finalExecution.executionHistories = this.executedResultHistories;
|
2048 | finalExecution.resultText = this.mainReportTextObj;
|
2049 | }
|
2050 | this.returnExecutionHistory.emit(finalExecution);
|
2051 | }
|
2052 | |
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 | returnEndPointContents(content, startToken, endToken) {
|
2059 | let contents;
|
2060 | let templateSearchIndexPosition = 0;
|
2061 | while (true) {
|
2062 | const contentStartPosition = content.indexOf(startToken, templateSearchIndexPosition);
|
2063 | const contentEndPosition = content.indexOf(endToken, templateSearchIndexPosition);
|
2064 | if (contentStartPosition >= 0 && contentEndPosition >= 0) {
|
2065 | const endPosition = contentEndPosition + endToken.length;
|
2066 | const contentData = content.substring(contentStartPosition, endPosition);
|
2067 | contents = contentData;
|
2068 | templateSearchIndexPosition = endPosition + 1;
|
2069 | }
|
2070 | else {
|
2071 | break;
|
2072 | }
|
2073 | }
|
2074 | return contents;
|
2075 | }
|
2076 | |
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 | parseXml(endPointId, endpointContent) {
|
2082 | let canInsertText;
|
2083 | let isSectionIf;
|
2084 | let selectedElements;
|
2085 | let executeSectionIfNot;
|
2086 | let hasSectionNot;
|
2087 | let executeTemplate;
|
2088 | let isImpression;
|
2089 | let isNewTemplate;
|
2090 | let hasInsertPartial;
|
2091 | let isMainText;
|
2092 | const allReportText = [];
|
2093 | const endpoints = this.Endpoints;
|
2094 | let templatePartialsText;
|
2095 | let selectedComparisonValues;
|
2096 | let findingsText;
|
2097 | let impressionText;
|
2098 | let selectedSection;
|
2099 | let selectedChoiceTexts;
|
2100 | let textExpressionValue;
|
2101 | selectedElements = this.simulatorEngineService.getAllDataElementValues();
|
2102 | templatePartialsText = this.templatePartial;
|
2103 | selectedComparisonValues = this.comparisonValues;
|
2104 | selectedChoiceTexts = this.simulatorEngineService.getAllDataElementTexts();
|
2105 | executeSectionIfNot = false;
|
2106 | hasInsertPartial = false;
|
2107 | findingsText = '';
|
2108 | impressionText = '';
|
2109 | let isReportText;
|
2110 | let reportTextContent = '';
|
2111 | const endpointSax = require('sax'),
|
2112 | strict = true,
|
2113 | normalize = true,
|
2114 |
|
2115 | trim = true,
|
2116 | reportTextParser = endpointSax.parser(strict, trim);
|
2117 | reportTextParser.onerror = function (e) {
|
2118 |
|
2119 | reportTextParser.resume();
|
2120 | };
|
2121 | reportTextParser.ontext = function (t) {
|
2122 | if (t.length > 1) {
|
2123 | t = t.trim();
|
2124 | }
|
2125 | let isTextInserted;
|
2126 | isTextInserted = false;
|
2127 | if (executeTemplate) {
|
2128 | if (!isImpression) {
|
2129 | if (canInsertText && hasSectionNot && hasSectionNot !== undefined && executeSectionIfNot) {
|
2130 | findingsText = findingsText + t;
|
2131 | }
|
2132 | else if (canInsertText && isNewTemplate && hasInsertPartial && !isSectionIf) {
|
2133 | findingsText = findingsText + t;
|
2134 | }
|
2135 | else if (canInsertText && !isImpression) {
|
2136 | findingsText = findingsText + t;
|
2137 | }
|
2138 | }
|
2139 | else {
|
2140 | if (canInsertText && hasSectionNot && hasSectionNot !== undefined && executeSectionIfNot) {
|
2141 | impressionText = impressionText + t;
|
2142 | }
|
2143 | else if (canInsertText && !hasSectionNot && isImpression) {
|
2144 | impressionText = impressionText + t;
|
2145 | }
|
2146 | else if (canInsertText && isNewTemplate) {
|
2147 | impressionText = impressionText + t;
|
2148 | }
|
2149 | }
|
2150 | if (isReportText && !isTextInserted && isMainText && canInsertText) {
|
2151 | reportTextContent = reportTextContent + t;
|
2152 | }
|
2153 | }
|
2154 | };
|
2155 | reportTextParser.onopentag = function (node) {
|
2156 | switch (node.name) {
|
2157 | case 'Label':
|
2158 | canInsertText = false;
|
2159 | isReportText = false;
|
2160 | isMainText = false;
|
2161 | break;
|
2162 | case 'ReportText':
|
2163 | if (executeTemplate) {
|
2164 | isReportText = true;
|
2165 | canInsertText = true;
|
2166 | selectedSection = node.attributes.SectionId;
|
2167 | impressionText = '';
|
2168 | if (node.attributes.SectionId === 'findings' && executeTemplate) {
|
2169 | isImpression = false;
|
2170 | }
|
2171 | else if (node.attributes.SectionId === 'impression' && executeTemplate) {
|
2172 | isImpression = true;
|
2173 | }
|
2174 | }
|
2175 | isSectionIf = false;
|
2176 |
|
2177 | break;
|
2178 | case 'InsertPartial':
|
2179 | if (executeTemplate) {
|
2180 | generatePartialView(node.attributes.PartialId, isImpression);
|
2181 | executeTemplate = true;
|
2182 | canInsertText = true;
|
2183 | if (isReportText) {
|
2184 | hasInsertPartial = true;
|
2185 | }
|
2186 | else {
|
2187 | hasInsertPartial = false;
|
2188 | }
|
2189 | }
|
2190 | else {
|
2191 | canInsertText = false;
|
2192 | }
|
2193 | isReportText = false;
|
2194 | isMainText = false;
|
2195 | break;
|
2196 | case 'SectionIfValueNot':
|
2197 | if (executeTemplate) {
|
2198 | if (Array.isArray(selectedElements[node.attributes.DataElementId])) {
|
2199 | for (const comaprisonValue of selectedElements[node.attributes.DataElementId]) {
|
2200 | if (comaprisonValue !== node.attributes.ComparisonValue &&
|
2201 | comaprisonValue !== undefined && !isSectionIf) {
|
2202 | canInsertText = true;
|
2203 | executeSectionIfNot = true;
|
2204 | break;
|
2205 | }
|
2206 | else {
|
2207 | canInsertText = false;
|
2208 | executeSectionIfNot = false;
|
2209 | }
|
2210 | }
|
2211 | }
|
2212 | else if (selectedElements[node.attributes.DataElementId] !== node.attributes.ComparisonValue &&
|
2213 | selectedElements[node.attributes.DataElementId] !== '--Select--' &&
|
2214 | selectedElements[node.attributes.DataElementId] !== undefined &&
|
2215 | selectedElements[node.attributes.DataElementId] !== null) {
|
2216 | canInsertText = true;
|
2217 | executeSectionIfNot = true;
|
2218 | }
|
2219 | else {
|
2220 | canInsertText = false;
|
2221 | executeSectionIfNot = false;
|
2222 | }
|
2223 | }
|
2224 | hasSectionNot = true;
|
2225 | isMainText = false;
|
2226 | break;
|
2227 | case 'SectionIf':
|
2228 | if (selectedElements[node.attributes.DataElementId] !== undefined && selectedElements[node.attributes.DataElementId].length > 0 && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2229 | isSectionIf = true;
|
2230 | canInsertText = true;
|
2231 | }
|
2232 | else {
|
2233 | isSectionIf = false;
|
2234 | canInsertText = false;
|
2235 | }
|
2236 | break;
|
2237 | case 'SectionIfValue':
|
2238 | if (executeTemplate) {
|
2239 | if (executeTemplate) {
|
2240 | if (Array.isArray(selectedElements[node.attributes.DataElementId])) {
|
2241 | for (const comaprisonValue of selectedElements[node.attributes.DataElementId]) {
|
2242 | if (comaprisonValue === node.attributes.ComparisonValue &&
|
2243 | comaprisonValue !== undefined) {
|
2244 | isSectionIf = true;
|
2245 | if (selectedElements[node.attributes.DataElementId] !== undefined && !isSectionIf && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2246 | findingsText = findingsText + selectedChoiceTexts[node.attributes.DataElementId];
|
2247 | }
|
2248 | canInsertText = true;
|
2249 | break;
|
2250 | }
|
2251 | else {
|
2252 | isSectionIf = false;
|
2253 | canInsertText = false;
|
2254 | }
|
2255 | }
|
2256 | }
|
2257 | else if (selectedElements[node.attributes.DataElementId] === node.attributes.ComparisonValue &&
|
2258 | selectedElements[node.attributes.DataElementId] !== undefined) {
|
2259 | isSectionIf = true;
|
2260 | if (selectedElements[node.attributes.DataElementId] !== undefined && !isSectionIf && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2261 | findingsText = findingsText + selectedChoiceTexts[node.attributes.DataElementId];
|
2262 | }
|
2263 | canInsertText = true;
|
2264 | }
|
2265 | else {
|
2266 | canInsertText = false;
|
2267 | }
|
2268 | }
|
2269 | break;
|
2270 | }
|
2271 | isMainText = false;
|
2272 | break;
|
2273 | case 'InsertValue':
|
2274 | if (executeTemplate) {
|
2275 | isReportText = false;
|
2276 | const choiceText = selectedChoiceTexts[node.attributes.DataElementId];
|
2277 | if (node.attributes.Id === 'findings' || canInsertText) {
|
2278 | if (selectedElements[node.attributes.DataElementId] !== undefined && hasSectionNot && executeSectionIfNot) {
|
2279 | if (isImpression) {
|
2280 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2281 | impressionText = impressionText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2282 | }
|
2283 | else {
|
2284 | getTextExpressionValue(selectedElements[node.attributes.DataElementId]);
|
2285 | impressionText = impressionText + (Array.isArray(selectedElements[node.attributes.DataElementId]) ? selectedElements[node.attributes.DataElementId].join(', ') : textExpressionValue);
|
2286 | }
|
2287 | }
|
2288 | else {
|
2289 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2290 | findingsText = findingsText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2291 | }
|
2292 | else {
|
2293 | getTextExpressionValue(selectedElements[node.attributes.DataElementId]);
|
2294 | findingsText = findingsText + (Array.isArray(selectedElements[node.attributes.DataElementId]) ? selectedElements[node.attributes.DataElementId].join(', ') : textExpressionValue);
|
2295 | }
|
2296 | }
|
2297 | }
|
2298 | else if (selectedElements[node.attributes.DataElementId] !== undefined && !hasSectionNot) {
|
2299 | if (isImpression) {
|
2300 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2301 | impressionText = impressionText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2302 | }
|
2303 | else {
|
2304 | getTextExpressionValue(selectedElements[node.attributes.DataElementId]);
|
2305 | impressionText = impressionText + (Array.isArray(selectedElements[node.attributes.DataElementId]) ? selectedElements[node.attributes.DataElementId].join(', ') : textExpressionValue);
|
2306 | }
|
2307 | }
|
2308 | else {
|
2309 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2310 | findingsText = findingsText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2311 | }
|
2312 | else {
|
2313 | getTextExpressionValue(selectedElements[node.attributes.DataElementId]);
|
2314 | findingsText = findingsText + (Array.isArray(selectedElements[node.attributes.DataElementId]) ? selectedElements[node.attributes.DataElementId].join(', ') : textExpressionValue);
|
2315 | }
|
2316 | }
|
2317 | }
|
2318 | if (isImpression) {
|
2319 | canInsertText = true;
|
2320 | }
|
2321 | }
|
2322 | isMainText = false;
|
2323 | break;
|
2324 | }
|
2325 | }
|
2326 | executeTemplate = true;
|
2327 | isNewTemplate = true;
|
2328 | };
|
2329 | reportTextParser.onclosetag = function (node) {
|
2330 | switch (node) {
|
2331 | case 'SectionIfValueNot':
|
2332 | executeSectionIfNot = false;
|
2333 | hasSectionNot = false;
|
2334 | if (isSectionIf) {
|
2335 | canInsertText = true;
|
2336 | }
|
2337 | break;
|
2338 | case 'TemplatePartial':
|
2339 | isNewTemplate = false;
|
2340 | canInsertText = false;
|
2341 | executeTemplate = false;
|
2342 | break;
|
2343 | case 'ReportText':
|
2344 |
|
2345 | if (!hasInsertPartial && !isImpression) {
|
2346 | const reportTextObj = new AllReportText();
|
2347 | reportTextObj.sectionId = 'findings';
|
2348 | reportTextObj.reportText = findingsText;
|
2349 | allReportText[reportTextObj.sectionId] = reportTextObj;
|
2350 | }
|
2351 | if (impressionText !== '' && impressionText !== undefined) {
|
2352 | const reportTextObj = new AllReportText();
|
2353 | reportTextObj.sectionId = selectedSection;
|
2354 | reportTextObj.reportText = impressionText;
|
2355 | allReportText[reportTextObj.sectionId] = reportTextObj;
|
2356 | }
|
2357 | hasInsertPartial = false;
|
2358 | break;
|
2359 | case 'SectionIf':
|
2360 | isSectionIf = false;
|
2361 | canInsertText = true;
|
2362 | break;
|
2363 | case 'InsertPartial':
|
2364 | canInsertText = true;
|
2365 | break;
|
2366 | case 'InsertValue':
|
2367 | if ((hasSectionNot && executeSectionIfNot || !hasSectionNot)) {
|
2368 | canInsertText = true;
|
2369 | }
|
2370 | break;
|
2371 | case 'SectionIfValue':
|
2372 | canInsertText = true;
|
2373 | break;
|
2374 | }
|
2375 | };
|
2376 | reportTextParser.onend = function () {
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 |
|
2384 | };
|
2385 | reportTextParser.write(endpointContent).onend();
|
2386 | |
2387 |
|
2388 |
|
2389 |
|
2390 | function getTextExpressionValue(textExpression) {
|
2391 | if (textExpression.indexOf('{') === 0 && (textExpression.indexOf('}') > 1)) {
|
2392 | const subString = textExpression.substr(textExpression.indexOf('{') + 1, textExpression.indexOf('}') - 1);
|
2393 | getTextExpressionValue(selectedElements[subString]);
|
2394 | }
|
2395 | else {
|
2396 | textExpressionValue = textExpression;
|
2397 | }
|
2398 | }
|
2399 | |
2400 |
|
2401 |
|
2402 |
|
2403 |
|
2404 | function generatePartialView(partialViewId, isImpressionTemplate) {
|
2405 |
|
2406 | const sax = require('sax'),
|
2407 | parser = sax.parser(strict, trim);
|
2408 | parser.onerror = function (e) {
|
2409 |
|
2410 |
|
2411 | };
|
2412 | parser.ontext = function (t) {
|
2413 | if (executeTemplate) {
|
2414 | if (!isImpressionTemplate) {
|
2415 | if (canInsertText && hasSectionNot && hasSectionNot !== undefined && executeSectionIfNot) {
|
2416 | findingsText = findingsText + t;
|
2417 | }
|
2418 | else if (canInsertText && !hasSectionNot && isImpression) {
|
2419 | findingsText = findingsText + t;
|
2420 | }
|
2421 | else if (canInsertText && isNewTemplate) {
|
2422 | findingsText = findingsText + t;
|
2423 | }
|
2424 | }
|
2425 | else {
|
2426 | if (canInsertText && hasSectionNot && hasSectionNot !== undefined && executeSectionIfNot) {
|
2427 | impressionText = impressionText + t;
|
2428 | }
|
2429 | else if (canInsertText && !hasSectionNot && isImpression) {
|
2430 | impressionText = impressionText + t;
|
2431 | }
|
2432 | else if (canInsertText && isNewTemplate) {
|
2433 | impressionText = impressionText + t;
|
2434 | }
|
2435 | }
|
2436 | }
|
2437 | };
|
2438 | parser.onopentag = function (node) {
|
2439 | switch (node.name) {
|
2440 | case 'Label':
|
2441 | canInsertText = false;
|
2442 | break;
|
2443 | case 'EndPoint':
|
2444 | if (node.attributes.Id !== '') {
|
2445 | canInsertText = true;
|
2446 | isImpression = true;
|
2447 | }
|
2448 | else {
|
2449 | canInsertText = false;
|
2450 | isImpression = false;
|
2451 | }
|
2452 | break;
|
2453 | case 'InsertPartial':
|
2454 | canInsertText = false;
|
2455 | break;
|
2456 | case 'ReportText':
|
2457 | canInsertText = true;
|
2458 | break;
|
2459 | case 'TemplatePartial':
|
2460 | hasSectionNot = false;
|
2461 | executeSectionIfNot = false;
|
2462 | if (node.attributes.Id === partialViewId) {
|
2463 | executeTemplate = true;
|
2464 | canInsertText = true;
|
2465 | isNewTemplate = true;
|
2466 | break;
|
2467 | }
|
2468 | else {
|
2469 | isNewTemplate = false;
|
2470 | executeTemplate = false;
|
2471 | }
|
2472 | break;
|
2473 | case 'SectionIfValueNot':
|
2474 | if (executeTemplate) {
|
2475 | if (Array.isArray(selectedElements[node.attributes.DataElementId])) {
|
2476 | for (const comaprisonValue of selectedComparisonValues[node.attributes.DataElementId + 'ComparisonValue']) {
|
2477 | if (comaprisonValue !== node.attributes.ComparisonValue &&
|
2478 | comaprisonValue !== undefined && !isSectionIf) {
|
2479 | canInsertText = true;
|
2480 | executeSectionIfNot = true;
|
2481 | break;
|
2482 | }
|
2483 | else {
|
2484 | canInsertText = false;
|
2485 | executeSectionIfNot = false;
|
2486 | }
|
2487 | }
|
2488 | }
|
2489 | else if (selectedElements[node.attributes.DataElementId] !== node.attributes.ComparisonValue &&
|
2490 | selectedElements[node.attributes.DataElementId] !== '--Select--' &&
|
2491 | selectedElements[node.attributes.DataElementId] !== undefined &&
|
2492 | selectedElements[node.attributes.DataElementId] !== null) {
|
2493 | canInsertText = true;
|
2494 | executeSectionIfNot = true;
|
2495 | }
|
2496 | else {
|
2497 | canInsertText = false;
|
2498 | executeSectionIfNot = false;
|
2499 | }
|
2500 | }
|
2501 | hasSectionNot = true;
|
2502 | break;
|
2503 | case 'SectionIf':
|
2504 | if (selectedElements[node.attributes.DataElementId] !== undefined && selectedElements[node.attributes.DataElementId].length > 0 && (!hasSectionNot || (hasSectionNot && executeSectionIfNot))
|
2505 | && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2506 | isSectionIf = true;
|
2507 | canInsertText = true;
|
2508 | }
|
2509 | else {
|
2510 | isSectionIf = false;
|
2511 | canInsertText = false;
|
2512 | }
|
2513 | break;
|
2514 | case 'SectionIfValue':
|
2515 | if (executeTemplate) {
|
2516 | if (Array.isArray(selectedElements[node.attributes.DataElementId])) {
|
2517 | for (const comaprisonValue of selectedComparisonValues[node.attributes.DataElementId + 'ComparisonValue']) {
|
2518 | if (comaprisonValue === node.attributes.ComparisonValue &&
|
2519 | comaprisonValue !== undefined) {
|
2520 | isSectionIf = true;
|
2521 | if (selectedElements[node.attributes.DataElementId] !== undefined && !isSectionIf && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2522 | findingsText = findingsText + selectedChoiceTexts[node.attributes.DataElementId];
|
2523 | }
|
2524 | canInsertText = true;
|
2525 | break;
|
2526 | }
|
2527 | else {
|
2528 | isSectionIf = false;
|
2529 | canInsertText = false;
|
2530 | }
|
2531 | }
|
2532 | }
|
2533 | else if (selectedElements[node.attributes.DataElementId] === node.attributes.ComparisonValue &&
|
2534 | selectedElements[node.attributes.DataElementId] !== undefined) {
|
2535 | isSectionIf = true;
|
2536 | if (selectedElements[node.attributes.DataElementId] !== undefined && !isSectionIf && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2537 | findingsText = findingsText + selectedChoiceTexts[node.attributes.DataElementId];
|
2538 | }
|
2539 | canInsertText = true;
|
2540 | }
|
2541 | else {
|
2542 | canInsertText = false;
|
2543 | }
|
2544 | }
|
2545 | break;
|
2546 | case 'InsertValue':
|
2547 | if (executeTemplate) {
|
2548 | const choiceText = selectedChoiceTexts[node.attributes.DataElementId];
|
2549 | if (node.attributes.Id === 'findings' || canInsertText) {
|
2550 | if (isImpression) {
|
2551 | canInsertText = true;
|
2552 | if (selectedElements[node.attributes.DataElementId] !== undefined && hasSectionNot && executeSectionIfNot && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2553 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined) {
|
2554 | impressionText = impressionText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2555 | }
|
2556 | else {
|
2557 | impressionText = impressionText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2558 | }
|
2559 | }
|
2560 | else if (selectedElements[node.attributes.DataElementId] !== undefined && !hasSectionNot && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2561 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined) {
|
2562 | impressionText = impressionText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2563 | }
|
2564 | else {
|
2565 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2566 | impressionText = impressionText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2567 | }
|
2568 | }
|
2569 | }
|
2570 | }
|
2571 | else {
|
2572 | if (selectedElements[node.attributes.DataElementId] !== undefined && hasSectionNot && executeSectionIfNot && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2573 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined) {
|
2574 | findingsText = findingsText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2575 | }
|
2576 | }
|
2577 | else if (selectedElements[node.attributes.DataElementId] !== undefined && !hasSectionNot && selectedChoiceTexts[node.attributes.DataElementId] !== 'Other, please specify…') {
|
2578 | if (selectedChoiceTexts[node.attributes.DataElementId] !== undefined) {
|
2579 | findingsText = findingsText + (Array.isArray(choiceText) ? choiceText.join(', ') : choiceText);
|
2580 | }
|
2581 | }
|
2582 | }
|
2583 | }
|
2584 | break;
|
2585 | }
|
2586 | }
|
2587 | };
|
2588 | parser.onclosetag = function (node) {
|
2589 | switch (node) {
|
2590 | case 'SectionIfValueNot':
|
2591 | executeSectionIfNot = false;
|
2592 | hasSectionNot = false;
|
2593 | if (isSectionIf) {
|
2594 | canInsertText = true;
|
2595 | }
|
2596 | break;
|
2597 | case 'TemplatePartial':
|
2598 | isNewTemplate = true;
|
2599 | canInsertText = false;
|
2600 | executeTemplate = true;
|
2601 | break;
|
2602 | case 'InsertPartial':
|
2603 | canInsertText = true;
|
2604 | break;
|
2605 | case 'SectionIf' || 'SectionIfValue':
|
2606 | isSectionIf = false;
|
2607 | break;
|
2608 | }
|
2609 | };
|
2610 | parser.onend = function () {
|
2611 |
|
2612 | const reportTextObj = new AllReportText();
|
2613 | reportTextObj.sectionId = 'findings';
|
2614 | reportTextObj.reportText = findingsText;
|
2615 | allReportText[reportTextObj.sectionId] = reportTextObj;
|
2616 | };
|
2617 | parser.write(templatePartialsText).onend();
|
2618 | }
|
2619 | this.mainReportTextObj = new MainReportText();
|
2620 | this.mainReportTextObj.reportTextMainContent = reportTextContent;
|
2621 | this.mainReportTextObj.allReportText = allReportText;
|
2622 | this.returnReportText.emit(this.mainReportTextObj);
|
2623 | }
|
2624 | }
|
2625 | AssistDataElementComponent.decorators = [
|
2626 | { type: Component, args: [{
|
2627 | selector: 'acr-assist-data-element',
|
2628 | template: `<ng-container *ngFor="let DataElement of dataElements">
|
2629 | <ng-container *ngIf="(DataElement.dataElementType == 'ChoiceDataElement' || DataElement.dataElementType == 'NumericDataElement' || DataElement.dataElementType == 'IntegerDataElement' || DataElement.dataElementType == 'MultiChoiceDataElement') ">
|
2630 | <ng-container *ngIf="DataElement.isVisible">
|
2631 | <div id="div_{{DataElement.id}}" class="row bottom-margin">
|
2632 | <ng-container *ngIf="DataElement.dataElementType == 'ChoiceDataElement'">
|
2633 | <acr-assist-choice-element [choiceDataElement]='DataElement' [imagePath]='imagePath' (returnChoiceElement)='choiceSelected($event)'></acr-assist-choice-element>
|
2634 | </ng-container>
|
2635 | <ng-container *ngIf="DataElement.dataElementType == 'MultiChoiceDataElement'">
|
2636 | <acr-assist-multi-choice-element [multiChoiceElement]='DataElement' [imagePath]='imagePath' (returnMultiChoice)='multiSelected($event)'></acr-assist-multi-choice-element>
|
2637 | </ng-container>
|
2638 | <ng-container *ngIf="DataElement.dataElementType == 'NumericDataElement' || DataElement.dataElementType == 'IntegerDataElement'">
|
2639 | <acr-assist-numeric-element [numericDataElement]='DataElement' [imagePath]='imagePath' (returnNumericElement)='numericSelected($event)'></acr-assist-numeric-element>
|
2640 | </ng-container>
|
2641 | </div>
|
2642 | </ng-container>
|
2643 | </ng-container>
|
2644 | </ng-container>
|
2645 | `,
|
2646 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
2647 | },] },
|
2648 | ];
|
2649 |
|
2650 | AssistDataElementComponent.ctorParameters = () => [
|
2651 | { type: SimulatorEngineService, },
|
2652 | ];
|
2653 | AssistDataElementComponent.propDecorators = {
|
2654 | "dataElements": [{ type: Input },],
|
2655 | "imagePath": [{ type: Input },],
|
2656 | "Endpoints": [{ type: Input },],
|
2657 | "templatePartial": [{ type: Input },],
|
2658 | "endPointXMLString": [{ type: Input },],
|
2659 | "xmlContent": [{ type: Input },],
|
2660 | "returnReportText": [{ type: Output },],
|
2661 | "returnExecutionHistory": [{ type: Output },],
|
2662 | "isReset": [{ type: Input },],
|
2663 | "inputValues": [{ type: Input },],
|
2664 | };
|
2665 | class ChoiceElement {
|
2666 | }
|
2667 | class NumericElement {
|
2668 | }
|
2669 | class MultiChoiceElement {
|
2670 | }
|
2671 |
|
2672 | class MainReportText {
|
2673 | }
|
2674 | class AllReportText {
|
2675 | }
|
2676 | class ExecutedResultHistory {
|
2677 | }
|
2678 | class FinalExecutedHistory {
|
2679 | }
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 | class HintDiagramComponent {
|
2691 | constructor() {
|
2692 | this.activeSlideIndex = 0;
|
2693 | }
|
2694 | |
2695 |
|
2696 |
|
2697 | resetCarouselIndex() {
|
2698 | this.activeSlideIndex = 0;
|
2699 | }
|
2700 | }
|
2701 | HintDiagramComponent.decorators = [
|
2702 | { type: Component, args: [{
|
2703 | selector: 'acr-hint-diagram',
|
2704 | template: `<ng-container *ngIf="DataElement !== undefined">
|
2705 | <button type="button" class="btn btn-default btn-xs" data-toggle="modal" attr.data-target="#{{'diag_'+DataElement.id}}" (click)="resetCarouselIndex()">
|
2706 | <span class=" glyphicon glyphicon-cd" aria-hidden="true" data-toggle="tooltip" data-placement="right" title="Hint Diagrams"></span>
|
2707 | </button>
|
2708 | <div class="modal inmodal fade" id="{{'diag_'+DataElement.id}}" tabindex="-1" role="dialog" aria-hidden="true">
|
2709 | <div class="modal-dialog modal-lg">
|
2710 | <div class="modal-content">
|
2711 | <div class="modal-header">
|
2712 | <button type="button" class="close" data-dismiss="modal">
|
2713 | <span aria-hidden="true">×</span>
|
2714 | <span class="sr-only">Close</span>
|
2715 | </button>
|
2716 | <h4 class="modal-title">{{DataElement.label}}</h4>
|
2717 | </div>
|
2718 | <div class="modal-body">
|
2719 | <ng-container>
|
2720 | <carousel [(activeSlide)]="activeSlideIndex" interval="false">
|
2721 | <ng-container *ngFor="let diag of DataElement.diagrams ">
|
2722 | <slide>
|
2723 | <img src="{{imagePath}}/{{diag.location}}" alt="Image Not Available!!!">
|
2724 | </slide>
|
2725 | </ng-container>
|
2726 | </carousel>
|
2727 | </ng-container>
|
2728 | </div>
|
2729 | <div class="modal-footer">
|
2730 | <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
|
2731 | </div>
|
2732 | </div>
|
2733 | </div>
|
2734 | </div>
|
2735 | </ng-container>
|
2736 | `,
|
2737 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
2738 | },] },
|
2739 | ];
|
2740 |
|
2741 | HintDiagramComponent.propDecorators = {
|
2742 | "DataElement": [{ type: Input },],
|
2743 | "imagePath": [{ type: Input },],
|
2744 | };
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 | class GlobalValue extends BaseDataElement {
|
2751 | }
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 | class GlobalValueCreationService extends DataElementCreationBaseService {
|
2758 | |
2759 |
|
2760 |
|
2761 | constructor(diagramService) {
|
2762 | super(diagramService);
|
2763 | this.elementType = 'GlobalValue';
|
2764 | }
|
2765 | |
2766 |
|
2767 |
|
2768 |
|
2769 | createElement(data) {
|
2770 | const dataElement = new GlobalValue();
|
2771 | dataElement.id = data.Attr.Id;
|
2772 | dataElement.currentValue = data._;
|
2773 | dataElement.dataElementType = 'GlobalValue';
|
2774 | return dataElement;
|
2775 | }
|
2776 | }
|
2777 | GlobalValueCreationService.decorators = [
|
2778 | { type: Injectable },
|
2779 | ];
|
2780 |
|
2781 | GlobalValueCreationService.ctorParameters = () => [
|
2782 | { type: DiagramService, },
|
2783 | ];
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 | class SelectedCondition {
|
2790 | }
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 | const $$1 = require('jquery');
|
2797 | class AssistNumericElementComponent {
|
2798 | |
2799 |
|
2800 |
|
2801 |
|
2802 | constructor(formBuilder, simulatorEngineService) {
|
2803 | this.formBuilder = formBuilder;
|
2804 | this.simulatorEngineService = simulatorEngineService;
|
2805 | this.returnNumericElement = new EventEmitter();
|
2806 | }
|
2807 | |
2808 |
|
2809 |
|
2810 | ngOnInit() {
|
2811 | this.createNumericElementForm();
|
2812 | }
|
2813 | |
2814 |
|
2815 |
|
2816 | ngAfterViewInit() {
|
2817 | if (this.numericDataElement.currentValue !== undefined && this.numericDataElement.currentValue !== 0) {
|
2818 | this.simulatorEngineService.addOrUpdateDataElement(this.numericDataElement.id, this.numericDataElement.currentValue, this.numericDataElement.currentValue);
|
2819 | const customEvent = document.createEvent('Event');
|
2820 |
|
2821 |
|
2822 | this.numberValue = this.numericDataElement.currentValue;
|
2823 | this.simulatorEngineService.addOrUpdateDataElement(this.numericDataElement.id, this.numericDataElement.currentValue, this.numericDataElement.currentValue);
|
2824 | this.loadedNumericValue(this.numericDataElement.id, this.numericDataElement.currentValue, this.numericDataElement.label);
|
2825 | }
|
2826 | }
|
2827 | |
2828 |
|
2829 |
|
2830 |
|
2831 |
|
2832 |
|
2833 | loadedNumericValue(id, value, selectedCondition) {
|
2834 | const choiceElement = new NumericElement();
|
2835 | choiceElement.elementId = id;
|
2836 | choiceElement.selectedValue = value;
|
2837 | this.selectedCondition = new SelectedCondition();
|
2838 | this.selectedCondition.selectedConditionId = id;
|
2839 | this.selectedCondition.selectedCondition = selectedCondition;
|
2840 | this.selectedCondition.selectedValue = value;
|
2841 | this.returnNumericElement.emit({ receivedElement: choiceElement, selectedCondition: this.selectedCondition });
|
2842 | }
|
2843 | |
2844 |
|
2845 |
|
2846 |
|
2847 |
|
2848 | choiceSelected(element, selectedCondition) {
|
2849 | const choiceElement = new NumericElement();
|
2850 | choiceElement.elementId = element.id;
|
2851 | choiceElement.selectedValue = element.value;
|
2852 | this.selectedCondition = new SelectedCondition();
|
2853 | this.selectedCondition.selectedConditionId = element.id;
|
2854 | this.selectedCondition.selectedCondition = selectedCondition;
|
2855 | this.selectedCondition.selectedValue = element.value;
|
2856 | this.returnNumericElement.emit({ receivedElement: choiceElement, selectedCondition: this.selectedCondition });
|
2857 | }
|
2858 | |
2859 |
|
2860 |
|
2861 | createNumericElementForm() {
|
2862 | this.numericElementForm = this.formBuilder.group({
|
2863 | numericElement: ['', Validators.compose([Validators.required, Validators.min(+this.numericDataElement.minimum)])],
|
2864 | });
|
2865 | }
|
2866 | |
2867 |
|
2868 |
|
2869 |
|
2870 | specificValueInsideRange(numericKey) {
|
2871 | return (group) => {
|
2872 | const numericControl = group.controls[numericKey];
|
2873 | if ((numericControl.value === 'undefined' || numericControl.value === '') && this.numericDataElement.isRequired) {
|
2874 | return numericControl.setErrors({ notEquivalent: true });
|
2875 | }
|
2876 | else {
|
2877 | return numericControl.setErrors(null);
|
2878 | }
|
2879 | };
|
2880 | }
|
2881 | |
2882 |
|
2883 |
|
2884 |
|
2885 | onlyNumberKey(event) {
|
2886 | return (event.charCode === 8 || event.charCode === 0) ? null : event.charCode >= 48 && event.charCode <= 57;
|
2887 | }
|
2888 | }
|
2889 | AssistNumericElementComponent.decorators = [
|
2890 | { type: Component, args: [{
|
2891 | selector: 'acr-assist-numeric-element',
|
2892 | template: `<form [formGroup]="numericElementForm" novalidate>
|
2893 | <div class="form-group">
|
2894 | <div class="col-sm-5 text-right">
|
2895 | <label class="control-label DEElement">
|
2896 | {{numericDataElement.label}}
|
2897 | </label>
|
2898 | <ng-container *ngIf="numericDataElement.hint !== '' && numericDataElement.hint !== undefined">
|
2899 | <i>
|
2900 | <span class="fa fa-info-circle text-primary" data-toggle="tooltip" data-placement="right" title="{{numericDataElement.hint}}"></span>
|
2901 | </i>
|
2902 | </ng-container>
|
2903 | <ng-container *ngIf="numericDataElement.diagrams != undefined ">
|
2904 | <acr-hint-diagram [DataElement]="numericDataElement" [imagePath]="imagePath"></acr-hint-diagram>
|
2905 | </ng-container>
|
2906 | <ng-container *ngIf="this.numericDataElement.isRequired">
|
2907 | <span *ngIf="numericElementForm.controls['numericElement'].invalid" class="numeric-align">
|
2908 | <span *ngIf="numericElementForm.controls['numericElement'].errors.required" class="required-field" title="Required Field">
|
2909 | *
|
2910 | </span>
|
2911 | </span>
|
2912 | </ng-container>
|
2913 | <span *ngIf="numericElementForm.controls['numericElement'].invalid && numericElementForm.controls['numericElement'].errors.min"
|
2914 | class="required-field numeric-validator" title=" Minimum value is {{numericDataElement.minimum}}">
|
2915 | *
|
2916 | </span>
|
2917 | </div>
|
2918 | <ng-container *ngIf="numericDataElement.dataElementType === 'NumericDataElement'">
|
2919 | <div class="col-sm-7">
|
2920 | <input [(ngModel)]="numberValue" id="{{numericDataElement.id}}" type="number" class="form-control" formControlName="numericElement"
|
2921 | (keypress)="onlyNumberKey($event)" onpaste="return false;" (input)="choiceSelected($event.target, numericDataElement.label)"
|
2922 | min="{{numericDataElement.minimum}}" required>
|
2923 | </div>
|
2924 | </ng-container>
|
2925 | <ng-container *ngIf="numericDataElement.dataElementType === 'IntegerDataElement'">
|
2926 | <div class="col-sm-7">
|
2927 | <input [(ngModel)]="numberValue" id="{{numericDataElement.id}}" type="number" class="form-control" formControlName="numericElement"
|
2928 | (keypress)="onlyNumberKey($event)" onpaste="return false;" (input)="choiceSelected($event.target, numericDataElement.label)"
|
2929 | min="{{numericDataElement.minimum}}" required>
|
2930 | </div>
|
2931 | </ng-container>
|
2932 | </div>
|
2933 | </form>
|
2934 | `,
|
2935 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
2936 | },] },
|
2937 | ];
|
2938 |
|
2939 | AssistNumericElementComponent.ctorParameters = () => [
|
2940 | { type: FormBuilder, },
|
2941 | { type: SimulatorEngineService, },
|
2942 | ];
|
2943 | AssistNumericElementComponent.propDecorators = {
|
2944 | "numericDataElement": [{ type: Input },],
|
2945 | "imagePath": [{ type: Input },],
|
2946 | "returnNumericElement": [{ type: Output },],
|
2947 | };
|
2948 |
|
2949 |
|
2950 |
|
2951 |
|
2952 |
|
2953 | const $$2 = require('jquery');
|
2954 | class AssistChoiceElementComponent {
|
2955 | |
2956 |
|
2957 |
|
2958 |
|
2959 | constructor(formBuilder, simulatorEngineService) {
|
2960 | this.formBuilder = formBuilder;
|
2961 | this.simulatorEngineService = simulatorEngineService;
|
2962 | this.returnChoiceElement = new EventEmitter();
|
2963 | this.choiceChange = new EventEmitter();
|
2964 | }
|
2965 | |
2966 |
|
2967 |
|
2968 | ngOnInit() {
|
2969 | this.createChoiceElementForm();
|
2970 | }
|
2971 | |
2972 |
|
2973 |
|
2974 | ngAfterViewInit() {
|
2975 | $$2('#div_' + this.choiceDataElement.id + '_other').hide();
|
2976 | if (this.choiceDataElement.currentValue !== undefined) {
|
2977 | $$2('#' + this.choiceDataElement.currentValue + '_' + this.choiceDataElement.id).prop('checked', true);
|
2978 | this.choiceValue = this.choiceDataElement.currentValue;
|
2979 | for (const choice in this.choiceDataElement.choiceInfo) {
|
2980 | if (this.choiceDataElement.choiceInfo[choice].value === this.choiceDataElement.currentValue) {
|
2981 | this.simulatorEngineService.addOrUpdateDataElement(this.choiceDataElement.id, this.choiceDataElement.currentValue, this.choiceDataElement.choiceInfo[choice].label);
|
2982 | }
|
2983 | }
|
2984 | const customEvent = document.createEvent('Event');
|
2985 | customEvent.initEvent('change', true, true);
|
2986 | if (this.choiceDataElement.choiceInfo.length <= 5) {
|
2987 | $$2('#' + this.choiceDataElement.currentValue + '_' + this.choiceDataElement.id)[0].dispatchEvent(customEvent);
|
2988 | }
|
2989 | else {
|
2990 | $$2('#' + this.choiceDataElement.id).val(this.choiceDataElement.currentValue);
|
2991 | $$2('#' + this.choiceDataElement.id)[0].dispatchEvent(customEvent);
|
2992 | }
|
2993 | }
|
2994 | }
|
2995 | |
2996 |
|
2997 |
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 | choiceSelected(elementId, selectedElement, selectedText, selectedValue) {
|
3003 | const choiceElement = new ChoiceElement();
|
3004 | choiceElement.elementId = elementId;
|
3005 | choiceElement.selectedValue = selectedValue;
|
3006 | choiceElement.selectedText = selectedText;
|
3007 | this.showOrHideFreeText(elementId, choiceElement.selectedValue);
|
3008 | this.selectedCondition = new SelectedCondition();
|
3009 | this.selectedCondition.selectedConditionId = elementId;
|
3010 | this.selectedCondition.selectedCondition = selectedElement;
|
3011 | this.selectedCondition.selectedValue = selectedText;
|
3012 | this.returnChoiceElement.emit({ receivedElement: choiceElement, selectedCondition: this.selectedCondition });
|
3013 | }
|
3014 | |
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 | dropdownChoiceSelected(element, selectedCondition) {
|
3020 | const choiceElement = new ChoiceElement();
|
3021 | choiceElement.elementId = element.id;
|
3022 | choiceElement.selectedValue = (element.selectedOptions[0].label === 'Other, please specify…') ? 'other' : element.value;
|
3023 | choiceElement.selectedText = element.selectedOptions[0].label;
|
3024 | this.showOrHideFreeText(element.id, choiceElement.selectedValue);
|
3025 | if (this.choiceValue === 'undefined' || this.choiceValue === undefined || this.choiceValue === '') {
|
3026 | choiceElement.selectedText = '';
|
3027 | choiceElement.selectedValue = '';
|
3028 | }
|
3029 | this.selectedCondition = new SelectedCondition();
|
3030 | this.selectedCondition.selectedConditionId = element.id;
|
3031 | this.selectedCondition.selectedCondition = selectedCondition;
|
3032 | this.selectedCondition.selectedValue = element.selectedOptions[0].label;
|
3033 | this.returnChoiceElement.emit({ receivedElement: choiceElement, selectedCondition: this.selectedCondition });
|
3034 | }
|
3035 | |
3036 |
|
3037 |
|
3038 | createChoiceElementForm() {
|
3039 | this.choiceElementForm = this.formBuilder.group({
|
3040 | checkBox: ['', Validators.required],
|
3041 | }, {
|
3042 | validator: this.specificValueInsideRange('checkBox')
|
3043 | });
|
3044 | }
|
3045 | |
3046 |
|
3047 |
|
3048 |
|
3049 |
|
3050 | showOrHideFreeText(elementId, selectedValue) {
|
3051 | if (selectedValue === 'other') {
|
3052 | $$2('#div_' + elementId + '_other').show();
|
3053 | }
|
3054 | else {
|
3055 | $$2('#div_' + elementId + '_other').hide();
|
3056 | $$2('#txt_other_' + elementId).val('');
|
3057 | }
|
3058 | }
|
3059 | |
3060 |
|
3061 |
|
3062 |
|
3063 |
|
3064 |
|
3065 | updateFreeText(element, elementId, selectedCondition) {
|
3066 | const choiceElement = new ChoiceElement();
|
3067 | choiceElement.elementId = elementId;
|
3068 | choiceElement.selectedValue = (element.value === 'Other') ? 'other' : element.value;
|
3069 | choiceElement.selectedText = element.value;
|
3070 | this.selectedCondition = new SelectedCondition();
|
3071 | this.selectedCondition.selectedConditionId = elementId;
|
3072 | this.selectedCondition.selectedCondition = selectedCondition;
|
3073 | this.selectedCondition.selectedValue = element.value;
|
3074 | this.returnChoiceElement.emit({ receivedElement: choiceElement, selectedCondition: this.selectedCondition });
|
3075 | }
|
3076 | |
3077 |
|
3078 |
|
3079 |
|
3080 | specificValueInsideRange(checkBoxKey) {
|
3081 | return (group) => {
|
3082 | const choiceControl = group.controls[checkBoxKey];
|
3083 | if ((choiceControl.value === 'undefined' || choiceControl.value === '' || this.choiceValue === undefined || this.choiceValue === '')) {
|
3084 | return choiceControl.setErrors({ notEquivalent: true });
|
3085 | }
|
3086 | else {
|
3087 | return choiceControl.setErrors(null);
|
3088 | }
|
3089 | };
|
3090 | }
|
3091 | }
|
3092 | AssistChoiceElementComponent.decorators = [
|
3093 | { type: Component, args: [{
|
3094 | selector: 'acr-assist-choice-element',
|
3095 | template: `<canvas id='Can-ImgMap'>
|
3096 | </canvas>
|
3097 | <form [formGroup]="choiceElementForm" novalidate>
|
3098 | <div class="form-group">
|
3099 | <div class="col-sm-5 text-right">
|
3100 | <label class="control-label">
|
3101 | {{choiceDataElement.label}}
|
3102 | </label>
|
3103 | <ng-container *ngIf="choiceDataElement.hint !== '' && choiceDataElement.hint !== undefined">
|
3104 | <i>
|
3105 | <span class="fa fa-info-circle text-primary" data-toggle="tooltip" data-placement="right" title="{{choiceDataElement.hint}}"></span>
|
3106 | </i>
|
3107 | </ng-container>
|
3108 | <ng-container *ngIf="choiceDataElement.diagrams != undefined ">
|
3109 | <acr-hint-diagram [DataElement]="choiceDataElement" [imagePath]="imagePath"></acr-hint-diagram>
|
3110 | </ng-container>
|
3111 | <span *ngIf="choiceElementForm.controls['checkBox'].invalid && this.choiceDataElement.isRequired " class="required-field"
|
3112 | title="Required Field">*</span>
|
3113 | </div>
|
3114 | <div class="col-sm-7 text-left content-padding">
|
3115 | <ng-container *ngIf="choiceDataElement.choiceInfo.length <= 2">
|
3116 | <ng-container *ngIf="imagePath != undefined">
|
3117 | <ng-container *ngIf="choiceDataElement.imageMap == undefined">
|
3118 | <ng-container *ngFor="let choice of choiceDataElement.choiceInfo">
|
3119 | <div class="radio" style="float:left; margin-right:15px;">
|
3120 | <label>
|
3121 | <input [(ngModel)]="choiceValue" id="{{choice.value}}_{{choiceDataElement.id}}" type="radio" formControlName="checkBox" value="{{choice.value}}"
|
3122 | (change)="choiceSelected(choiceDataElement.id, choiceDataElement.label, (choice.reportText !== undefined) ? choice.reportText : choice.label, choice.value)"> {{choice.label}}
|
3123 | </label>
|
3124 | </div>
|
3125 | </ng-container>
|
3126 | <ng-container *ngIf="choiceDataElement.allowFreetext">
|
3127 | <div class="radio" style="float:left; margin-right:15px;">
|
3128 | <label>
|
3129 | <input id="other_{{choiceDataElement.id}}" type="radio" formControlName="checkBox" value="other" (change)="choiceSelected(choiceDataElement.id, choiceDataElement.label, 'Other', 'other')"> Other, please specify…</label>
|
3130 | </div>
|
3131 | <div id='div_{{choiceDataElement.id}}_other'>
|
3132 | <input id="txt_other_{{choiceDataElement.id}}" class="form-control" type="text" formControlName="checkBox" value="other"
|
3133 | class="form-control" (keyup)='updateFreeText($event.target, choiceDataElement.id, choiceDataElement.label)'
|
3134 | placeholder="Please specify '{{choiceDataElement.label}}'">
|
3135 | </div>
|
3136 | </ng-container>
|
3137 | </ng-container>
|
3138 | <ng-container *ngIf="choiceDataElement.imageMap != undefined">
|
3139 | <div class="row">
|
3140 | <div class="col-xs-6 col-sm-2">
|
3141 | <ng-container *ngFor="let choice of choiceDataElement.choiceInfo">
|
3142 | <div class="radio" style="float:left; margin-right:15px;">
|
3143 | <label>
|
3144 | <input [(ngModel)]="choiceValue" id="{{choice.value}}_{{choiceDataElement.id}}" type="radio" formControlName="checkBox" value="{{choice.value}}"
|
3145 | (change)="choiceSelected(choiceDataElement.id, choiceDataElement.label, (choice.reportText !== undefined) ? choice.reportText : choice.label, choice.value)"> {{choice.label}}
|
3146 | </label>
|
3147 | </div>
|
3148 | </ng-container>
|
3149 | <ng-container *ngIf="choiceDataElement.allowFreetext">
|
3150 | <div class="radio" style="float:left; margin-right:15px;">
|
3151 | <label>
|
3152 | <input id="other_{{choiceDataElement.id}}" type="radio" formControlName="checkBox" value="other" (change)="choiceSelected(choiceDataElement.id, choiceDataElement.label, 'Other', 'other')"> Other, please specify…</label>
|
3153 | </div>
|
3154 | <div id='div_{{choiceDataElement.id}}_other'>
|
3155 | <input id="txt_other_{{choiceDataElement.id}}" class="form-control" type="text" formControlName="checkBox" value="other"
|
3156 | class="form-control" (keyup)='updateFreeText($event.target, choiceDataElement.id, choiceDataElement.label)'
|
3157 | placeholder="Please specify '{{choiceDataElement.label}}'">
|
3158 | </div>
|
3159 | </ng-container>
|
3160 | </div>
|
3161 | <div class="col-xs-6 col-sm-2">
|
3162 | <label class="control-label">OR</label>
|
3163 | </div>
|
3164 | <acr-image-map [DataElement]="choiceDataElement" [imagePath]="imagePath"></acr-image-map>
|
3165 | </div>
|
3166 | </ng-container>
|
3167 | </ng-container>
|
3168 | </ng-container>
|
3169 | <ng-container *ngIf="choiceDataElement.choiceInfo.length > 2">
|
3170 | <select [(ngModel)]="choiceValue" id="{{choiceDataElement.id}}" (change)="dropdownChoiceSelected($event.target, choiceDataElement.label)"
|
3171 | formControlName="checkBox" class="form-control">
|
3172 | <option [value]="Select" [selected]="true">--Select--</option>
|
3173 | <option *ngFor="let choice of choiceDataElement.choiceInfo" [value]="choice.value" [selected]="choice.value === choiceDataElement.currentValue">{{choice.label}}</option>
|
3174 | <option *ngIf="choiceDataElement.allowFreetext" [value]="other" [selected]='other'>Other, please specify…</option>
|
3175 | </select>
|
3176 | <div id='div_{{choiceDataElement.id}}_other'>
|
3177 | <input id="txt_other_{{choiceDataElement.id}}" class="form-control" type="text" formControlName="checkBox" value="other"
|
3178 | placeholder="Please specify '{{choiceDataElement.label}}'" (keyup)='updateFreeText($event.target, choiceDataElement.id, choiceDataElement.label)'>
|
3179 | </div>
|
3180 | <ng-container *ngIf="choiceDataElement.imageMap != undefined && imagePath != undefined">
|
3181 | <div class="row padding-top-10">
|
3182 | <div class="col-xs-6 col-sm-2">
|
3183 | <label class="control-label">OR</label>
|
3184 | </div>
|
3185 | <acr-image-map [DataElement]="choiceDataElement" [imagePath]="imagePath"></acr-image-map>
|
3186 | </div>
|
3187 | </ng-container>
|
3188 | </ng-container>
|
3189 | </div>
|
3190 | </div>
|
3191 | </form>
|
3192 |
|
3193 | `,
|
3194 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
3195 | },] },
|
3196 | ];
|
3197 |
|
3198 | AssistChoiceElementComponent.ctorParameters = () => [
|
3199 | { type: FormBuilder, },
|
3200 | { type: SimulatorEngineService, },
|
3201 | ];
|
3202 | AssistChoiceElementComponent.propDecorators = {
|
3203 | "choiceDataElement": [{ type: Input },],
|
3204 | "imagePath": [{ type: Input },],
|
3205 | "returnChoiceElement": [{ type: Output },],
|
3206 | "choiceChange": [{ type: Output },],
|
3207 | };
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 | const $$3 = require('jquery');
|
3219 | class AssistMultiChoiceElementComponent {
|
3220 | |
3221 |
|
3222 |
|
3223 |
|
3224 | constructor(formBuilder, simulatorEngineService) {
|
3225 | this.formBuilder = formBuilder;
|
3226 | this.simulatorEngineService = simulatorEngineService;
|
3227 | this.returnMultiChoice = new EventEmitter();
|
3228 | this.multiElements = [];
|
3229 | this.multiChoiceValues = [];
|
3230 | this.multiChoiceComaprisonValues = [];
|
3231 | this.choiceValue = [];
|
3232 | }
|
3233 | |
3234 |
|
3235 |
|
3236 | ngOnInit() {
|
3237 | this.createMultiChoiceElementForm();
|
3238 | }
|
3239 | |
3240 |
|
3241 |
|
3242 | ngAfterViewInit() {
|
3243 | if (this.multiChoiceElement.currentValue !== undefined) {
|
3244 | for (const choice in this.multiChoiceElement.choiceInfo) {
|
3245 | if (Array.isArray(this.multiChoiceElement.currentValue)) {
|
3246 | for (const currValue of this.multiChoiceElement.currentValue) {
|
3247 |
|
3248 | if (currValue === this.multiChoiceElement.choiceInfo[choice].value && this.multiChoiceElement.choiceInfo[choice].value !== undefined) {
|
3249 | this.choiceValue = this.multiChoiceElement.currentValue;
|
3250 | this.simulatorEngineService.addOrUpdateDataElement(this.multiChoiceElement.id, this.multiChoiceElement.currentValue, this.multiChoiceElement.choiceInfo[choice].label);
|
3251 | const customEvent = document.createEvent('Event');
|
3252 | $$3('#' + this.multiChoiceElement.id + '_' + this.multiChoiceElement.currentValue[choice]).prop('checked', true);
|
3253 | customEvent.initEvent('change', true, true);
|
3254 | this.selctValue = currValue;
|
3255 | $$3('#' + this.multiChoiceElement.id + '_' + this.multiChoiceElement.currentValue[choice])[0].dispatchEvent(customEvent);
|
3256 | break;
|
3257 | }
|
3258 | }
|
3259 | }
|
3260 | else {
|
3261 | if (this.multiChoiceElement.currentValue === this.multiChoiceElement.choiceInfo[choice].value && this.multiChoiceElement.choiceInfo[choice].value !== undefined) {
|
3262 |
|
3263 | this.simulatorEngineService.addOrUpdateDataElement(this.multiChoiceElement.id, this.multiChoiceElement.currentValue, this.multiChoiceElement.choiceInfo[choice].label);
|
3264 | this.choiceValue = this.multiChoiceElement.currentValue;
|
3265 | const customEvent = document.createEvent('Event');
|
3266 | $$3('#' + this.multiChoiceElement.id + '_' + this.multiChoiceElement.currentValue).prop('checked', true);
|
3267 | customEvent.initEvent('change', true, true);
|
3268 | $$3('#' + this.multiChoiceElement.id + '_' + this.multiChoiceElement.currentValue)[0].dispatchEvent(customEvent);
|
3269 | }
|
3270 | }
|
3271 | if (this.selctValue === this.multiChoiceElement.choiceInfo[choice].value) {
|
3272 | this.checked = this.multiChoiceElement.choiceInfo[choice].value;
|
3273 | }
|
3274 | else {
|
3275 | this.checked = undefined;
|
3276 | }
|
3277 | }
|
3278 | }
|
3279 | }
|
3280 | |
3281 |
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 | updateMultiChoice(elementId, selectedCondition, value, event) {
|
3288 | const multiElement = new MultiChoiceElement();
|
3289 | if (event.currentTarget.checked) {
|
3290 | this.multiChoiceValues.push(value);
|
3291 | this.multiChoiceComaprisonValues.push(event.currentTarget.value);
|
3292 | this.checked = event.currentTarget.value;
|
3293 | if (this.selctValue === event.currentTarget.value) {
|
3294 | this.checked = event.currentTarget.value;
|
3295 | }
|
3296 | else {
|
3297 | this.checked = undefined;
|
3298 | }
|
3299 | }
|
3300 | else {
|
3301 | const index = this.multiChoiceValues.indexOf(value);
|
3302 | this.checked = undefined;
|
3303 | const comparisonIndex = this.multiChoiceComaprisonValues.indexOf(event.currentTarget.value);
|
3304 | if (index > -1) {
|
3305 | this.multiChoiceValues.splice(index, 1);
|
3306 | }
|
3307 | if (comparisonIndex > -1) {
|
3308 | this.multiChoiceComaprisonValues.splice(comparisonIndex, 1);
|
3309 | }
|
3310 | }
|
3311 | multiElement.elementId = elementId;
|
3312 | multiElement.selectedValues = this.multiChoiceValues;
|
3313 | multiElement.selectedComparisonValues = this.multiChoiceComaprisonValues;
|
3314 | this.selectedCondition = new SelectedCondition();
|
3315 | this.selectedCondition.selectedConditionId = elementId;
|
3316 | this.selectedCondition.selectedCondition = selectedCondition;
|
3317 | this.selectedCondition.selectedValue = this.multiChoiceValues;
|
3318 | this.returnMultiChoice.emit({ receivedElement: multiElement, selectedCondition: this.selectedCondition });
|
3319 |
|
3320 | }
|
3321 | |
3322 |
|
3323 |
|
3324 | createMultiChoiceElementForm() {
|
3325 | this.multiChoiceElementForm = this.formBuilder.group({
|
3326 | multiCheckBox: ['', Validators.required],
|
3327 | }, {
|
3328 | validator: this.specificValueInsideRange('multiCheckBox')
|
3329 | });
|
3330 | }
|
3331 | |
3332 |
|
3333 |
|
3334 |
|
3335 | specificValueInsideRange(checkBoxKey) {
|
3336 | return (group) => {
|
3337 | const choiceControl = group.controls[checkBoxKey];
|
3338 | if (this.multiChoiceElement.isRequired) {
|
3339 | return choiceControl.setErrors({ notEquivalent: true });
|
3340 | }
|
3341 | else {
|
3342 | return choiceControl.setErrors(null);
|
3343 | }
|
3344 | };
|
3345 | }
|
3346 | }
|
3347 | AssistMultiChoiceElementComponent.decorators = [
|
3348 | { type: Component, args: [{
|
3349 | selector: 'acr-assist-multi-choice-element',
|
3350 | template: `<form [formGroup]="multiChoiceElementForm" novalidate>
|
3351 | <div class="form-group">
|
3352 | <div class="col-sm-5 text-right">
|
3353 | <label class="control-label DEElement" id="{{multiChoiceElement.id}}">
|
3354 | {{multiChoiceElement.label}}
|
3355 | </label>
|
3356 | <ng-container *ngIf="multiChoiceElement.hint !== '' && multiChoiceElement.hint !== undefined">
|
3357 | <i>
|
3358 | <span class="fa fa-info-circle text-primary" data-toggle="tooltip" data-placement="right" title="{{multiChoiceElement.hint}}"></span>
|
3359 | </i>
|
3360 | </ng-container>
|
3361 | <ng-container *ngIf="multiChoiceElement.diagrams != undefined ">
|
3362 | <acr-hint-diagram [DataElement]="multiChoiceElement" [imagePath]="imagePath"></acr-hint-diagram>
|
3363 | </ng-container>
|
3364 | <span *ngIf="multiChoiceElementForm.controls['multiCheckBox'].invalid && !multiChoiceValues.length" class="required-field"
|
3365 | title="Required Field">
|
3366 | *
|
3367 | </span>
|
3368 | </div>
|
3369 | <div class="col-sm-7">
|
3370 | <div *ngFor="let choice of multiChoiceElement.choiceInfo" class="checkbox" title="{{choice.hint}}">
|
3371 | <label>
|
3372 | <input type="checkbox"[(ngModel)]="checked" id="{{multiChoiceElement.id}}_{{choice.value}}" [checked]="false"
|
3373 | formControlName="multiCheckBox" (change)="updateMultiChoice(multiChoiceElement.id, multiChoiceElement.label, (choice.reportText !== undefined) ? choice.reportText : choice.label, $event)">
|
3374 | {{choice.label}}</label>
|
3375 | </div>
|
3376 | </div>
|
3377 | </div>
|
3378 | </form>
|
3379 | `,
|
3380 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
3381 | },] },
|
3382 | ];
|
3383 |
|
3384 | AssistMultiChoiceElementComponent.ctorParameters = () => [
|
3385 | { type: FormBuilder, },
|
3386 | { type: SimulatorEngineService, },
|
3387 | ];
|
3388 | AssistMultiChoiceElementComponent.propDecorators = {
|
3389 | "multiChoiceElement": [{ type: Input },],
|
3390 | "imagePath": [{ type: Input },],
|
3391 | "returnMultiChoice": [{ type: Output },],
|
3392 | };
|
3393 |
|
3394 |
|
3395 |
|
3396 |
|
3397 |
|
3398 | class ImageMapComponent {
|
3399 | constructor() {
|
3400 | this.$ = require('jquery');
|
3401 | this.DataElements = {};
|
3402 | this.FormValues = {};
|
3403 | this.imageExist = true;
|
3404 | this.SelectionValue = '';
|
3405 | }
|
3406 | |
3407 |
|
3408 |
|
3409 | ngOnInit() {
|
3410 | if (this.DataElement === undefined) {
|
3411 | return;
|
3412 | }
|
3413 | this.displayValue('');
|
3414 | }
|
3415 | |
3416 |
|
3417 |
|
3418 |
|
3419 |
|
3420 |
|
3421 | isInRectangle(mouseX, mouseY, Coordinates) {
|
3422 | const COArray = Coordinates.split(',');
|
3423 | if (COArray[0] < mouseX
|
3424 | && (COArray[0] + COArray[2]) > mouseX
|
3425 | && COArray[1] < mouseY
|
3426 | && (COArray[1] + COArray[3]) > mouseY) {
|
3427 | return true;
|
3428 | }
|
3429 | return false;
|
3430 | }
|
3431 | |
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 |
|
3437 | isInCircle(mouseX, mouseY, Coordinates) {
|
3438 | const COArray = Coordinates.split(',');
|
3439 | if (Math.sqrt(Math.pow((mouseX - COArray[0]), 2) + Math.pow((mouseY - COArray[1]), 2)) < COArray[2]) {
|
3440 | return true;
|
3441 | }
|
3442 | else {
|
3443 | return false;
|
3444 | }
|
3445 | }
|
3446 | |
3447 |
|
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 | isInPolygon(x, y, Coordinates) {
|
3453 | const COArray = Coordinates.split(',');
|
3454 | const vs = [];
|
3455 | for (let i = 0; i < COArray.length; i++) {
|
3456 | const point = [];
|
3457 | point.push(COArray[i]);
|
3458 | point.push(COArray[i + 1]);
|
3459 | i += 1;
|
3460 | vs.push(point);
|
3461 | }
|
3462 | let inside = false;
|
3463 | for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) {
|
3464 | const xi = vs[i][0], yi = vs[i][1];
|
3465 | const xj = vs[j][0], yj = vs[j][1];
|
3466 | const intersect = ((yi > y) !== (yj > y))
|
3467 | && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
|
3468 | if (intersect) {
|
3469 | inside = !inside;
|
3470 | }
|
3471 | }
|
3472 | return inside;
|
3473 | }
|
3474 | |
3475 |
|
3476 |
|
3477 |
|
3478 |
|
3479 | imageClick(e, dataElement) {
|
3480 | const O_height = dataElement.ImageProp.height;
|
3481 | const O_width = dataElement.ImageProp.width;
|
3482 | const $elem = this.$(e.target);
|
3483 | const N_height = $elem.height();
|
3484 | const N_width = $elem.width();
|
3485 | const offset = $elem.offset();
|
3486 | const offset_t = offset.top - this.$(window).scrollTop();
|
3487 | const offset_l = offset.left - this.$(window).scrollLeft();
|
3488 | const x = e.clientX - offset_l;
|
3489 | const y = e.clientY - offset_t;
|
3490 | for (const opt of dataElement.ImageOptions) {
|
3491 | if (opt.Shape === 'rect') {
|
3492 | if (this.isInRectangle(x, y, opt.Coordinates)) {
|
3493 | this.FormValues[dataElement.ID] = opt.Value;
|
3494 | break;
|
3495 | }
|
3496 | }
|
3497 | else if (opt.Shape === 'circle') {
|
3498 | if (this.isInCircle(x, y, opt.Coordinates)) {
|
3499 | this.FormValues[dataElement.ID] = opt.Value;
|
3500 | break;
|
3501 | }
|
3502 | }
|
3503 | else if (opt.Shape === 'poly') {
|
3504 | if (this.isInPolygon(x, y, opt.Coordinates)) {
|
3505 | this.FormValues[dataElement.ID] = opt.Value;
|
3506 | break;
|
3507 | }
|
3508 | }
|
3509 | }
|
3510 | }
|
3511 | |
3512 |
|
3513 |
|
3514 |
|
3515 | setValue(val) {
|
3516 | for (const optValue of this.DataElement.choiceInfo) {
|
3517 | if (this.DataElement.choiceInfo.length <= 5 && this.DataElement.choiceInfo.length > 0) {
|
3518 | if (optValue.value === val) {
|
3519 | this.$('#' + val + '_' + this.DataElement.id).prop('checked', true);
|
3520 |
|
3521 | }
|
3522 | else {
|
3523 | this.$('#' + optValue.value + '_' + this.DataElement.id).prop('checked', false);
|
3524 | }
|
3525 | }
|
3526 | else {
|
3527 | if (optValue.value === val) {
|
3528 | this.$('#' + this.DataElement.id).val(optValue.value);
|
3529 | const customEvent = document.createEvent('Event');
|
3530 | customEvent.initEvent('change', true, true);
|
3531 | this.$('#' + this.DataElement.id)[0].dispatchEvent(customEvent);
|
3532 | break;
|
3533 | }
|
3534 | }
|
3535 | }
|
3536 | this.DataElement.currentValue = val;
|
3537 |
|
3538 | }
|
3539 | |
3540 |
|
3541 |
|
3542 |
|
3543 | displayValue(val) {
|
3544 | if (val === '') {
|
3545 | this.SelectionValue = 'Image Map Diagram';
|
3546 | }
|
3547 | else {
|
3548 | this.SelectionValue = 'Selected Value : ' + val;
|
3549 | }
|
3550 | }
|
3551 | }
|
3552 | ImageMapComponent.decorators = [
|
3553 | { type: Component, args: [{
|
3554 | selector: 'acr-image-map',
|
3555 | template: `<div class="col-sm-8">
|
3556 | <label class="control-label" style="font-weight:400;">Not sure? try out this image </label>
|
3557 | <button type="button" class="btn btn-default" data-toggle="modal" attr.data-target="#{{'imgMap_Modal_'+DataElement.id}}">
|
3558 | <span class="glyphicon glyphicon-picture" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="Image Map"></span>
|
3559 | </button>
|
3560 | </div>
|
3561 | <ng-container *ngIf="imagePath != undefined">
|
3562 | <div class="modal inmodal fade" id="{{'imgMap_Modal_'+DataElement.id}}" tabindex="-1" role="dialog" aria-hidden="true">
|
3563 | <div class="modal-dialog modal-lg">
|
3564 | <div class="modal-content">
|
3565 | <div class="modal-header">
|
3566 | <button type="button" class="close" data-dismiss="modal">
|
3567 | <span aria-hidden="true">×</span>
|
3568 | <span class="sr-only">Close</span>
|
3569 | </button>
|
3570 | <h4 class="modal-title"> {{SelectionValue}}</h4>
|
3571 | </div>
|
3572 | <div class="modal-body">
|
3573 | <div class="row">
|
3574 | <div class="col-md-12">
|
3575 | <ng-container *ngIf="imageExist == true">
|
3576 | <img class="ImgOption danger" alt="No Image Available!!!" data-dismiss="modal" attr.id="{{'imgMap_Img_'+DataElement.id}}"
|
3577 | (click)="imageClick($event,DataElement);" attr.data-elementID="{{DataElement.id}}" attr.usemap="#{{'imgMap_'+DataElement.id}}"
|
3578 | src="../../../../../assets/XMLFIles/Hello_RADS/washoutImages.png">
|
3579 | <map name="{{'imgMap_'+DataElement.id}}">
|
3580 | <ng-container *ngFor="let imgOpt of DataElement.imageMap.map.areas">
|
3581 | <area attr.shape="{{imgOpt.shape}}" attr.imgID="{{'imgMap_Img_'+DataElement.id}}" attr.coords="{{imgOpt.coords}}" attr.alt="{{imgOpt.choiceValue}}"
|
3582 | (mouseover)='displayValue(imgOpt.choiceValue);' (mouseout)='displayValue("");' (click)="setValue(imgOpt.choiceValue);"
|
3583 | data-dismiss="modal">
|
3584 | </ng-container>
|
3585 | </map>
|
3586 | </ng-container>
|
3587 | <ng-container *ngIf="imageExist == false">
|
3588 | <div class="">
|
3589 | No Image Map Available...
|
3590 | </div>
|
3591 | </ng-container>
|
3592 | </div>
|
3593 | </div>
|
3594 | </div>
|
3595 | <div class="modal-footer">
|
3596 | <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
|
3597 | </div>
|
3598 | </div>
|
3599 | </div>
|
3600 | </div>
|
3601 | </ng-container>
|
3602 | `,
|
3603 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
3604 | },] },
|
3605 | ];
|
3606 |
|
3607 | ImageMapComponent.propDecorators = {
|
3608 | "DataElement": [{ type: Input },],
|
3609 | "DataElements": [{ type: Input },],
|
3610 | "FormValues": [{ type: Input },],
|
3611 | "imagePath": [{ type: Input },],
|
3612 | };
|
3613 |
|
3614 |
|
3615 |
|
3616 |
|
3617 |
|
3618 | class ComputedDataElement extends BaseDataElement {
|
3619 | }
|
3620 |
|
3621 |
|
3622 |
|
3623 |
|
3624 |
|
3625 | class ComputedDataElementCreationService extends DataElementCreationBaseService {
|
3626 | |
3627 |
|
3628 |
|
3629 |
|
3630 |
|
3631 |
|
3632 | constructor(diagramService, arrayCheckerService, computedValueCreationService, decisionPointsCreationService) {
|
3633 | super(diagramService);
|
3634 | this.arrayCheckerService = arrayCheckerService;
|
3635 | this.computedValueCreationService = computedValueCreationService;
|
3636 | this.decisionPointsCreationService = decisionPointsCreationService;
|
3637 | this.elementType = 'ComputedDataElement';
|
3638 | }
|
3639 | |
3640 |
|
3641 |
|
3642 |
|
3643 | createElement(data) {
|
3644 | const dataElement = new ComputedDataElement();
|
3645 | super.populateBasicData(data, dataElement);
|
3646 | dataElement.computeValue = this.computedValueCreationService.createComputedValue(data);
|
3647 | if (data.DecisionPoint) {
|
3648 | dataElement.decisionPoints = this.decisionPointsCreationService.createDecisionPoints(data.DecisionPoint);
|
3649 | }
|
3650 | return dataElement;
|
3651 | }
|
3652 | }
|
3653 | ComputedDataElementCreationService.decorators = [
|
3654 | { type: Injectable },
|
3655 | ];
|
3656 |
|
3657 | ComputedDataElementCreationService.ctorParameters = () => [
|
3658 | { type: DiagramService, },
|
3659 | { type: ArrayCheckerService, },
|
3660 | { type: ComputedValueCreationService, },
|
3661 | { type: DecisionPointsCreationService, },
|
3662 | ];
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 |
|
3668 | const $$4 = require('jquery');
|
3669 | class AssistReportTextComponent {
|
3670 | constructor() {
|
3671 | this.allReportTexts = [];
|
3672 | this.sections = [];
|
3673 | setInterval(() => {
|
3674 | }, 1000);
|
3675 | }
|
3676 | |
3677 |
|
3678 |
|
3679 |
|
3680 | ngOnChanges(changes) {
|
3681 | this.mainReportTexts = new MainReportText();
|
3682 | this.onSelect(this.selectedSectionId);
|
3683 | }
|
3684 | |
3685 |
|
3686 |
|
3687 |
|
3688 | onSelect(sectionId) {
|
3689 | this.selectedSectionId = sectionId;
|
3690 | this.sections = [];
|
3691 | this.selectedSection = null;
|
3692 | for (const section in this.reportText.allReportText) {
|
3693 | if (this.reportText.allReportText[section].reportText !== '') {
|
3694 | this.sections.push(section);
|
3695 | }
|
3696 | }
|
3697 | if (sectionId === 'undefined' || sectionId === undefined || sectionId === 'All') {
|
3698 | this.allTextReport = [];
|
3699 | for (const section in this.reportText.allReportText) {
|
3700 | if (this.reportText.allReportText[section].reportText !== '') {
|
3701 | const textReport = new AllTextReport();
|
3702 | textReport.heading = section;
|
3703 | textReport.content = this.removeEmptyLine(this.reportText.allReportText[section].reportText);
|
3704 | this.allTextReport.push(textReport);
|
3705 | }
|
3706 | }
|
3707 | this.selectedSectionId = 'All';
|
3708 | }
|
3709 | for (const section in this.reportText.allReportText) {
|
3710 | if (this.reportText.allReportText[section].sectionId === sectionId) {
|
3711 | this.selectedSection = this.reportText.allReportText[section].reportText;
|
3712 | this.selectedSection = this.reportText.reportTextMainContent + ((this.selectedSection !== undefined && this.selectedSection !== '') ? this.removeEmptyLine(this.selectedSection) : '');
|
3713 | break;
|
3714 | }
|
3715 | }
|
3716 | this.mainReportTexts = new MainReportText();
|
3717 | this.allReportTexts = [];
|
3718 | for (const section in this.reportText.allReportText) {
|
3719 | const allreportText = new AllReportText();
|
3720 | allreportText.reportText = this.removeEmptyLine(this.reportText.allReportText[section].reportText);
|
3721 | allreportText.sectionId = this.reportText.allReportText[section].sectionId;
|
3722 | this.allReportTexts.push(allreportText);
|
3723 | }
|
3724 | this.mainReportTexts.allReportText = this.allReportTexts;
|
3725 | this.mainReportTexts.reportTextMainContent = this.reportText.reportTextMainContent;
|
3726 | }
|
3727 | |
3728 |
|
3729 |
|
3730 |
|
3731 | removeEmptyLine(inputText) {
|
3732 | if (inputText.trim().length !== 0) {
|
3733 | const lines = inputText.split('\n');
|
3734 | const uniquelines = [];
|
3735 | lines.forEach(function (line, i) {
|
3736 | if (line.trim().length !== 0) {
|
3737 | uniquelines.push(line);
|
3738 | }
|
3739 | });
|
3740 | return uniquelines.join('\n');
|
3741 | }
|
3742 | }
|
3743 | }
|
3744 | AssistReportTextComponent.decorators = [
|
3745 | { type: Component, args: [{
|
3746 | selector: 'acr-assist-report-text',
|
3747 | template: `<div class="ibox-title">
|
3748 | <h5>Report Text</h5>
|
3749 | </div>
|
3750 | <div class="ibox-content" style="border:1px solid #f4f4f4;">
|
3751 | <section class="ac-container">
|
3752 | <ng-container *ngFor="let textReport of allTextReport">
|
3753 | <div>
|
3754 | <input id="{{textReport.heading}}" name="accordion-{{textReport.heading}}" type="checkbox" checked="checked">
|
3755 | <label for="{{textReport.heading}}" class="text-capitalize">{{textReport.heading}}</label>
|
3756 | <article class="ac-small">
|
3757 | <p class="white-space-line" [innerHTML]="textReport.content"></p>
|
3758 | </article>
|
3759 | </div>
|
3760 | </ng-container>
|
3761 | </section>
|
3762 | </div>
|
3763 | `,
|
3764 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
3765 | },] },
|
3766 | ];
|
3767 |
|
3768 | AssistReportTextComponent.ctorParameters = () => [];
|
3769 | AssistReportTextComponent.propDecorators = {
|
3770 | "reportText": [{ type: Input },],
|
3771 | };
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 | const components = [AcrAssistSimulatorComponent, AssistDataElementComponent, HintDiagramComponent, SlideComponent, CarouselComponent,
|
3778 | AssistNumericElementComponent, AssistChoiceElementComponent, AssistMultiChoiceElementComponent,
|
3779 | ImageMapComponent, AssistReportTextComponent];
|
3780 | class AcrAssistSimulatorModule {
|
3781 | }
|
3782 | AcrAssistSimulatorModule.decorators = [
|
3783 | { type: NgModule, args: [{
|
3784 | imports: [
|
3785 | CommonModule,
|
3786 | CoreModule,
|
3787 | FormsModule,
|
3788 | ReactiveFormsModule
|
3789 | ],
|
3790 | declarations: components,
|
3791 | providers: [TemplateManagerService,
|
3792 | DiagramService,
|
3793 | CarouselConfig,
|
3794 | ArrayCheckerService,
|
3795 | ConditionsCreationService,
|
3796 | DecisionPointsCreationService,
|
3797 | ComputedValueCreationService,
|
3798 | SimulatorEngineService,
|
3799 | { provide: CreationServiceInjectorToken, useClass: ChoiceDataElementCreationService, multi: true },
|
3800 | { provide: CreationServiceInjectorToken, useClass: MultipleChoiceDataElementCreationService, multi: true },
|
3801 | { provide: CreationServiceInjectorToken, useClass: NumericDataElementCreationService, multi: true },
|
3802 | { provide: CreationServiceInjectorToken, useClass: IntegerDataElementCreationService, multi: true },
|
3803 | { provide: CreationServiceInjectorToken, useClass: GlobalValueCreationService, multi: true },
|
3804 | { provide: CreationServiceInjectorToken, useClass: ComputedDataElementCreationService, multi: true }
|
3805 | ],
|
3806 | exports: components
|
3807 | },] },
|
3808 | ];
|
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 |
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 | class Dictionary {
|
3823 | constructor() {
|
3824 | this.items = {};
|
3825 | this.count = 0;
|
3826 | }
|
3827 | |
3828 |
|
3829 |
|
3830 |
|
3831 | ContainsKey(key) {
|
3832 | return this.items.hasOwnProperty(key);
|
3833 | }
|
3834 | |
3835 |
|
3836 |
|
3837 | Count() {
|
3838 | return this.count;
|
3839 | }
|
3840 | |
3841 |
|
3842 |
|
3843 |
|
3844 |
|
3845 | Add(key, value) {
|
3846 | if (!this.items.hasOwnProperty(key)) {
|
3847 | this.count++;
|
3848 | }
|
3849 | this.items[key] = value;
|
3850 | }
|
3851 | |
3852 |
|
3853 |
|
3854 |
|
3855 | Remove(key) {
|
3856 | const val = this.items[key];
|
3857 | delete this.items[key];
|
3858 | this.count--;
|
3859 | return val;
|
3860 | }
|
3861 | |
3862 |
|
3863 |
|
3864 |
|
3865 | Item(key) {
|
3866 | return this.items[key];
|
3867 | }
|
3868 | |
3869 |
|
3870 |
|
3871 | Keys() {
|
3872 | const keySet = [];
|
3873 | for (const prop in this.items) {
|
3874 | if (this.items.hasOwnProperty(prop)) {
|
3875 | keySet.push(prop);
|
3876 | }
|
3877 | }
|
3878 | return keySet;
|
3879 | }
|
3880 | |
3881 |
|
3882 |
|
3883 | Values() {
|
3884 | const values = [];
|
3885 | for (const prop in this.items) {
|
3886 | if (this.items.hasOwnProperty(prop)) {
|
3887 | values.push(this.items[prop]);
|
3888 | }
|
3889 | }
|
3890 | return values;
|
3891 | }
|
3892 | }
|
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 | class GlobalsService {
|
3899 | |
3900 |
|
3901 |
|
3902 | constructor(http) {
|
3903 | this.http = http;
|
3904 | this.defaultModule = 'assets/XMLFIles/Hello_RADS/Hello_RADS.xml';
|
3905 | this.XMLList = new Dictionary();
|
3906 | }
|
3907 | |
3908 |
|
3909 |
|
3910 | getDefaultModulePath() {
|
3911 | return this.http.get(this.defaultModule).map(res => res.text());
|
3912 | }
|
3913 | }
|
3914 | GlobalsService.decorators = [
|
3915 | { type: Injectable },
|
3916 | ];
|
3917 |
|
3918 | GlobalsService.ctorParameters = () => [
|
3919 | { type: Http, },
|
3920 | ];
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 | const $$5 = require('jquery');
|
3927 | class ViewUploadLoaderComponent {
|
3928 | |
3929 |
|
3930 |
|
3931 | constructor(globalsService) {
|
3932 | this.onFileSelected = new EventEmitter();
|
3933 | this.globalsService = globalsService;
|
3934 | }
|
3935 | |
3936 |
|
3937 |
|
3938 |
|
3939 | onFileContentRead(fileDetails) {
|
3940 | this.selectedXML = fileDetails;
|
3941 | if (this.globalsService.XMLList.ContainsKey(fileDetails.fileLabel)) {
|
3942 | this.globalsService.XMLList.Remove(fileDetails.fileLabel);
|
3943 | }
|
3944 | this.globalsService.XMLList.Add(fileDetails.fileLabel, fileDetails);
|
3945 | this.onFileSelected.emit(fileDetails);
|
3946 | }
|
3947 | |
3948 |
|
3949 |
|
3950 |
|
3951 | onFileClick(fileDetails) {
|
3952 | this.selectedXML = fileDetails;
|
3953 | this.onFileSelected.emit(fileDetails);
|
3954 | $$5('#xmlOnlyMsg').hide();
|
3955 | }
|
3956 | }
|
3957 | ViewUploadLoaderComponent.decorators = [
|
3958 | { type: Component, args: [{
|
3959 | selector: 'acr-view-upload-loader',
|
3960 | template: `<ul class="nav metismenu">
|
3961 | <li class="landing_link">
|
3962 | <a href="#">Want to try your assist module?</a>
|
3963 | </li>
|
3964 | <li class="text-center">
|
3965 | <acr-file-upload-loader (onFileContentRead)="onFileContentRead($event)"></acr-file-upload-loader>
|
3966 | </li>
|
3967 | </ul>
|
3968 | <ul class="nav metismenu">
|
3969 | <li [ngClass]="{'active':(selectedXML != 'undefined' && selectedXML.fileLabel == file.fileLabel)}" *ngFor="let file of globalsService.XMLList.Values().reverse()">
|
3970 | <a href="#" (click)="onFileClick(file)">
|
3971 | <span class="nav-label">{{file.fileLabel}}</span>
|
3972 | </a>
|
3973 | </li>
|
3974 | </ul>
|
3975 | `,
|
3976 | styles: [``]
|
3977 | },] },
|
3978 | ];
|
3979 |
|
3980 | ViewUploadLoaderComponent.ctorParameters = () => [
|
3981 | { type: GlobalsService, },
|
3982 | ];
|
3983 | ViewUploadLoaderComponent.propDecorators = {
|
3984 | "onFileSelected": [{ type: Output },],
|
3985 | };
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 |
|
3991 | class FileDetails {
|
3992 | |
3993 |
|
3994 |
|
3995 |
|
3996 |
|
3997 | constructor(fileLabel, fileName, fileContents) {
|
3998 | this.fileLabel = fileLabel;
|
3999 | this.fileName = fileName;
|
4000 | this.fileContents = fileContents;
|
4001 | }
|
4002 | }
|
4003 |
|
4004 |
|
4005 |
|
4006 |
|
4007 |
|
4008 | const $$6 = require('jquery');
|
4009 | class FileUploadLoaderComponent {
|
4010 | |
4011 |
|
4012 |
|
4013 | constructor(configService) {
|
4014 | this.configService = configService;
|
4015 | this.onFileContentRead = new EventEmitter();
|
4016 | this.fileReader = new FileReader();
|
4017 | }
|
4018 | |
4019 |
|
4020 |
|
4021 | ngOnInit() {
|
4022 | this.hideMessage();
|
4023 | this.showDefaultModule();
|
4024 | }
|
4025 | |
4026 |
|
4027 |
|
4028 |
|
4029 | changeListener($event) {
|
4030 | let fileName;
|
4031 | fileName = $event.target.value;
|
4032 | if (fileName.includes('.xml') || fileName.includes('.Xml') || fileName.includes('.XML') ||
|
4033 | fileName.includes('.zip') || fileName.includes('.Zip') || fileName.includes('.ZIP')) {
|
4034 | this.hideMessage();
|
4035 | this.readThis($event.target);
|
4036 | }
|
4037 | else {
|
4038 | if (fileName !== '' && fileName !== undefined) {
|
4039 | $$6('#xmlOnlyMsg').show();
|
4040 | }
|
4041 | }
|
4042 | }
|
4043 | |
4044 |
|
4045 |
|
4046 | hideMessage() {
|
4047 | $$6('#xmlOnlyMsg').hide();
|
4048 | }
|
4049 | |
4050 |
|
4051 |
|
4052 |
|
4053 | readThis(inputValue) {
|
4054 | this.readFile = inputValue.files[0];
|
4055 | const self = this;
|
4056 | const extensionStartPosition = self.readFile.name.lastIndexOf('.');
|
4057 | this.fileReader.onloadend = (e) => {
|
4058 | self.onFileContentRead.emit(new FileDetails(self.readFile.name.substring(0, extensionStartPosition), self.readFile.name, this.fileReader.result));
|
4059 | };
|
4060 | this.fileReader.readAsText(this.readFile);
|
4061 | }
|
4062 | |
4063 |
|
4064 |
|
4065 | showDefaultModule() {
|
4066 | this.configService.getDefaultModulePath()
|
4067 | .subscribe(data => {
|
4068 | const self = this;
|
4069 | self.onFileContentRead.emit(new FileDetails('Hello RADS', 'Hello_RADS.xml', data));
|
4070 | });
|
4071 | }
|
4072 | }
|
4073 | FileUploadLoaderComponent.decorators = [
|
4074 | { type: Component, args: [{
|
4075 | selector: 'acr-file-upload-loader',
|
4076 | template: `<input id="xmlFileUpload" class="inputfile" type="file" accept=".xml" (change)="changeListener($event)" (click)="hideMessage()">
|
4077 | <label for="xmlFileUpload" class="btn btn-w-m btn-success" style="margin:10px;" title="Choose a Module">Choose a Module</label>
|
4078 | <br>
|
4079 | <div id="xmlOnlyMsg" class="xml-only-msg"> Only XML files are supported !!!</div>
|
4080 | `,
|
4081 | styles: [`.modal-content{background-clip:padding-box;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);outline:0;position:relative}.modal-dialog{z-index:2200}.modal-body{padding:20px 30px 30px}.inmodal .modal-body{background:#f8fafb}.inmodal .modal-header{padding:30px 15px;text-align:center}.animated.modal.fade .modal-dialog{-webkit-transform:none;transform:none}.inmodal .modal-title{font-size:26px}.inmodal .modal-icon{font-size:84px;color:#e2e3e3}.modal-footer{margin-top:0}.modal-backdrop{top:10000px!important}input[type=file].inputfile{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1;margin:0}input[type=file].inputfile+label,input[type=file].inputfile+label:active{max-width:100%;font-size:100%;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;display:inline-block;color:#f1e5e6;background-color:#d3394c;text-indent:0}input[type=file].inputfile+label:hover{background-color:#722040}input[type=file].inputfile+label{cursor:pointer}input[type=file].inputfile:hover+label{outline:#000 dotted 1px;outline:-webkit-focus-ring-color auto 5px}input[type=radio]:checked+div{background-color:#1e89b5!important;border:1px solid #9b9b9b;color:#fff}input[type=radio]+div{background-color:#f5f5f5!important;border:1px solid #9b9b9b;border-radius:5px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}input[type=number],input[type=number]:focus,input[type=number]:hover{-moz-appearance:textfield}input[type=text]{max-width:280px;margin-left:0!important;border-radius:5px!important;text-transform:capitalize}.checkbox>label{height:auto;line-height:25px;width:100%}.checkbox>label>input[type=checkbox]{margin-left:-20px;margin-top:6px}[type=radio]+span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:1em;border:.1px solid #fff;-webkit-box-shadow:0 0 0 1px #57aed0;box-shadow:0 0 0 1px #57aed0;margin-right:4px;-webkit-transition:.5s ease all;transition:.5s ease all;margin-left:-15px}[type=radio]:checked+span::before{background:#57aed0;-webkit-box-shadow:0 0 0 2px #57aed0;box-shadow:0 0 0 2px #57aed0;margin-top:auto}.close{margin-top:-20px!important}.xml-only-msg{border:1px solid red;border-radius:5px;padding:5px;font-size:12px;color:#fff;width:220px;display:inline-block;font-weight:700}@media (min-width:400px) and (max-width:1024px){.xml-only-msg{width:120px}}#Can-ImgMap{pointer-events:none;position:absolute;opacity:.5}@media (max-width:767px){.form-group{padding-left:30px;padding-right:30px}.col-sm-5.text-right{float:left}.col-sm-8{padding-right:30px}.control-label{text-align:left!important}}@media only screen and (min-width:1224px){.modal-lg{left:0}}.form-group{margin-bottom:15px;margin-left:15px;margin-right:15px}.control-label{margin-top:0;margin-left:0}@media (min-width:1224px){.modal-lg{width:630px}}@media (min-width:1850px){.modal-lg{width:900px}}[type=number]{max-width:280px}@media (min-width:1441px){.DEValues{height:auto}}.row{font-weight:700}.bottom-margin{margin-bottom:25px}.img-max-width{width:70%!important}.fixed-report-text-sidebar{position:fixed;right:0;width:45%}.keydiagram{margin-top:10px;width:100%;text-align:center;margin-left:0!important}.row.content-area{padding:0 5px}.text-right.border-0>h4{padding-right:20px}@media (max-width:1024px){.keydiagram{width:100%;margin-left:9%}.img-max-width{width:80%!important}}@media (max-width:1023px){.fixed-report-text-sidebar{position:relative}}.padding-top-10{padding-top:10px}.box-body{padding:10px;border-radius:0 0 3px 3px}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid{border-top:0}.box.box-primary{border-top-color:#3c8dbc}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1)}.ac-container{margin:0 auto;text-align:left}.ac-container label{margin-bottom:0;padding:5px 20px 5px 40px;position:relative;z-index:20;display:block;height:30px;cursor:pointer;color:#777;text-shadow:1px 1px 1px rgba(255,255,255,.8);line-height:22px;font-size:14px;background:#fff;background:-ms-linear-gradient(top,#fff 1%,#eaeaea 100%);background:linear-grdient(top,#fff 1%,#eaeaea 100%);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),1px 0 0 0 rgba(255,255,255,.9) inset,0 2px 2px rgba(0,0,0,.1)}.ac-container label:hover{background:#fff}.ac-container input:checked+label,.ac-container input:checked+label:hover{text-shadow:0 1px 1px rgba(255,255,255,.6);-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(155,155,155,.3),0 2px 2px rgba(0,0,0,.1)}.ac-container label:after{content:'\\2b';position:absolute;width:24px;height:24px;left:8px;top:4px;font-size:18px}.ac-container input:checked+label:after,.ac-container input:checked+label:hover:after{content:'\\2212';font-size:18px}.ac-container input{display:none}.ac-container article{background:rgba(255,255,255,.5);margin-top:-1px;overflow:hidden;height:0;position:relative;z-index:10;-webkit-transition:height .3s ease-in-out,box-shadow .6s linear;-webkit-transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,-webkit-box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear;transition:height .3s ease-in-out,box-shadow .6s linear,-webkit-box-shadow .6s linear}.ac-container article p{font-style:normal;font-weight:700;color:#777;line-height:23px;font-size:14px;padding:20px;text-shadow:1px 1px 1px rgba(255,255,255,.8)}.ac-container input:checked~article{-webkit-transition:height .5s ease-in-out,box-shadow .1s linear;-webkit-transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,-webkit-box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear;transition:height .5s ease-in-out,box-shadow .1s linear,-webkit-box-shadow .1s linear;-webkit-box-shadow:0 0 0 1px rgba(155,155,155,.3);box-shadow:0 0 0 1px rgba(155,155,155,.3)}.ac-container input:checked~article.ac-small{height:auto}.ac-container input:checked~article.ac-medium{height:180px}.ac-container input:checked~article.ac-large{height:230px}.ac-container>div{margin-bottom:10px}.ibox-content h1,.ibox-content h2,.ibox-content h3,.ibox-content h4,.ibox-content h5,.ibox-title h1,.ibox-title h2,.ibox-title h3,.ibox-title h4,.ibox-title h5{margin-top:5px}.ibox-content.text-box{padding-bottom:0;padding-top:15px}.ibox{clear:both;margin-bottom:25px;margin-top:0;padding:0}.ibox.collapsed .ibox-content{display:none}.ibox.collapsed .fa.fa-chevron-up:before{content:"\\f078"}.ibox.collapsed .fa.fa-chevron-down:before{content:"\\f077"}.ibox:after,.ibox:before{display:table}.ibox-title{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#fff;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:3px 0 0;color:inherit;margin-bottom:0;padding:14px 15px 7px;min-height:48px;border-left:1px solid #f4f4f4;border-right:1px solid #f4f4f4}.ibox-content{background-color:#fff;color:inherit;padding:15px 20px 20px;border-color:#e7eaec;-o-border-image:none;border-image:none;border-style:solid solid none;border-width:1px 0;clear:both}.ibox-footer{color:inherit;border-top:1px solid #e7eaec;font-size:90%;background:#fff;padding:10px 15px}.ibox-heading{background-color:#f3f6fb;border-bottom:none}.ibox-heading h3{font-weight:200;font-size:24px}.ibox-title h5{display:inline-block;font-size:14px;margin:0 0 7px;padding:0;text-overflow:ellipsis;float:left}.ibox-title .label{float:left;margin-left:4px}.ibox-tools{display:block;float:none;margin-top:0;position:relative;padding:0;text-align:right}.ibox-tools a{cursor:pointer;margin-left:5px;color:#c4c4c4}.ibox-tools a.btn-primary{color:#fff}.ibox-tools .dropdown-menu>li>a{padding:4px 10px;font-size:12px}.ibox .ibox-tools.open>.dropdown-menu{left:auto;right:0}@media (max-width:768px){.ibox-tools{float:none;text-align:right;display:block}}@media (max-width:350px){.ibox-tools{float:none;text-align:left;display:inline-block}}p.white-space-line{white-space:pre-line}.required-field{padding:5px;font-size:16px;color:red;display:inline-block;font-weight:700}`]
|
4082 | },] },
|
4083 | ];
|
4084 |
|
4085 | FileUploadLoaderComponent.ctorParameters = () => [
|
4086 | { type: GlobalsService, },
|
4087 | ];
|
4088 | FileUploadLoaderComponent.propDecorators = {
|
4089 | "onFileContentRead": [{ type: Output },],
|
4090 | };
|
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 | const components$1 = [FileUploadLoaderComponent, ViewUploadLoaderComponent];
|
4097 | class SimulatorLoaderModule {
|
4098 | }
|
4099 | SimulatorLoaderModule.decorators = [
|
4100 | { type: NgModule, args: [{
|
4101 | imports: [
|
4102 | CommonModule
|
4103 | ],
|
4104 | declarations: [components$1],
|
4105 | providers: [GlobalsService],
|
4106 | exports: [components$1]
|
4107 | },] },
|
4108 | ];
|
4109 |
|
4110 |
|
4111 |
|
4112 |
|
4113 |
|
4114 |
|
4115 |
|
4116 |
|
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 | export { AcrAssistSimulatorModule, SimulatorLoaderModule, AcrAssistSimulatorComponent as ɵc, AssistChoiceElementComponent as ɵo, AssistDataElementComponent as ɵl, AssistMultiChoiceElementComponent as ɵp, AssistNumericElementComponent as ɵn, HintDiagramComponent as ɵm, ImageMapComponent as ɵq, AssistReportTextComponent as ɵr, CreationServiceInjectorToken as ɵe, ArrayCheckerService as ɵg, ChoiceDataElementCreationService as ɵs, ComputedDataElementCreationService as ɵx, ComputedValueCreationService as ɵk, ConditionsCreationService as ɵj, DataElementCreationBaseService as ɵh, DecisionPointsCreationService as ɵi, DiagramService as ɵf, GlobalValueCreationService as ɵw, IntegerDataElementCreationService as ɵv, MultipleChoiceDataElementCreationService as ɵt, NumericDataElementCreationService as ɵu, TemplateManagerService as ɵd, CoreModule as ɵa, SimulatorEngineService as ɵb, FileUploadLoaderComponent as ɵy, GlobalsService as ɵz, ViewUploadLoaderComponent as ɵba };
|
4124 |
|