/**
 * @fileoverview added by tsickle
 * Generated from: lib/fhir/alert/details/alert-details.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component } from '@angular/core';
import { AlertDecourseDetailsComponent } from '../../../shared/abstracts/alert-decourse-details/alert-decourse-details.component';
var AlertDetailsComponent = /** @class */ (function (_super) {
    tslib_1.__extends(AlertDetailsComponent, _super);
    function AlertDetailsComponent() {
        return _super.call(this) || this;
    }
    /**
     * @return {?}
     */
    AlertDetailsComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () { _super.prototype.ngOnInit.call(this); };
    /**
     * @param {?} comment
     * @return {?}
     */
    AlertDetailsComponent.prototype.onCallSaveComment = /**
     * @param {?} comment
     * @return {?}
     */
    function (comment) {
        this.inData.note.push(comment);
        this.callCommentSaveAndUpdate.emit(this.inData);
    };
    /**
     * @param {?} comment
     * @return {?}
     */
    AlertDetailsComponent.prototype.onCallUpdateComment = /**
     * @param {?} comment
     * @return {?}
     */
    function (comment) {
        this.inData.note[this.commentUpdateId] = comment;
        this.callCommentSaveAndUpdate.emit(this.inData);
    };
    /**
     * @return {?}
     */
    AlertDetailsComponent.prototype.onCallCancelComment = /**
     * @return {?}
     */
    function () { this.callCancelComment.emit(); };
    /**
     * @param {?} comment
     * @return {?}
     */
    AlertDetailsComponent.prototype.onCallCommentMore = /**
     * @param {?} comment
     * @return {?}
     */
    function (comment) {
        this.callCommentMore.emit({
            component: this.inData,
            index: this.inData.note.indexOf(comment)
        });
    };
    /**
     * @param {?} comment
     * @return {?}
     */
    AlertDetailsComponent.prototype.onCallSaveAndApprove = /**
     * @param {?} comment
     * @return {?}
     */
    function (comment) {
        if (!this.inData.note) {
            this.inData.note = [];
        }
        this.inData.note.push(comment);
        this.inData.status = 'completed';
        this.callCommentSaveAndUpdate.emit(this.inData);
    };
    /**
     * @return {?}
     */
    AlertDetailsComponent.prototype.getAlertType = /**
     * @return {?}
     */
    function () {
        if (this.inData.reasonReference.length &&
            (this.inData.reasonReference[0].reference === '' || this.inData.reasonReference[0].reference === 'undefined')) {
            return this.inData.reasonReference[0].display;
        }
        return '';
    };
    /**
     * @return {?}
     */
    AlertDetailsComponent.prototype.getCategoryText = /**
     * @return {?}
     */
    function () {
        if (this.inData && this.inData.category && this.inData.category.length > 0 && this.inData.category[0].text) {
            return this.inData.category[0].text;
        }
    };
    AlertDetailsComponent.decorators = [
        { type: Component, args: [{
                    selector: 'inc-alert-details',
                    template: "<ion-grid>\r\n  <ion-row>\r\n    <ion-col size=\"11\">\r\n      <ion-row>\r\n        <ion-col size=\"12\" style=\"display: flex;\">\r\n          <span>\r\n            {{inData.sent || '' | date: 'yyyy.MM.dd HH:mm:ss' }}\r\n          </span>\r\n        </ion-col>\r\n      </ion-row>\r\n    </ion-col>\r\n    <ion-col size=\"12\">\r\n      <h2>\r\n        {{getAlertType() | uppercase | translate}}\r\n      </h2>\r\n    </ion-col>\r\n  </ion-row>\r\n  <ion-row>\r\n    <ion-col size=\"12\">\r\n      <h2>\r\n        {{getCategoryText() | uppercase | translate}}\r\n      </h2>\r\n    </ion-col>\r\n  </ion-row>\r\n  <ion-row class=\"divide\"></ion-row>\r\n  <ion-row>\r\n    <ion-col size=\"12\" class=\"ion-no-padding\">\r\n      <ion-button id=\"alert-comment-add-button\" fill=\"clear\" (click)=\"commentsSwitcher()\" expand=\"block\">\r\n        <!-- <ion-icon name=\"text\"></ion-icon> &nbsp; -->\r\n        <ion-icon [name]=\"iconName\"></ion-icon> &nbsp;\r\n        {{('COMMENT2' | translate) + '&nbsp;'  + '(' + (inData.note && inData.note[0] ? inData.note.length : 0) + ')'}}\r\n      </ion-button>\r\n    </ion-col>\r\n  </ion-row>\r\n  <ion-row class=\"divide\"></ion-row>\r\n  <div *ngIf=\"postIsOpened\">\r\n    <ion-row *ngIf=\"!commentUpdateId\">\r\n      <inc-alert-comment-add style=\"width: 100%;\" [user]=\"user\" (callSave)=\"onCallSaveComment($event)\"\r\n        (callSaveAndApprove)=\"onCallSaveAndApprove($event)\">\r\n      </inc-alert-comment-add>\r\n    </ion-row>\r\n    <div *ngFor=\"let note of inData.note; let i = index\">\r\n      <ion-row>\r\n        <ion-col size=\"12\">\r\n          <div *ngIf=\"i === commentUpdateId; else notCommentUpdate\">\r\n            <inc-alert-comment-add [inData]=\"note\" [user]=\"user\" (callUpdate)=\"onCallUpdateComment($event)\"\r\n              (callCancel)=\"onCallCancelComment()\">\r\n            </inc-alert-comment-add>\r\n          </div>\r\n          <ng-template #notCommentUpdate>\r\n            <inc-alert-comment-details [inData]=\"note\" [user]=\"user\" (callMore)=\"onCallCommentMore($event)\">\r\n            </inc-alert-comment-details>\r\n          </ng-template>\r\n        </ion-col>\r\n      </ion-row>\r\n    </div>\r\n  </div>\r\n</ion-grid>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    AlertDetailsComponent.ctorParameters = function () { return []; };
    return AlertDetailsComponent;
}(AlertDecourseDetailsComponent));
export { AlertDetailsComponent };
//# sourceMappingURL=data:application/json;base64, 