@nsshunt/stsfhirpg 1.0.2 → 1.0.3

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.
@@ -6982,21 +6982,16 @@
6982
6982
  function hashUriParam(uri, lowercase = false) {
6983
6983
  return murmur64Signed(lowercase ? uri.toLowerCase() : uri);
6984
6984
  }
6985
+ const specPath1 = "./dist/";
6986
+ const specPath2 = "./node_modules/@nsshunt/stsfhirpg/dist/";
6985
6987
  const resourcesPath = "fhir-spec/profiles-resources.json";
6986
6988
  const typesPath = "fhir-spec/profiles-types.json";
6987
6989
  const searchParamsPath = "fhir-spec/search-parameters.json";
6988
6990
  class ResourceHelper {
6989
6991
  #definitions;
6990
6992
  static instance;
6991
- static specPath = "./dist/";
6992
6993
  constructor() {
6993
6994
  }
6994
- static setSpecPath(sPath) {
6995
- ResourceHelper.specPath = sPath;
6996
- }
6997
- static getSpecPath() {
6998
- return ResourceHelper.specPath;
6999
- }
7000
6995
  static getInstance() {
7001
6996
  if (!ResourceHelper.instance) {
7002
6997
  ResourceHelper.instance = new ResourceHelper();
@@ -7004,9 +6999,15 @@
7004
6999
  return ResourceHelper.instance;
7005
7000
  }
7006
7001
  #LoadDefinitions = () => {
7007
- const __resources = JSON.parse(fs.readFileSync(`${ResourceHelper.specPath}${resourcesPath}`, "utf-8"));
7008
- const __types = JSON.parse(fs.readFileSync(`${ResourceHelper.specPath}${typesPath}`, "utf-8"));
7009
- const __searchParams = JSON.parse(fs.readFileSync(`${ResourceHelper.specPath}${searchParamsPath}`, "utf-8"));
7002
+ let usePath = "";
7003
+ if (fs.existsSync(`${specPath1}${resourcesPath}`)) {
7004
+ usePath = specPath1;
7005
+ } else {
7006
+ usePath = specPath2;
7007
+ }
7008
+ const __resources = JSON.parse(fs.readFileSync(`${usePath}${resourcesPath}`, "utf-8"));
7009
+ const __types = JSON.parse(fs.readFileSync(`${usePath}${typesPath}`, "utf-8"));
7010
+ const __searchParams = JSON.parse(fs.readFileSync(`${usePath}${searchParamsPath}`, "utf-8"));
7010
7011
  if (!this.#definitions) {
7011
7012
  this.#definitions = {
7012
7013
  resources: {},