fume-fhir-converter
Version:
FHIR-Utilized Mapping Engine - Community
24 lines • 1.02 kB
JavaScript
;
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkResourceId = void 0;
const tslib_1 = require("tslib");
const thrower_1 = tslib_1.__importDefault(require("../thrower"));
const checkResourceId = (resourceId) => {
if (typeof resourceId === 'undefined')
return undefined;
if (typeof resourceId !== 'string')
return thrower_1.default.throwRuntimeError(`Resource.id (value at Instance:) must be a string. Got: ${JSON.stringify(resourceId)}`);
if (/^[A-Za-z0-9\-.]{1,64}$/.test(resourceId)) {
return resourceId;
}
else {
return thrower_1.default.throwRuntimeError(`value after 'Instance:' declaration (Resource.id) must be a combination of letters, numerals, '-' and '.', and max 64 characters. Got '${resourceId}' instead.`);
}
;
};
exports.checkResourceId = checkResourceId;
//# sourceMappingURL=checkResourceId.js.map