@nsshunt/stsfhirpg 0.0.8 → 1.0.2

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