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