"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get DEFAULT_REASON_CANCELLED_BY_API () {
        return DEFAULT_REASON_CANCELLED_BY_API;
    },
    get FHIR_BUNDLE_TYPES () {
        return FHIR_BUNDLE_TYPES;
    },
    get FHIR_DATETIME_PRECISION () {
        return FHIR_DATETIME_PRECISION;
    },
    get FHIR_DIAGNOSTIC_REPORT_STATUS () {
        return FHIR_DIAGNOSTIC_REPORT_STATUS;
    },
    get FHIR_ENCOUNTER_CLASS_CODE () {
        return FHIR_ENCOUNTER_CLASS_CODE;
    },
    get FHIR_ENCOUNTER_CLASS_DISPLAY () {
        return FHIR_ENCOUNTER_CLASS_DISPLAY;
    },
    get FHIR_ENCOUNTER_LOCATION_STATUS () {
        return FHIR_ENCOUNTER_LOCATION_STATUS;
    },
    get FHIR_ENCOUNTER_STATUS () {
        return FHIR_ENCOUNTER_STATUS;
    },
    get FHIR_IMAGING_STUDY_STATUS () {
        return FHIR_IMAGING_STUDY_STATUS;
    },
    get FHIR_INTEGRATION_PERMISSIONS () {
        return FHIR_INTEGRATION_PERMISSIONS;
    },
    get FHIR_INTEGRATION_VERB () {
        return FHIR_INTEGRATION_VERB;
    },
    get FHIR_INTERACTIONS () {
        return FHIR_INTERACTIONS;
    },
    get FHIR_ISSUE_SEVERITY () {
        return FHIR_ISSUE_SEVERITY;
    },
    get FHIR_ISSUE_TYPE () {
        return FHIR_ISSUE_TYPE;
    },
    get FHIR_LOCATION_PHYSICAL_TYPE_CODE () {
        return FHIR_LOCATION_PHYSICAL_TYPE_CODE;
    },
    get FHIR_LOCATION_PHYSICAL_TYPE_DISPLAY () {
        return FHIR_LOCATION_PHYSICAL_TYPE_DISPLAY;
    },
    get FHIR_MAX_RESOURCES_PER_PAGE () {
        return FHIR_MAX_RESOURCES_PER_PAGE;
    },
    get FHIR_OBSERVATION_STATUS () {
        return FHIR_OBSERVATION_STATUS;
    },
    get FHIR_PATIENT_LINK_TYPES () {
        return FHIR_PATIENT_LINK_TYPES;
    },
    get FHIR_PERMISSION_NOUNS () {
        return FHIR_PERMISSION_NOUNS;
    },
    get FHIR_REQUEST_INTENT () {
        return FHIR_REQUEST_INTENT;
    },
    get FHIR_REQUEST_PRIORITY () {
        return FHIR_REQUEST_PRIORITY;
    },
    get FHIR_REQUEST_STATUS () {
        return FHIR_REQUEST_STATUS;
    },
    get FHIR_RESOURCE_TO_PERMISSION_NOUN () {
        return FHIR_RESOURCE_TO_PERMISSION_NOUN;
    },
    get FHIR_RESOURCE_TYPES () {
        return FHIR_RESOURCE_TYPES;
    },
    get FHIR_SEARCH_PARAMETERS () {
        return FHIR_SEARCH_PARAMETERS;
    },
    get FHIR_SEARCH_PREFIXES () {
        return FHIR_SEARCH_PREFIXES;
    },
    get FHIR_SEARCH_TOKEN_TYPES () {
        return FHIR_SEARCH_TOKEN_TYPES;
    },
    get HTTP_BODY_DATA_PATHS () {
        return HTTP_BODY_DATA_PATHS;
    },
    get IPS_REQUEST_STATUSES () {
        return IPS_REQUEST_STATUSES;
    },
    get SCRUBBED_DATA_MESSAGE () {
        return SCRUBBED_DATA_MESSAGE;
    },
    get SERVICE_REQUEST_CATEGORY_CODES () {
        return SERVICE_REQUEST_CATEGORY_CODES;
    },
    get SERVICE_REQUEST_PERMISSION_NOUNS () {
        return SERVICE_REQUEST_PERMISSION_NOUNS;
    },
    get SUPPORTED_CONTENT_TYPES () {
        return SUPPORTED_CONTENT_TYPES;
    }
});
const FHIR_INTERACTIONS = {
    INSTANCE: {
        READ: 'resource-read',
        VREAD: 'resource-vread',
        UPDATE: 'resource-update',
        DELETE: 'resource-delete',
        HISTORY: 'resource-history'
    },
    TYPE: {
        CREATE: 'type-create',
        SEARCH: 'type-search',
        HISTORY: 'type-history'
    },
    SYSTEM: {
        CAPABILITIES: 'capabilities',
        TRANSACTION: 'transaction',
        HISTORY: 'system-history',
        SEARCH: 'system-search'
    },
    INTERNAL: {
        MATERIALISE: 'materialise'
    }
};
const FHIR_SEARCH_PARAMETERS = {
    NUMBER: 'number',
    DATE: 'date',
    STRING: 'string',
    TOKEN: 'token',
    REFERENCE: 'reference',
    COMPOSITE: 'composite',
    QUANTITY: 'quantity',
    URI: 'uri',
    SPECIAL: 'special'
};
const FHIR_SEARCH_TOKEN_TYPES = {
    VALUE: 'value',
    CODING: 'coding',
    STRING: 'string',
    BOOLEAN: 'boolean',
    PRESENCE: 'presence'
};
const FHIR_SEARCH_PREFIXES = {
    EQ: 'eq',
    NE: 'ne',
    GT: 'gt',
    LT: 'lt',
    GE: 'ge',
    LE: 'le'
};
const FHIR_PATIENT_LINK_TYPES = {
    REPLACES: 'replaces',
    REPLACED_BY: 'replaced-by',
    SEE_ALSO: 'seealso'
};
const FHIR_MAX_RESOURCES_PER_PAGE = 20;
const FHIR_DATETIME_PRECISION = {
    SECONDS_WITH_TIMEZONE: 's+tz',
    MINUTES_WITH_TIMEZONE: 'm+tz',
    HOURS_WITH_TIMEZONE: 'h+tz',
    SECONDS: 's',
    MINUTES: 'm',
    HOURS: 'h',
    DAYS: 'D',
    MONTHS: 'M',
    YEARS: 'Y'
};
const FHIR_BUNDLE_TYPES = {
    DOCUMENT: 'document',
    MESSAGE: 'message',
    TRANSACTION: 'transaction',
    TRANSACTION_RESPONSE: 'transaction-response',
    BATCH: 'batch',
    BATCH_RESPONSE: 'batch-response',
    HISTORY: 'history',
    SEARCHSET: 'searchset',
    COLLECTION: 'collection'
};
const FHIR_RESOURCE_TYPES = {
    BUNDLE: 'Bundle',
    COMPOSITION: 'Composition',
    PATIENT: 'Patient',
    MEDICATION_STATEMENT: 'MedicationStatement',
    ALLERGY_INTOLERANCE: 'AllergyIntolerance',
    CONDITION: 'Condition',
    IMMUNIZATION: 'Immunization'
};
const FHIR_ISSUE_SEVERITY = {
    INFORMATION: 'information',
    WARNING: 'warning',
    ERROR: 'error',
    FATAL: 'fatal'
};
const FHIR_ISSUE_TYPE = {
    INVALID: {
        _: 'invalid',
        STRUCTURE: 'structure',
        REQUIRED: 'required',
        VALUE: 'value',
        INVARIANT: 'invariant'
    },
    SECURITY: {
        _: 'security',
        LOGIN: 'login',
        UNKNOWN: 'unknown',
        EXPIRED: 'expired',
        FORBIDDEN: 'forbidden',
        SUPPRESSED: 'suppressed'
    },
    PROCESSING: {
        _: 'processing',
        NOT_SUPPORTED: 'not-supported',
        DUPLICATE: 'duplicate',
        MULTIPLE_MATCHES: 'multiple-matches',
        NOT_FOUND: {
            _: 'not-found',
            DELETED: 'deleted'
        },
        TOO_LONG: 'too-long',
        CODE_INVALID: 'code-invalid',
        EXTENSION: 'extension',
        TOO_COSTLY: 'too-costly',
        BUSINESS_RULE: 'business-rule',
        CONFLICT: 'conflict'
    },
    TRANSIENT: {
        _: 'transient',
        LOCK_ERROR: 'lock-error',
        NO_STORE: 'no-store',
        EXCEPTION: 'exception',
        TIMEOUT: 'timeout',
        INCOMPLETE: 'incomplete',
        THROTTLED: 'throttled'
    },
    INFORMATIONAL: 'informational'
};
const FHIR_REQUEST_STATUS = {
    DRAFT: 'draft',
    ACTIVE: 'active',
    ON_HOLD: 'on-hold',
    REVOKED: 'revoked',
    COMPLETED: 'completed',
    ENTERED_IN_ERROR: 'entered-in-error',
    UNKNOWN: 'unknown'
};
const FHIR_REQUEST_INTENT = {
    PROPOSAL: 'proposal',
    PLAN: 'plan',
    DIRECTIVE: 'directive',
    ORDER: {
        _: 'order',
        ORIGINAL: 'original-order',
        REFLEX: 'reflex-order',
        FILLER: {
            _: 'filler-order',
            INSTANCE: 'instance-order'
        }
    },
    OPTION: 'option'
};
const FHIR_REQUEST_PRIORITY = {
    ROUTINE: 'routine',
    URGENT: 'urgent',
    ASAP: 'asap',
    STAT: 'stat'
};
const FHIR_DIAGNOSTIC_REPORT_STATUS = {
    REGISTERED: 'registered',
    PARTIAL: {
        _: 'partial',
        PRELIMINARY: 'preliminary',
        MODIFIED: 'modified'
    },
    FINAL: 'final',
    AMENDED: {
        _: 'amended',
        CORRECTED: 'corrected',
        APPENDED: 'appended'
    },
    CANCELLED: 'cancelled',
    ENTERED_IN_ERROR: 'entered-in-error',
    UNKNOWN: 'unknown'
};
const FHIR_IMAGING_STUDY_STATUS = {
    REGISTERED: 'registered',
    AVAILABLE: 'available',
    FINAL_INVALID_LEGACY: 'final',
    CANCELLED: 'cancelled',
    ENTERED_IN_ERROR: 'entered-in-error',
    UNKNOWN: 'unknown'
};
const FHIR_OBSERVATION_STATUS = {
    REGISTERED: 'registered',
    PRELIMINARY: 'preliminary',
    FINAL: 'final',
    AMENDED: 'amended'
};
const FHIR_ENCOUNTER_CLASS_DISPLAY = {
    IMP: 'inpatient encounter',
    AMB: 'ambulatory encounter',
    OBSENC: 'observation encounter',
    EMER: 'emergency',
    HH: 'home health',
    VR: 'virtual'
};
const FHIR_ENCOUNTER_CLASS_CODE = Object.fromEntries(Object.keys(FHIR_ENCOUNTER_CLASS_DISPLAY).map((k)=>[
        k,
        k
    ]));
