"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Service = void 0;
const Content_1 = require("./Content");
const ISO639_1_1 = require("./ISO639_1");
/**
 * This entity represents a Service. A Service is created in the course a contact. Services include subjective information provided by the patient, such as complaints, reason for visit, feelings, etc. or objective information like bio-metric measures (blood pressure, temperature, heart beat, etc.), or physical exam description, diagnosis, prescription, integration of lab reports from another healthcare party, action plan, etc. Any action performed by the healthcare party which is relevant for the healthcare element of a patient is considered a service. The services can be linked to healthcare elements or other structuring elements of the medical record
 */
class Service {
    constructor(json) {
        Object.assign(this, json);
        if (!!this.content) {
            const uppercasedIso639_1 = ISO639_1_1.ISO639_1_VALUES_ARRAY.map((e) => e.toUpperCase());
            this.content = Object.fromEntries(Object.entries(this.content).map(([key, value]) => {
                const isUppercasedIso = uppercasedIso639_1.includes(key);
                let contentKey = key;
                if (isUppercasedIso) {
                    contentKey = key.toLowerCase();
                }
                return [contentKey, new Content_1.Content(value)];
            }));
        }
    }
}
exports.Service = Service;
//# sourceMappingURL=Service.js.map