/**
 * @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 const CAUSES = [
    'THERAPY_ACHIEVED', 'PATIENT_DECEASED', 'MORE_MONITORING_IMPOSSIBLE',
    'FOR_PATIENT_REQUEST', 'HOSPITALIZATION', 'OTHER'
];
export class TherapyDiscontinuationComponent {
    /**
     * @param {?} modalController
     */
    constructor(modalController) {
        this.modalController = modalController;
        this.title = 'THERAPY_TERMINATION';
        this.causes = CAUSES;
    }
    /**
     * @return {?}
     */
    ngOnInit() {
        this.reset();
    }
    /**
     * @return {?}
     */
    close() {
        this.modalController.dismiss();
    }
    /**
     * @return {?}
     */
    reset() {
        this.therapyDiscontinuationForm = this.resetForm();
    }
    /**
     * @return {?}
     */
    resetForm() {
        return new FormGroup({
            causes: new FormControl(''),
            comments: new FormControl('')
        });
    }
    /**
     * @return {?}
     */
    save() {
        this.modalController.dismiss({ value: { therapyTermination: this.therapyDiscontinuationForm.value } });
    }
    /**
     * @return {?}
     */
    resetSelect() {
        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 = () => [
    { type: ModalController }
];
if (false) {
    /** @type {?} */
    TherapyDiscontinuationComponent.prototype.title;
    /** @type {?} */
    TherapyDiscontinuationComponent.prototype.therapyDiscontinuationForm;
    /** @type {?} */
    TherapyDiscontinuationComponent.prototype.causes;
    /**
     * @type {?}
     * @private
     */
    TherapyDiscontinuationComponent.prototype.modalController;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlcmFweS1kaXNjb250aW51YXRpb24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGluY2xvdWRlZC9pb25pYzQtaW5jbG91ZGVkLWxpYi8iLCJzb3VyY2VzIjpbImxpYi9maGlyL2NhcmUtcGxhbi90aGVyYXB5LWRpc2NvbnRpbnVhdGlvbi90aGVyYXB5LWRpc2NvbnRpbnVhdGlvbi5jb21wb25lbnQud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