/**
 * @fileoverview added by tsickle
 * Generated from: lib/fhir/device/add/device-add.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
import { FormGroup, FormControl, Validators, FormArray } from '@angular/forms';
import { AbstractAddComponent } from '../../../shared/abstracts/add/abstract-add/abstract-add.component';
/** @type {?} */
export const DEVICE_DATA_LIST = [
    { label: 'SERIALNUMBER', value: 'serialNumber', autofocus: false, size: '6', required: false },
    { label: 'MANUFACTURER', value: 'manufacturer', autofocus: false, size: '4', required: true },
    { label: 'MODELL', value: 'modelNumber', autofocus: false, size: '4', required: true },
];
/** @type {?} */
export const STATUS_LIST = [
    { label: 'STATUS_AVAILABLE', value: 'active' },
    { label: 'STATUS_INACTIVE', value: 'inactive' }, { label: 'STATUS_ERROR', value: 'entered-in-error' },
    { label: 'STATUS_UNKNOWN', value: 'unknown' }
];
export class DeviceAddComponent extends AbstractAddComponent {
    constructor() {
        super();
        this.deviceDataList = DEVICE_DATA_LIST;
        this.statusList = STATUS_LIST;
    }
    /**
     * @return {?}
     */
    resetForm() {
        return new FormGroup({
            id: new FormControl(),
            identifier: new FormArray([
                new FormGroup({
                    value: new FormControl('', Validators.required)
                })
            ]),
            serialNumber: new FormControl(''),
            manufacturer: new FormControl('', Validators.required),
            modelNumber: new FormControl('', Validators.required),
            meta: new FormGroup({
                lastUpdated: new FormControl(new Date())
            }),
            type: new FormGroup({
                text: new FormControl('ACCESSORY', Validators.required),
                coding: new FormControl('')
            }),
            status: new FormControl('active', Validators.required),
            note: new FormArray([
                new FormGroup({
                    authorReference: new FormGroup({
                        reference: new FormControl(''),
                        display: new FormControl('')
                    }),
                    text: new FormControl(''),
                    time: new FormControl(new Date())
                })
            ]),
            patient: new FormGroup({
                reference: new FormControl(''),
                display: new FormControl('')
            }),
            owner: new FormGroup({
                reference: new FormControl(''),
                display: new FormControl('')
            }),
        });
    }
}
DeviceAddComponent.decorators = [
    { type: Component, args: [{
                selector: 'inc-device-add',
                template: "<form [formGroup]=\"form\" (ngSubmit)=\"save(form.value)\">\r\n  <ion-grid class=\"ion-padding\">\r\n    <ion-row>\r\n      <ion-col size=\"12\" size-md=\"6\" formArrayName=\"identifier\">\r\n        <ion-item formGroupName=\"0\">\r\n          <ion-label position=\"floating\">{{'INVENTORY_ID' | translate}}\r\n            <span class=\"required\">*</span>\r\n          </ion-label>\r\n          <ion-input type=\"text\" id=\"device-id\" autofocus clearInput formControlName=\"value\">\r\n          </ion-input>\r\n        </ion-item>\r\n      </ion-col>\r\n      <ion-col size=\"12\" sizeMd=\"{{deviceDataListElement.size}}\" *ngFor=\"let deviceDataListElement of deviceDataList\">\r\n        <ion-item>\r\n          <ion-label position=\"floating\">{{deviceDataListElement.label | translate}}\r\n            <span *ngIf=\"deviceDataListElement.required\" class=\"required\">*</span>\r\n          </ion-label>\r\n          <ion-input type=\"text\" id=\"device-{{deviceDataListElement.value}}\"\r\n            formControlName=\"{{deviceDataListElement.value}}\" clearInput>\r\n          </ion-input>\r\n        </ion-item>\r\n      </ion-col>\r\n      <ion-col size=\"12\" size-md=\"4\" formGroupName=\"type\">\r\n        <ion-item class=\"item-select\">\r\n          <ion-label position=\"floating\">{{'TYPE' | translate}}\r\n            <span class=\"required\">*</span>\r\n          </ion-label>\r\n          <ion-select placeholder=\"{{'TYPE' | translate}}*\" id=\"device-type-select\" class=\"ion-text-capitalize\"\r\n            interface=\"popover\" formControlName=\"text\">\r\n            <ion-select-option *ngFor=\"let type of typeList\" id=\"device-type-option\" value=\"{{type.value}}\">\r\n              {{type.label | translate}}\r\n            </ion-select-option>\r\n          </ion-select>\r\n        </ion-item>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row>\r\n      <ion-col formArrayName=\"note\">\r\n        <ion-item formGroupName=\"0\">\r\n          <ion-label color=\"primary\">{{'DESCRIPTION' | translate}}</ion-label>\r\n          <ion-textarea id=\"device-note\" rows=\"3\" auto-grow=\"true\" formControlName=\"text\">\r\n          </ion-textarea>\r\n        </ion-item>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row class=\"ion-margin-top ion-margin-bottom\">\r\n      <ion-col>\r\n        <ion-radio-group class=\"radio-hor\" formControlName=\"status\">\r\n          <ion-item *ngFor=\"let status of statusList\" lines=\"none\">\r\n            <ion-label>{{status.label | translate}}</ion-label>\r\n            <ion-radio slot=\"start\" value=\"{{status.value}}\" id=\"device-status-{{status.value}}\" color=\"secondary\"\r\n              disabled>\r\n            </ion-radio>\r\n          </ion-item>\r\n        </ion-radio-group>\r\n      </ion-col>\r\n    </ion-row>\r\n    <ion-row class=\"ion-float-right ion-margin-bottom\">\r\n      <ion-button fill=\"outline\" color=\"primary\" id=\"cancelBtn\" *ngIf=\"inData\" (click)=\"discard()\"\r\n        class=\"ion-margin-end\">\r\n        <ion-icon slot=\"start\" name=\"close\"></ion-icon>{{'REJECT_BUTTON' | translate}}\r\n      </ion-button>\r\n      <ion-button fill=\"outline\" *ngIf=\"!inData\" color=\"primary\" id=\"resetBtn\" (click)=\"reset()\" class=\"ion-margin-end\">\r\n        <ion-icon slot=\"start\" name=\"refresh\"></ion-icon>{{'AGAIN_BUTTON' | translate}}\r\n      </ion-button>\r\n      <ion-button id=\"submitBtn\" type=\"submit\" [disabled]=\"form.invalid\">\r\n        <ion-icon slot=\"start\" name=\"save\"></ion-icon>{{'SAVE_BUTTON' | translate}}\r\n      </ion-button>\r\n    </ion-row>\r\n  </ion-grid>\r\n</form>",
                styles: [".item-select{height:56px;display:flex}textarea{min-height:56px}::ng-deep ion-select-popover{background-color:#fff}::ng-deep ion-select-popover ion-item{--inner-border-width:0}@media (min-width:768px){.radio-hor{display:flex;flex-direction:row}}"]
            }] }
];
/** @nocollapse */
DeviceAddComponent.ctorParameters = () => [];
DeviceAddComponent.propDecorators = {
    typeList: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    DeviceAddComponent.prototype.deviceDataList;
    /** @type {?} */
    DeviceAddComponent.prototype.statusList;
    /** @type {?} */
    DeviceAddComponent.prototype.typeList;
}
//# sourceMappingURL=data:application/json;base64, 