/**
 * @fileoverview added by tsickle
 * Generated from: lib/fhir/care-plan/details/care-plan-details.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component, EventEmitter, Output, Input } from '@angular/core';
import { AbstractDetailsComponent } from '../../../shared/abstracts/details/abstract-details/abstract-details.component';
import { ActionSheetController } from '@ionic/angular';
import { TranslatePipe } from '../../../shared/translate/pipes/translate.pipe';
export class CarePlanDetailsComponent extends AbstractDetailsComponent {
    /**
     * @param {?} actionSheetController
     * @param {?} translatePipe
     */
    constructor(actionSheetController, translatePipe) {
        super();
        this.actionSheetController = actionSheetController;
        this.translatePipe = translatePipe;
        this.callAdd = new EventEmitter();
        this.callUpdate = new EventEmitter();
        this.callDelete = new EventEmitter();
    }
    /**
     * @param {?} componentName
     * @param {?=} modalType
     * @return {?}
     */
    add(componentName, modalType) {
        this.callAdd.emit({ componentName, modalType });
    }
    /**
     * @param {?} componentName
     * @param {?} data
     * @return {?}
     */
    delete(componentName, data) {
        this.callDelete.emit({ componentName, data });
    }
    /**
     * @param {?} componentName
     * @param {?} event
     * @return {?}
     */
    update(componentName, event) {
        this.callUpdate.emit({ componentName, data: event.data, modalType: event.modalType });
    }
    /**
     * @return {?}
     */
    openActionSheet() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            /** @type {?} */
            const actionSheet = yield this.actionSheetController.create({
                buttons: [{
                        text: this.translatePipe.transform('CUSTOM_ALERT'),
                        icon: 'stats',
                        handler: (/**
                         * @return {?}
                         */
                        () => { this.add('supportingInfo', 'atomic'); })
                    },
                    {
                        text: this.translatePipe.transform('TIME_SERIES_ALERT'),
                        icon: 'clock',
                        handler: (/**
                         * @return {?}
                         */
                        () => { this.add('supportingInfo', 'aggregated'); })
                    }]
            });
            yield actionSheet.present();
        });
    }
}
CarePlanDetailsComponent.decorators = [
    { type: Component, args: [{
                selector: 'inc-care-plan-details',
                template: "<ion-grid *ngIf=\"inData\" class=\"ion-padding\">\r\n  <ion-row class=\"ion-align-items-center\">\r\n    <ion-col size-md=\"6\">\r\n      <ion-item lines=\"none\" class=\"ion-no-padding\">\r\n        <ion-badge color=\"light\" slot=\"start\" *ngIf=\"inData.category && inData.category[0]\" class=\"ion-padding\"\r\n          style=\"min-width: 100px;\">\r\n          {{inData.category[0].text | uppercase | translate}}\r\n        </ion-badge>\r\n        <ion-label *ngIf=\"inData.author\">\r\n          <ion-text *ngIf=\"inData.created\">\r\n            <p>{{inData.created | date:'yyyy.MM.dd'}}</p>\r\n          </ion-text>\r\n          {{inData.author.display}}\r\n        </ion-label>\r\n      </ion-item>\r\n    </ion-col>\r\n    <ion-col size-md=\"6\" style=\"display: flex; justify-content: flex-end;\">\r\n      <ion-buttons>\r\n        <ion-button (click)=\"more()\">\r\n          <ion-icon name=\"more\"></ion-icon>\r\n        </ion-button>\r\n      </ion-buttons>\r\n    </ion-col>\r\n    <ion-item-divider *ngIf=\"inData.title\">\r\n      <ion-text color=\"primary\">\r\n        <h4>{{inData.title}}</h4>\r\n      </ion-text>\r\n    </ion-item-divider>\r\n    <ion-col size=\"12\">\r\n      <ion-button color=\"secondary\" fill=\"outline\" class=\"ion-margin-end\" (click)=\"add('goal')\">\r\n        <ion-icon name=\"add\"></ion-icon>\r\n        &nbsp;{{'GOAL_VALUE' | translate}}\r\n      </ion-button>\r\n      <ion-button color=\"secondary\" fill=\"outline\" (click)=\"modalType ? add('supportingInfo', modalType) : openActionSheet()\">\r\n        <ion-icon name=\"add\"></ion-icon>\r\n        &nbsp;{{'ALERT' | translate}}\r\n      </ion-button>\r\n    </ion-col>\r\n  </ion-row>\r\n</ion-grid>\r\n<mat-accordion multi=\"true\">\r\n  <mat-expansion-panel style=\"box-shadow: none\" *ngIf=\"inData.goal && inData.goal.length > 0\">\r\n    <mat-expansion-panel-header>\r\n      <mat-panel-title>\r\n        <ion-text color=\"primary\">\r\n          <h5><b>{{'GOALS' | translate}}</b></h5>\r\n        </ion-text>\r\n      </mat-panel-title>\r\n    </mat-expansion-panel-header>\r\n    <div>\r\n      <inc-goal-details [inData]=\"inData.goal\" \r\n        (callUpdate)=\"update('goal', $event)\" (callDelete)=\"delete('goal', $event)\">\r\n      </inc-goal-details>\r\n    </div>\r\n  </mat-expansion-panel>\r\n  <mat-expansion-panel style=\"box-shadow: none\" *ngIf=\"inData.supportingInfo && inData.supportingInfo.length > 0\">\r\n    <mat-expansion-panel-header> \r\n      <mat-panel-title>\r\n        <ion-text color=\"primary\">\r\n          <h5><b>{{'ALERTS' | translate}}</b></h5>\r\n        </ion-text>\r\n      </mat-panel-title>\r\n    </mat-expansion-panel-header>\r\n    <div>\r\n      <inc-observation-definition-details [inData]=\"inData.supportingInfo\"\r\n        (callUpdate)=\"update('supportingInfo', $event)\" (callDelete)=\"delete('supportingInfo', $event)\">\r\n      </inc-observation-definition-details>\r\n    </div>\r\n  </mat-expansion-panel>\r\n</mat-accordion>",
                styles: [""]
            }] }
];
/** @nocollapse */
CarePlanDetailsComponent.ctorParameters = () => [
    { type: ActionSheetController },
    { type: TranslatePipe }
];
CarePlanDetailsComponent.propDecorators = {
    modalType: [{ type: Input }],
    callAdd: [{ type: Output }],
    callUpdate: [{ type: Output }],
    callDelete: [{ type: Output }]
};
if (false) {
    /** @type {?} */
    CarePlanDetailsComponent.prototype.modalType;
    /** @type {?} */
    CarePlanDetailsComponent.prototype.callAdd;
    /** @type {?} */
    CarePlanDetailsComponent.prototype.callUpdate;
    /** @type {?} */
    CarePlanDetailsComponent.prototype.callDelete;
    /**
     * @type {?}
     * @private
     */
    CarePlanDetailsComponent.prototype.actionSheetController;
    /**
     * @type {?}
     * @private
     */
    CarePlanDetailsComponent.prototype.translatePipe;
}
//# sourceMappingURL=data:application/json;base64, 