@medplum/definitions 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var i in e)a(r,i,{get:e[i],enumerable:!0})},l=(r,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of c(e))!p.call(r,n)&&n!==i&&a(r,n,{get:()=>e[n],enumerable:!(s=u(e,n))||s.enumerable});return r};var _=r=>l(a({},"__esModule",{value:!0}),r);var R={};h(R,{SEARCH_PARAMETER_BUNDLE_FILES:()=>E,getDataDir:()=>d,readJson:()=>g});module.exports=_(R);var m=require("fs"),t=require("node:path"),f=require("node:url"),S={};function g(r){return JSON.parse((0,m.readFileSync)((0,t.resolve)(d(),r),"utf8"))}var o;function d(){if(!o){let r=D(),e=(0,t.basename)(r)==="src"?"../dist":"..";o=(0,t.resolve)(r,e)}return o}function D(){return typeof __dirname<"u"?__dirname:(0,t.dirname)((0,f.fileURLToPath)(S.url))}var E=["fhir/r4/search-parameters.json","fhir/r4/search-parameters-medplum.json","fhir/r4/search-parameters-uscore.json"];0&&(module.exports={SEARCH_PARAMETER_BUNDLE_FILES,getDataDir,readJson});
1
+ "use strict";var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var D=(e,r)=>{for(var o in r)a(e,o,{get:r[o],enumerable:!0})},E=(e,r,o,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of p(r))!l.call(e,n)&&n!==o&&a(e,n,{get:()=>r[n],enumerable:!(i=h(r,n))||i.enumerable});return e};var P=e=>E(a({},"__esModule",{value:!0}),e);var S={};D(S,{SEARCH_PARAMETER_BUNDLE_FILES:()=>y,getDataDir:()=>d,readJson:()=>_});module.exports=P(S);var c=require("fs"),m=require("node:fs"),t=require("node:path"),u=require("node:url"),f={};function _(e){let r=(0,t.resolve)(d(),e);return JSON.parse((0,c.readFileSync)(r,"utf8"))}var s;function d(){if(s)return s;let e=g(),r=["./","../","./cjs/","./esm/"];for(let o of r){let i=(0,t.resolve)(e,o),n=(0,t.resolve)(i,"fhir");if((0,m.existsSync)(n))return s=i,i}throw new Error("No data directory found")}function g(){if(typeof __dirname<"u")return(0,t.resolve)(__dirname);if(f.url)return(0,t.resolve)((0,t.dirname)((0,u.fileURLToPath)(f.url)));throw new Error("No data directory found")}var y=["fhir/r4/search-parameters.json","fhir/r4/search-parameters-medplum.json","fhir/r4/search-parameters-uscore.json"];0&&(module.exports={SEARCH_PARAMETER_BUNDLE_FILES,getDataDir,readJson});
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { readFileSync } from 'fs';\nimport { basename, dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport function readJson(filename: string): any {\n return JSON.parse(readFileSync(resolve(getDataDir(), filename), 'utf8'));\n}\n\nlet dataDir: string | undefined = undefined;\nexport function getDataDir(): string {\n if (!dataDir) {\n // When running from src, the data directory is \"../dist\"\n // When running from dist/cjs or dist/esm, the data directory is \"..\"\n const currDir = getDirName();\n const relativePath = basename(currDir) === 'src' ? '../dist' : '..';\n dataDir = resolve(currDir, relativePath);\n }\n return dataDir;\n}\n\n/**\n * Returns the directory name of the current module.\n * Works with both CommonJS and ES modules.\n * @returns The directory name of the current module.\n */\nfunction getDirName(): string {\n return typeof __dirname !== 'undefined' ? __dirname : dirname(fileURLToPath(import.meta.url));\n}\n\n/**\n * The list of all known search parameter definition bundle file paths relative to the\n * `@medplum/definitions` package. Typically used in conjunction with `readJson`.\n */\nexport const SEARCH_PARAMETER_BUNDLE_FILES = [\n 'fhir/r4/search-parameters.json',\n 'fhir/r4/search-parameters-medplum.json',\n 'fhir/r4/search-parameters-uscore.json',\n];\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,EAAA,eAAAC,EAAA,aAAAC,IAAA,eAAAC,EAAAL,GAEA,IAAAM,EAA6B,cAC7BC,EAA2C,qBAC3CC,EAA8B,oBAJ9BC,EAAA,GAMO,SAASL,EAASM,EAAuB,CAC9C,OAAO,KAAK,SAAM,mBAAa,WAAQP,EAAW,EAAGO,CAAQ,EAAG,MAAM,CAAC,CACzE,CAEA,IAAIC,EACG,SAASR,GAAqB,CACnC,GAAI,CAACQ,EAAS,CAGZ,IAAMC,EAAUC,EAAW,EACrBC,KAAe,YAASF,CAAO,IAAM,MAAQ,UAAY,KAC/DD,KAAU,WAAQC,EAASE,CAAY,CACzC,CACA,OAAOH,CACT,CAOA,SAASE,GAAqB,CAC5B,OAAO,OAAO,UAAc,IAAc,aAAY,cAAQ,iBAAcJ,EAAY,GAAG,CAAC,CAC9F,CAMO,IAAMP,EAAgC,CAC3C,iCACA,yCACA,uCACF",
6
- "names": ["index_exports", "__export", "SEARCH_PARAMETER_BUNDLE_FILES", "getDataDir", "readJson", "__toCommonJS", "import_fs", "import_node_path", "import_node_url", "import_meta", "filename", "dataDir", "currDir", "getDirName", "relativePath"]
4
+ "sourcesContent": ["// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { readFileSync } from 'fs';\nimport { existsSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport function readJson(filename: string): any {\n const filenamePath = resolve(getDataDir(), filename);\n return JSON.parse(readFileSync(filenamePath, 'utf8'));\n}\n\nlet cachedDataDir: string | undefined = undefined;\n\nexport function getDataDir(): string {\n if (cachedDataDir) {\n return cachedDataDir;\n }\n\n const currentDir = getCurrentDir();\n\n // Need to handle the following cases:\n // v4 and earlier: `index.js` in `dist/`, data in `dist/fhir/`\n // v5.0.0: data in `index.js` in `dist/cjs/` and `dist/esm/`, data in `/dist/cjs/fhir/` and `/dist/esm/fhir/`\n // v5.0.1 and after: `index.js` in `dist/cjs/` and `dist/esm/`, data back in `/dist/fhir/`\n const relativePaths = ['./', '../', './cjs/', './esm/'];\n for (const relativePath of relativePaths) {\n const fullPath = resolve(currentDir, relativePath);\n const fhirPath = resolve(fullPath, 'fhir');\n if (existsSync(fhirPath)) {\n cachedDataDir = fullPath;\n return fullPath;\n }\n }\n throw new Error('No data directory found');\n}\n\nfunction getCurrentDir(): string {\n if (typeof __dirname !== 'undefined') {\n return resolve(__dirname);\n } else if (import.meta.url) {\n return resolve(dirname(fileURLToPath(import.meta.url)));\n } else {\n throw new Error('No data directory found');\n }\n}\n\n/**\n * The list of all known search parameter definition bundle file paths relative to the\n * `@medplum/definitions` package. Typically used in conjunction with `readJson`.\n */\nexport const SEARCH_PARAMETER_BUNDLE_FILES = [\n 'fhir/r4/search-parameters.json',\n 'fhir/r4/search-parameters-medplum.json',\n 'fhir/r4/search-parameters-uscore.json',\n];\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,EAAA,eAAAC,EAAA,aAAAC,IAAA,eAAAC,EAAAL,GAEA,IAAAM,EAA6B,cAC7BC,EAA2B,mBAC3BC,EAAiC,qBACjCC,EAA8B,oBAL9BC,EAAA,GAOO,SAASN,EAASO,EAAuB,CAC9C,IAAMC,KAAe,WAAQT,EAAW,EAAGQ,CAAQ,EACnD,OAAO,KAAK,SAAM,gBAAaC,EAAc,MAAM,CAAC,CACtD,CAEA,IAAIC,EAEG,SAASV,GAAqB,CACnC,GAAIU,EACF,OAAOA,EAGT,IAAMC,EAAaC,EAAc,EAM3BC,EAAgB,CAAC,KAAM,MAAO,SAAU,QAAQ,EACtD,QAAWC,KAAgBD,EAAe,CACxC,IAAME,KAAW,WAAQJ,EAAYG,CAAY,EAC3CE,KAAW,WAAQD,EAAU,MAAM,EACzC,MAAI,cAAWC,CAAQ,EACrB,OAAAN,EAAgBK,EACTA,CAEX,CACA,MAAM,IAAI,MAAM,yBAAyB,CAC3C,CAEA,SAASH,GAAwB,CAC/B,GAAI,OAAO,UAAc,IACvB,SAAO,WAAQ,SAAS,EACnB,GAAIL,EAAY,IACrB,SAAO,cAAQ,cAAQ,iBAAcA,EAAY,GAAG,CAAC,CAAC,EAEtD,MAAM,IAAI,MAAM,yBAAyB,CAE7C,CAMO,IAAMR,EAAgC,CAC3C,iCACA,yCACA,uCACF",
6
+ "names": ["index_exports", "__export", "SEARCH_PARAMETER_BUNDLE_FILES", "getDataDir", "readJson", "__toCommonJS", "import_fs", "import_node_fs", "import_node_path", "import_node_url", "import_meta", "filename", "filenamePath", "cachedDataDir", "currentDir", "getCurrentDir", "relativePaths", "relativePath", "fullPath", "fhirPath"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{readFileSync as i}from"fs";import{basename as a,dirname as o,resolve as t}from"node:path";import{fileURLToPath as s}from"node:url";function p(r){return JSON.parse(i(t(m(),r),"utf8"))}var e;function m(){if(!e){let r=f(),n=a(r)==="src"?"../dist":"..";e=t(r,n)}return e}function f(){return typeof __dirname<"u"?__dirname:o(s(import.meta.url))}var h=["fhir/r4/search-parameters.json","fhir/r4/search-parameters-medplum.json","fhir/r4/search-parameters-uscore.json"];export{h as SEARCH_PARAMETER_BUNDLE_FILES,m as getDataDir,p as readJson};
1
+ import{readFileSync as s}from"fs";import{existsSync as f}from"node:fs";import{dirname as c,resolve as r}from"node:path";import{fileURLToPath as m}from"node:url";function E(e){let t=r(u(),e);return JSON.parse(s(t,"utf8"))}var o;function u(){if(o)return o;let e=d(),t=["./","../","./cjs/","./esm/"];for(let i of t){let n=r(e,i),a=r(n,"fhir");if(f(a))return o=n,n}throw new Error("No data directory found")}function d(){if(typeof __dirname<"u")return r(__dirname);if(import.meta.url)return r(c(m(import.meta.url)));throw new Error("No data directory found")}var P=["fhir/r4/search-parameters.json","fhir/r4/search-parameters-medplum.json","fhir/r4/search-parameters-uscore.json"];export{P as SEARCH_PARAMETER_BUNDLE_FILES,u as getDataDir,E as readJson};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { readFileSync } from 'fs';\nimport { basename, dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport function readJson(filename: string): any {\n return JSON.parse(readFileSync(resolve(getDataDir(), filename), 'utf8'));\n}\n\nlet dataDir: string | undefined = undefined;\nexport function getDataDir(): string {\n if (!dataDir) {\n // When running from src, the data directory is \"../dist\"\n // When running from dist/cjs or dist/esm, the data directory is \"..\"\n const currDir = getDirName();\n const relativePath = basename(currDir) === 'src' ? '../dist' : '..';\n dataDir = resolve(currDir, relativePath);\n }\n return dataDir;\n}\n\n/**\n * Returns the directory name of the current module.\n * Works with both CommonJS and ES modules.\n * @returns The directory name of the current module.\n */\nfunction getDirName(): string {\n return typeof __dirname !== 'undefined' ? __dirname : dirname(fileURLToPath(import.meta.url));\n}\n\n/**\n * The list of all known search parameter definition bundle file paths relative to the\n * `@medplum/definitions` package. Typically used in conjunction with `readJson`.\n */\nexport const SEARCH_PARAMETER_BUNDLE_FILES = [\n 'fhir/r4/search-parameters.json',\n 'fhir/r4/search-parameters-medplum.json',\n 'fhir/r4/search-parameters-uscore.json',\n];\n"],
5
- "mappings": "AAEA,OAAS,gBAAAA,MAAoB,KAC7B,OAAS,YAAAC,EAAU,WAAAC,EAAS,WAAAC,MAAe,YAC3C,OAAS,iBAAAC,MAAqB,WAEvB,SAASC,EAASC,EAAuB,CAC9C,OAAO,KAAK,MAAMN,EAAaG,EAAQI,EAAW,EAAGD,CAAQ,EAAG,MAAM,CAAC,CACzE,CAEA,IAAIE,EACG,SAASD,GAAqB,CACnC,GAAI,CAACC,EAAS,CAGZ,IAAMC,EAAUC,EAAW,EACrBC,EAAeV,EAASQ,CAAO,IAAM,MAAQ,UAAY,KAC/DD,EAAUL,EAAQM,EAASE,CAAY,CACzC,CACA,OAAOH,CACT,CAOA,SAASE,GAAqB,CAC5B,OAAO,OAAO,UAAc,IAAc,UAAYR,EAAQE,EAAc,YAAY,GAAG,CAAC,CAC9F,CAMO,IAAMQ,EAAgC,CAC3C,iCACA,yCACA,uCACF",
6
- "names": ["readFileSync", "basename", "dirname", "resolve", "fileURLToPath", "readJson", "filename", "getDataDir", "dataDir", "currDir", "getDirName", "relativePath", "SEARCH_PARAMETER_BUNDLE_FILES"]
4
+ "sourcesContent": ["// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { readFileSync } from 'fs';\nimport { existsSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport function readJson(filename: string): any {\n const filenamePath = resolve(getDataDir(), filename);\n return JSON.parse(readFileSync(filenamePath, 'utf8'));\n}\n\nlet cachedDataDir: string | undefined = undefined;\n\nexport function getDataDir(): string {\n if (cachedDataDir) {\n return cachedDataDir;\n }\n\n const currentDir = getCurrentDir();\n\n // Need to handle the following cases:\n // v4 and earlier: `index.js` in `dist/`, data in `dist/fhir/`\n // v5.0.0: data in `index.js` in `dist/cjs/` and `dist/esm/`, data in `/dist/cjs/fhir/` and `/dist/esm/fhir/`\n // v5.0.1 and after: `index.js` in `dist/cjs/` and `dist/esm/`, data back in `/dist/fhir/`\n const relativePaths = ['./', '../', './cjs/', './esm/'];\n for (const relativePath of relativePaths) {\n const fullPath = resolve(currentDir, relativePath);\n const fhirPath = resolve(fullPath, 'fhir');\n if (existsSync(fhirPath)) {\n cachedDataDir = fullPath;\n return fullPath;\n }\n }\n throw new Error('No data directory found');\n}\n\nfunction getCurrentDir(): string {\n if (typeof __dirname !== 'undefined') {\n return resolve(__dirname);\n } else if (import.meta.url) {\n return resolve(dirname(fileURLToPath(import.meta.url)));\n } else {\n throw new Error('No data directory found');\n }\n}\n\n/**\n * The list of all known search parameter definition bundle file paths relative to the\n * `@medplum/definitions` package. Typically used in conjunction with `readJson`.\n */\nexport const SEARCH_PARAMETER_BUNDLE_FILES = [\n 'fhir/r4/search-parameters.json',\n 'fhir/r4/search-parameters-medplum.json',\n 'fhir/r4/search-parameters-uscore.json',\n];\n"],
5
+ "mappings": "AAEA,OAAS,gBAAAA,MAAoB,KAC7B,OAAS,cAAAC,MAAkB,UAC3B,OAAS,WAAAC,EAAS,WAAAC,MAAe,YACjC,OAAS,iBAAAC,MAAqB,WAEvB,SAASC,EAASC,EAAuB,CAC9C,IAAMC,EAAeJ,EAAQK,EAAW,EAAGF,CAAQ,EACnD,OAAO,KAAK,MAAMN,EAAaO,EAAc,MAAM,CAAC,CACtD,CAEA,IAAIE,EAEG,SAASD,GAAqB,CACnC,GAAIC,EACF,OAAOA,EAGT,IAAMC,EAAaC,EAAc,EAM3BC,EAAgB,CAAC,KAAM,MAAO,SAAU,QAAQ,EACtD,QAAWC,KAAgBD,EAAe,CACxC,IAAME,EAAWX,EAAQO,EAAYG,CAAY,EAC3CE,EAAWZ,EAAQW,EAAU,MAAM,EACzC,GAAIb,EAAWc,CAAQ,EACrB,OAAAN,EAAgBK,EACTA,CAEX,CACA,MAAM,IAAI,MAAM,yBAAyB,CAC3C,CAEA,SAASH,GAAwB,CAC/B,GAAI,OAAO,UAAc,IACvB,OAAOR,EAAQ,SAAS,EACnB,GAAI,YAAY,IACrB,OAAOA,EAAQD,EAAQE,EAAc,YAAY,GAAG,CAAC,CAAC,EAEtD,MAAM,IAAI,MAAM,yBAAyB,CAE7C,CAMO,IAAMY,EAAgC,CAC3C,iCACA,yCACA,uCACF",
6
+ "names": ["readFileSync", "existsSync", "dirname", "resolve", "fileURLToPath", "readJson", "filename", "filenamePath", "getDataDir", "cachedDataDir", "currentDir", "getCurrentDir", "relativePaths", "relativePath", "fullPath", "fhirPath", "SEARCH_PARAMETER_BUNDLE_FILES"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/definitions",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Medplum Data Definitions",
5
5
  "keywords": [
6
6
  "medplum",