emsi-lib
Version:
A EMSI (Emergency Management Shared Information) object model to manipulate emergency messages defined in ISO/TR 22351 document
47 lines (46 loc) • 1.41 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Informations = void 0;
const default_1 = require("../../common/default");
const types_1 = require("../../common/types");
class Informations extends default_1.Default {
constructor(status) {
super();
this.status = status;
}
setTriage(triage) {
this.triage = triage;
return this;
}
setContamination(contamination) {
this.contamination = contamination;
return this;
}
setLocation(location) {
this.location = location;
return this;
}
setHealth(health) {
this.health = health;
return this;
}
static default() {
return new Informations(types_1.CasualtiesStatus.UNKNOWN);
}
assign(source) {
let key;
const keys = Object.keys(source);
if ((key = keys.find(f => f === 'status')))
this.status = source[key];
if ((key = keys.find(f => f === 'triage')))
this.triage = source[key];
if ((key = keys.find(f => f === 'contamination')))
this.contamination = source[key];
if ((key = keys.find(f => f === 'location')))
this.location = source[key];
if ((key = keys.find(f => f === 'health')))
this.health = source[key];
return this;
}
}
exports.Informations = Informations;
;