const FHIR_ENCOUNTER_STATUS = {
    PLANNED: 'planned',
    IN_PROGRESS: 'in-progress',
    ON_HOLD: 'on-hold',
    DISCHARGED: 'discharged',
    COMPLETED: 'completed',
    CANCELLED: 'cancelled',
    DISCONTINUED: 'discontinued',
    ENTERED_IN_ERROR: 'entered-in-error',
    UNKNOWN: 'unknown'
};
const FHIR_ENCOUNTER_LOCATION_STATUS = {
    PLANNED: 'planned',
    ACTIVE: 'active',
    RESERVED: 'reserved',
    COMPLETED: 'completed'
};
const FHIR_LOCATION_PHYSICAL_TYPE_CODE = {
    SITE: 'si',
    BUILDING: 'bu',
    WING: 'wi',
    WARD: 'wa',
    LEVEL: 'lvl',
    CORRIDOR: 'co',
    ROOM: 'ro',
    BED: 'bd',
    VEHICLE: 've',
    HOUSE: 'ho',
    CABINET: 'ca',
    ROAD: 'rd',
    AREA: 'area',
    JURISDICTION: 'jdn',
    VIRTUAL: 'vi'
};
const FHIR_LOCATION_PHYSICAL_TYPE_DISPLAY = Object.fromEntries(Object.entries(FHIR_LOCATION_PHYSICAL_TYPE_CODE).map(([k, v])=>[
        v,
        `${k.substring(0, 1).toUpperCase()}${k.substring(1).toLowerCase()}`
    ]));
