/**
 * @fileoverview added by tsickle
 * Generated from: lib/fhir/care-plan/therapy-discontinuation/therapy-discontinuation.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import { ModalController } from '@ionic/angular';
/** @type {?} */
export var CAUSES = [
    'THERAPY_ACHIEVED', 'PATIENT_DECEASED', 'MORE_MONITORING_IMPOSSIBLE',
    'FOR_PATIENT_REQUEST', 'HOSPITALIZATION', 'OTHER'
];
var TherapyDiscontinuationComponent = /** @class */ (function () {
    function TherapyDiscontinuationComponent(modalController) {
        this.modalController = modalController;
        this.title = 'THERAPY_TERMINATION';
        this.causes = CAUSES;
    }
    /**
     * @return {?}
     */
    TherapyDiscontinuationComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        this.reset();
    };
    /**
     * @return {?}
     */
    TherapyDiscontinuationComponent.prototype.close = /**
     * @return {?}
     */
    function () {
        this.modalController.dismiss();
    };
    /**
     * @return {?}
     */
    TherapyDiscontinuationComponent.prototype.reset = /**
     * @return {?}
     */
    function () {
        this.therapyDiscontinuationForm = this.resetForm();
    };
    /**
     * @return {?}
     */
    TherapyDiscontinuationComponent.prototype.resetForm = /**
     * @return {?}
     */
    function () {
        return new FormGroup({
            causes: new FormControl(''),
            comments: new FormControl('')
        });
    };
    /**
     * @return {?}
     */
    TherapyDiscontinuationComponent.prototype.save = /**
     * @return {?}
     */
    function () {
        this.modalController.dismiss({ value: { therapyTermination: this.therapyDiscontinuationForm.value } });
    };
    /**
     * @return {?}
     */
    TherapyDiscontinuationComponent.prototype.resetSelect = /**
     * @return {?}
     */
    function () {
        this.therapyDiscontinuationForm.controls.causes.reset();
    };
    TherapyDiscontinuationComponent.decorators = [
        { type: Component, args: [{
                    selector: 'inc-therapy-discontinuation',
                    template: "<inc-modal-header label=\"{{title | translate}}\"></inc-modal-header>\r\n<ion-content class=\"ion-padding\">\r\n  <form [formGroup]=\"therapyDiscontinuationForm\" (ngSubmit)=\"save()\">\r\n    <ion-row>\r\n      <ion-col size=\"12\">\r\n        <mat-form-field style=\"width: 100%;\">\r\n          <mat-label>{{'CAUSE' | translate}}</mat-label>\r\n          <mat-select formControlName=\"causes\" required>\r\n            <mat-option *ngFor=\"let cause of causes\" [value]=\"cause\">{{cause | translate}}\r\n            </mat-option>\r\n          </mat-select>\r\n        </mat-form-field>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row>\r\n      <ion-col>\r\n        <ion-item>\r\n          <ion-label position=\"floating\" color=\"primary\">{{'COMMENT' | translate}}</ion-label>\r\n          <ion-textarea id=\"appointment-desc\" rows=\"3\" auto-grow=\"true\" formControlName=\"comments\">\r\n          </ion-textarea>\r\n        </ion-item>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row>\r\n      <ion-col size=\"6\" size-md=\"3\" offset-md=\"6\">\r\n        <ion-button id=\"cancel-button\" fill=\"clear\" color=\"primary\" (click)=\"close()\" expand=\"block\">\r\n          {{'CANCEL_BUTTON' | translate}}\r\n        </ion-button>\r\n      </ion-col>\r\n      <ion-col size=\"6\" size-md=\"3\">\r\n        <ion-button id=\"save-button\" color=\"primary\" type=\"submit\" [disabled]=\"therapyDiscontinuationForm.invalid\"\r\n          expand=\"block\">\r\n          {{'SAVE_BUTTON' | translate}}\r\n        </ion-button>\r\n      </ion-col>\r\n    </ion-row>\r\n  </form>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    TherapyDiscontinuationComponent.ctorParameters = function () { return [
        { type: ModalController }
    ]; };
    return TherapyDiscontinuationComponent;
}());
export { TherapyDiscontinuationComponent };
if (false) {
    /** @type {?} */
    TherapyDiscontinuationComponent.prototype.title;
    /** @type {?} */
    TherapyDiscontinuationComponent.prototype.therapyDiscontinuationForm;
    /** @type {?} */
    TherapyDiscontinuationComponent.prototype.causes;
    /**
     * @type {?}
     * @private
     */
    TherapyDiscontinuationComponent.prototype.modalController;
}
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