fume-fhir-converter
Version:
FHIR-Utilized Mapping Engine - Community
17 lines • 809 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.reference = void 0;
const tslib_1 = require("tslib");
const stringFunctions_1 = require("../stringFunctions");
const thrower_1 = tslib_1.__importDefault(require("../thrower"));
const reference = (resource) => {
if (typeof resource === 'undefined')
return undefined;
// Check that it is a FHIR resource
if (Array.isArray(resource) || Object.keys(resource).length === 0 || typeof resource !== 'object' || !resource?.resourceType) {
return thrower_1.default.throwRuntimeError('\'$reference()\' recieved a value that is not a FHIR resource');
}
return 'urn:uuid:' + (0, stringFunctions_1.uuid)(JSON.stringify(resource));
};
exports.reference = reference;
//# sourceMappingURL=reference.js.map