const IPS_REQUEST_STATUSES = {
    QUEUED: 'Queued',
    PROCESSED: 'Processed',
    ERROR: 'Error',
    IGNORE: 'Ignore'
};
const HTTP_BODY_DATA_PATHS = {
    DIAGNOSTIC_REPORT_ATTACHMENT: '$.presentedForm[*].data'
};
const SCRUBBED_DATA_MESSAGE = 'Raw data removed from logs';
const SUPPORTED_CONTENT_TYPES = {
    PDF: 'application/pdf'
};
const DEFAULT_REASON_CANCELLED_BY_API = 'cancelled externally via api';
const SERVICE_REQUEST_CATEGORY_CODES = {
    LAB: '108252007',
    IMAGING: '363679005'
};
const FHIR_RESOURCE_TO_PERMISSION_NOUN = {
    Patient: 'FhirPatient',
    Practitioner: 'FhirPractitioner',
    Encounter: 'FhirEncounter',
    Organization: 'FhirOrganization',
    Specimen: 'FhirSpecimen',
    DiagnosticReport: 'FhirDiagnosticReport',
    Observation: 'FhirObservation',
    ImagingStudy: 'FhirImagingStudy',
    MedicationRequest: 'FhirMedicationRequest',
    Immunization: 'FhirImmunization'
};
const SERVICE_REQUEST_PERMISSION_NOUNS = {
    LAB: 'FhirLabServiceRequest',
    IMAGING: 'FhirImagingServiceRequest'
};
const FHIR_INTEGRATION_VERB = 'fhirIntegration';
const FHIR_INTEGRATION_PERMISSIONS = {
    PMI: {
        read: [
            'FhirPatient'
        ],
        write: []
    },
    LABS: {
        read: [
            'FhirPatient',
            'FhirPractitioner',
            'FhirEncounter',
            'FhirOrganization',
            'FhirLabServiceRequest',
            'FhirSpecimen'
        ],
        write: [
            'FhirDiagnosticReport',
            'FhirObservation'
        ]
    },
    RISPACS: {
        read: [
            'FhirPatient',
            'FhirPractitioner',
            'FhirEncounter',
            'FhirOrganization',
            'FhirImagingServiceRequest'
        ],
        write: [
            'FhirImagingStudy'
        ]
    },
    Prescriptions: {
        read: [
            'FhirPatient',
            'FhirPractitioner',
            'FhirEncounter',
            'FhirOrganization',
            'FhirMedicationRequest'
        ],
        write: []
    },
    Immunization: {
        read: [
            'FhirPatient',
            'FhirPractitioner',
            'FhirEncounter',
            'FhirOrganization',
            'FhirImmunization'
        ],
        write: []
    },
    Medici: {
        read: [
            'MediciReport'
        ],
        write: []
    }
};
const FHIR_PERMISSION_NOUNS = new Set([
    ...Object.values(FHIR_RESOURCE_TO_PERMISSION_NOUN),
    ...Object.values(SERVICE_REQUEST_PERMISSION_NOUNS),
    ...Object.keys(FHIR_INTEGRATION_PERMISSIONS),
    ...Object.values(FHIR_INTEGRATION_PERMISSIONS).flatMap((c)=>[
            ...c.read,
            ...c.write
        ])
]);

//# sourceMappingURL=fhir.js.map