Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

import { Component, OnInit } from '@angular/core';
import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
import { AllergyExt } from '../../models/patientModels';

/**
* Allergy Component - displays detailed allergy information in an ng-bootstrap modal
*/
@Component({
selector: 'app-allergy',
templateUrl: './allergy.component.html',
styleUrls: ['./allergy.component.css']
})

export class AllergyComponent implements OnInit {

/**
* Allergy detail record to display
*/
data: AllergyExt[];

/** property used for ngx-pagination */
p;

/**
*
* @param activeModal The currently active modal to display this component within
*/
constructor(public activeModal: NgbActiveModal) {}

ngOnInit() {
}

getMechanism(datum: AllergyExt): string {
const rtn = (datum.reactions[0] && datum.reactions[0].mechanism) ? datum.reactions[0].mechanism : 'UNKNOWN';
return RegExp('pharmacologic', 'i').test(rtn) ? 'ADVERSE REACTION' : rtn;
}

/**
* closes the current modal window
*/
cancel() {
this.activeModal.close();
}

}