oro-sdk 2.1.4-dev1

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.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/dist/client.d.ts +464 -0
  4. package/dist/helpers/client.d.ts +23 -0
  5. package/dist/helpers/index.d.ts +4 -0
  6. package/dist/helpers/patient-registration.d.ts +16 -0
  7. package/dist/helpers/vault-grants.d.ts +20 -0
  8. package/dist/helpers/workflow.d.ts +23 -0
  9. package/dist/index.d.ts +11 -0
  10. package/dist/index.js +8 -0
  11. package/dist/models/client.d.ts +28 -0
  12. package/dist/models/consult.d.ts +102 -0
  13. package/dist/models/diagnosis.d.ts +122 -0
  14. package/dist/models/error.d.ts +26 -0
  15. package/dist/models/guard.d.ts +119 -0
  16. package/dist/models/index.d.ts +9 -0
  17. package/dist/models/practice.d.ts +353 -0
  18. package/dist/models/shared.d.ts +8 -0
  19. package/dist/models/vault.d.ts +124 -0
  20. package/dist/models/workflow.d.ts +106 -0
  21. package/dist/oro-sdk.cjs.development.js +7685 -0
  22. package/dist/oro-sdk.cjs.development.js.map +1 -0
  23. package/dist/oro-sdk.cjs.production.min.js +2 -0
  24. package/dist/oro-sdk.cjs.production.min.js.map +1 -0
  25. package/dist/oro-sdk.esm.js +7692 -0
  26. package/dist/oro-sdk.esm.js.map +1 -0
  27. package/dist/sdk-revision/client.d.ts +21 -0
  28. package/dist/sdk-revision/index.d.ts +1 -0
  29. package/dist/services/api.d.ts +11 -0
  30. package/dist/services/axios.d.ts +14 -0
  31. package/dist/services/consult.d.ts +54 -0
  32. package/dist/services/diagnosis.d.ts +44 -0
  33. package/dist/services/external/clinia.d.ts +82 -0
  34. package/dist/services/external/index.d.ts +1 -0
  35. package/dist/services/guard.d.ts +92 -0
  36. package/dist/services/index.d.ts +10 -0
  37. package/dist/services/practice.d.ts +100 -0
  38. package/dist/services/teller.d.ts +9 -0
  39. package/dist/services/vault.d.ts +54 -0
  40. package/dist/services/workflow.d.ts +21 -0
  41. package/package.json +63 -0
  42. package/src/client.ts +1843 -0
  43. package/src/helpers/client.ts +199 -0
  44. package/src/helpers/index.ts +4 -0
  45. package/src/helpers/patient-registration.ts +490 -0
  46. package/src/helpers/vault-grants.ts +51 -0
  47. package/src/helpers/workflow.ts +261 -0
  48. package/src/index.ts +61 -0
  49. package/src/models/client.ts +33 -0
  50. package/src/models/consult.ts +110 -0
  51. package/src/models/diagnosis.ts +141 -0
  52. package/src/models/error.ts +13 -0
  53. package/src/models/guard.ts +136 -0
  54. package/src/models/index.ts +9 -0
  55. package/src/models/practice.ts +411 -0
  56. package/src/models/shared.ts +6 -0
  57. package/src/models/vault.ts +158 -0
  58. package/src/models/workflow.ts +142 -0
  59. package/src/sdk-revision/client.ts +62 -0
  60. package/src/sdk-revision/index.ts +1 -0
  61. package/src/services/api.ts +77 -0
  62. package/src/services/axios.ts +91 -0
  63. package/src/services/consult.ts +265 -0
  64. package/src/services/diagnosis.ts +144 -0
  65. package/src/services/external/clinia.ts +133 -0
  66. package/src/services/external/index.ts +1 -0
  67. package/src/services/guard.ts +228 -0
  68. package/src/services/index.ts +10 -0
  69. package/src/services/practice.ts +537 -0
  70. package/src/services/teller.ts +39 -0
  71. package/src/services/vault.ts +178 -0
  72. package/src/services/workflow.ts +36 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oro-sdk.esm.js","sources":["../node_modules/regenerator-runtime/runtime.js","../src/services/axios.ts","../src/services/api.ts","../src/models/consult.ts","../src/models/diagnosis.ts","../src/models/error.ts","../src/models/practice.ts","../src/models/vault.ts","../src/models/workflow.ts","../src/services/consult.ts","../src/services/diagnosis.ts","../src/services/guard.ts","../src/services/practice.ts","../src/services/teller.ts","../src/services/vault.ts","../src/services/workflow.ts","../src/services/external/clinia.ts","../src/helpers/client.ts","../src/helpers/workflow.ts","../src/helpers/patient-registration.ts","../src/helpers/vault-grants.ts","../src/sdk-revision/client.ts","../src/client.ts","../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import type { AxiosRequestConfig } from 'axios'\nimport axios, { AxiosInstance } from 'axios'\n\n\nexport class AxiosService {\n protected axios: AxiosInstance\n\n constructor(\n config?: AxiosRequestConfig\n ) {\n if (!config) config = {}\n\n this.axios = axios.create(config)\n }\n\n protected async apiRequest(config: AxiosRequestConfig, url: string, data?: any) {\n if (!config.headers) config.headers = {}\n\n config.headers['Content-Type'] = 'application/json'\n\n return this.axios({\n ...config,\n url,\n data: data,\n }).then((res) => {\n return res.data\n })\n }\n\n protected async apiRequestHeader(config: AxiosRequestConfig, url: string, headerToRetrieve?: string, data?: any,) {\n if (!config.headers) config.headers = {}\n\n config.headers['Content-Type'] = 'application/json'\n\n return this.axios({\n ...config,\n url,\n data: data,\n }).then((res) => {\n if (headerToRetrieve) {\n return res.headers[headerToRetrieve] ?? res.headers[headerToRetrieve.toLowerCase()]\n }\n\n return res.headers\n })\n }\n\n public get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T> {\n return this.apiRequest({ ...config, method: 'get' }, url)\n }\n\n public deleteRequest<T = any>(\n url: string,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'delete' }, url)\n }\n\n public post<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'post' }, url, data)\n }\n\n public put<T = any>(\n url: string,\n data: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'put' }, url, data)\n }\n\n public patch<T = any>(\n url: string,\n data: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'patch' }, url, data)\n }\n\n public head<T = any>(\n url: string,\n config?: AxiosRequestConfig,\n headerToRetrieve?: string,\n data?: any\n ): Promise<T> {\n return this.apiRequestHeader({ ...config, method: 'head' }, url, headerToRetrieve, data)\n }\n}\n","import type { AxiosRequestConfig } from 'axios'\nimport createAuthRefreshInterceptor from 'axios-auth-refresh'\nimport { AuthRefreshFunc, Tokens } from '../models'\nimport { AxiosService } from './axios'\nimport { GuardRequestConfig } from './guard'\n\n\nexport class APIService extends AxiosService {\n private authRefreshFn?: AuthRefreshFunc\n\n constructor(\n config?: AxiosRequestConfig,\n private tokenRefreshFailureCallback?: (err: Error) => void\n ) {\n super(config)\n const self = this\n\n this.axios.interceptors.request.use(\n config => {\n const token = (config as GuardRequestConfig).useRefreshToken\n ? self.getTokens().refreshToken\n : self.getTokens().accessToken\n\n config.headers = {\n ...config.headers,\n Authorization: `Bearer ${token}`,\n }\n return config;\n },\n error => {\n Promise.reject(error)\n }\n );\n\n createAuthRefreshInterceptor(this.axios, async function (failedRequest) {\n if (self.authRefreshFn) {\n try {\n let tokenResp = await self.authRefreshFn(self.getTokens().refreshToken)\n self.setTokens({\n accessToken: tokenResp.accessToken,\n refreshToken: tokenResp.refreshToken\n })\n failedRequest.response.config.headers['Authorization'] = `Bearer ${self.getTokens().accessToken}`\n return Promise.resolve()\n \n } catch (e) {\n console.error('an error occured while refreshing tokens (notifying callback)', e)\n if (self.tokenRefreshFailureCallback)\n self.tokenRefreshFailureCallback(failedRequest)\n return Promise.resolve() // We keep it like that. Otherwise, it seems to break the api service will it is not needed\n // return Promise.reject(e) \n }\n }\n console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest)\n return Promise.resolve() // We keep it like that. Otherwise, it seems to break the api service will it is not needed\n // return Promise.reject(failedRequest)\n\n }, { statusCodes: [401, 403] })\n }\n\n public setAuthRefreshFn(fn: AuthRefreshFunc) {\n this.authRefreshFn = fn\n }\n\n public setTokens(tokens: Tokens) {\n localStorage.setItem('tokens', JSON.stringify(tokens))\n }\n\n public getTokens(): Tokens {\n let tokens : Tokens = {}\n const item = localStorage.getItem('tokens')\n if (item) {\n tokens = JSON.parse(item)\n }\n return tokens\n }\n}\n","export enum AssistantType {\n MedicalSecretary = 'MedicalSecretary',\n Nurse = 'Nurse',\n Specialist = 'Specialist',\n Administrative = 'Administrative',\n Other = 'Other',\n}\n\nexport interface ConsultAssignedAssistant {\n id?: number ///optional for insertion\n uuidConsult: string\n uuidAssistant: string\n type: AssistantType\n tagSpecialty?: string\n duuidCurrentTaskDescription?: string\n}\n\nexport enum TransmissionKind {\n Fax = 'Fax',\n Email = 'Email',\n SMS = 'SMS',\n EncryptedEmail = 'EncryptedEmail',\n Logs = 'Logs',\n API = 'API',\n Other = 'Other',\n}\n\nexport enum TransmissionStatus {\n Preparing = 'Preparing',\n Sending = 'Sending',\n Sent = 'Sent',\n Retrying = 'Retrying',\n Failed = 'Failed',\n DriverError = 'DriverError',\n TimedOut = 'TimedOut',\n ReceiverNotExist = 'ReceiverNotExist',\n ReceiverNotAnswering = 'ReceiverNotAnswering',\n ReceiverIncompatible = 'ReceiverIncompatible',\n}\n\nexport interface ConsultTransmission {\n id: number\n uuidConsult: string\n kind: TransmissionKind\n status: TransmissionStatus\n nameDriverReceiver: string\n addressReceiver: string\n idDriverForTransmission: string\n txtLastDriverMessage: string\n numTry: number\n numTryLeft: number\n delay: number\n tsFirstTry: string\n tsLastStatusUpdate: string\n keyWebhookSecret: string\n}\n\nexport enum FeeStatus {\n NoFee = 'NoFee',\n Pending = 'Pending',\n Paid = 'Paid',\n Reimbursed = 'Reimbursed',\n Cancelled = 'Cancelled',\n Contested = 'Contested',\n}\n\nexport enum MedicalStatus {\n Creating = 'Creating',\n New = 'New',\n ToAnswer = 'ToAnswer',\n Answered = 'Answered',\n Closed = 'Closed',\n Reopened = 'Reopened',\n Archived = 'Archived',\n}\n\nexport enum TaskStatus {\n None = 'None',\n ToDo = 'ToDo',\n InProgress = 'InProgress',\n Blocked = 'Blocked',\n Done = 'Done',\n}\n\nexport interface ConsultRequest {\n uuidPractice: string\n tagSpecialtyRequired: string\n idStripeInvoiceOrPaymentIntent: string\n isoLocalityRequired?: string\n isoLanguageRequired: string\n}\nexport interface Consult {\n uuid: string\n uuidPracticeAdmin: string\n uuidPractice: string\n tagSpecialtyRequired: string\n isoLanguageRequired: string\n idPracticePayment: number\n statusFee?: FeeStatus\n isoLocalityRequired: string\n statusMedical?: MedicalStatus\n uuidAssignedDoctor: string\n uuidCurrentAssigned: string\n statusTask?: TaskStatus\n hasTransmissions?: boolean\n assignedAssistant?: ConsultAssignedAssistant[]\n shortId?: string\n createdAt?: string\n expiresAt?: string\n}\n","export enum DiagnosisType {\n Generic = 'Generic',\n Private = 'Private',\n Instance = 'Instance',\n}\n\nexport interface DiagnosisRequest {\n uuid?: string\n name: string\n description: string\n type: DiagnosisType\n parentUuid?: string\n language: string\n tags?: string[]\n urlMultimedia?: string\n}\n\nexport interface Diagnosis extends DiagnosisRequest {\n uuid: string\n uuidPractice: string\n uuidPractitioner?: string\n createdAt: string\n}\n\nexport interface TreatmentRequest {\n uuid?: string\n uuidDiagnosis?: string\n name: string\n description: string\n urlMultimedia?: string\n}\n\nexport interface Treatment extends TreatmentRequest {\n uuid: string\n uuidDiagnosis: string\n createdAt: string\n}\n\nexport enum DrugType {\n Generic = 'Generic',\n Instance = 'Instance',\n}\n\nexport interface DrugRequest {\n name: string // name of the drug\n description: string // Description of the drug\n type: DrugType // Entry type\n language: string // drug locale\n sideEffects: string // Side effects of the drug\n imageUrl?: string // Image URL to the drug\n parentUuid?: string // (optional) parent uuid of the drug. In case of DrugType.Instance\n uuid?: string // uuid of the drug (will be used as parentUuid in case of creation of new drug)\n}\n\nexport interface Drug extends DrugRequest {\n uuid: string\n uuidPractice: string\n uuidPractitioner?: string\n createdAt: string\n}\n\nexport interface PrescriptionRequest {\n uuid?: string\n uuidTreatment?: string\n uuidDrug?: string\n quantity: string\n sig: string\n renewal: string\n}\n\nexport interface Prescription extends PrescriptionRequest {\n uuid: string\n uuidTreatment: string\n createdAt: string\n}\n\nexport enum PlanStatus {\n Pending = 'Pending',\n Accepted = 'Accepted',\n Rejected = 'Rejected',\n}\n\nexport interface TreatmentPlan {\n uuid: string\n uuidConsult: string\n uuidDiagnosis: string\n uuidTreatment?: string\n status: PlanStatus\n}\n\nexport interface DrugPrescription {\n prescription: Prescription\n drug: Drug\n}\n\nexport interface TreatmentAndDrugPrescription {\n treatment?: Treatment\n prescriptionsAndDrugs?: DrugPrescription[]\n status: PlanStatus\n uuidTreatmentPlan: string\n}\nexport interface TreatmentPlans {\n uuidConsult: string\n diagnosis: Diagnosis\n plans?: TreatmentAndDrugPrescription[]\n}\n\nexport interface DrugPrescriptionRequest {\n prescription: PrescriptionRequest\n drug: DrugRequest\n}\n\nexport interface TreatmentAndDrugPrescriptionRequest {\n trackingId: string\n treatment: TreatmentRequest\n prescriptionsAndDrugs?: DrugPrescriptionRequest[]\n}\n\nexport interface TreatmentPlansRequest {\n uuidConsult: string\n diagnosis: DiagnosisRequest\n plans?: TreatmentAndDrugPrescriptionRequest[]\n}\n\nexport interface TreatmentAndDrugPrescriptionUpdateRequest {\n treatment: Treatment\n prescriptionsAndDrugs?: DrugPrescriptionRequest[]\n}\n\nexport interface TreatmentPlanUpdateRequest extends TreatmentPlansRequest {\n uuidConsult: string\n diagnosis: DiagnosisRequest\n plan: TreatmentAndDrugPrescriptionUpdateRequest\n}\n\nexport interface TreatmentPlansResponseEntry {\n trackingId?: string // can be undefined if treatmentPlan does not contain a treatment\n treatmentPlan: TreatmentPlan\n}\n\nexport interface TreatmentPlansResponse extends Array<TreatmentPlansResponseEntry> {}\n","export class IncompleteAuthentication extends Error { }\nexport class MissingGrant extends Error { }\nexport class MissingLockbox extends Error { }\nexport class MissingLockboxOwner extends Error { }\nexport class IndexBuildError extends Error { }\nexport class AssociatedLockboxNotFound extends Error { }\nexport class WorkflowAnswersMissingError extends Error { }\nexport class AuthenticationFailed extends Error { }\nexport class AuthenticationBadRequest extends Error { }\nexport class AuthenticationServerError extends Error { }\nexport class IdentityCreationFailed extends Error { }\nexport class IdentityCreationBadRequest extends Error { }\nexport class IdentityCreationConflict extends Error { }\n","export enum WorkflowType {\n Onboard = 'Onboard',\n Followup = 'Followup',\n Renew = 'Renew',\n DataRetrieve = 'DataRetrieve',\n}\n\nexport enum RateDimension {\n RatioOnTotal = 'RatioOnTotal',\n FixedOnTotal = 'FixedOnTotal',\n RatioPlatformFee = 'RatioPlatformFee',\n FixedPlatformFee = 'FixedPlatformFee',\n RatioOnPlatformFeeTotal = 'RatioOnPlatformFeeTotal',\n FixedOnPlatformFeeTotal = 'FixedOnPlatformFeeTotal',\n RatioOnItem = 'RatioOnItem',\n FixedOnItem = 'FixedOnItem',\n}\n\nexport enum PlanType {\n Onboard = 'Onboard',\n Followup = 'Followup',\n Renew = 'Renew',\n DataRetrieve = 'DataRetrieve',\n}\n\nexport enum PaymentStatus {\n Pending = 'Pending',\n Success = 'Success',\n Failure = 'Failure',\n Canceled = 'Canceled',\n}\n\nexport enum PractitionerStatus {\n Practicing = 'Practicing',\n Retired = 'Retired',\n NotInvolvedAnymore = 'NotInvolvedAnymore',\n Deactivated = 'Deactivated',\n Flagged = 'Flagged',\n InConflict = 'InConflict',\n Delicensed = 'Delicensed',\n}\n\nexport enum AssignmentStatus {\n Assigned = 'Assigned',\n Reassigned = 'Reassigned',\n Cancelled = 'Cancelled',\n}\n\nexport enum PractitionnerRoleType {\n Doctor = 'Doctor',\n MedicalAssistant = 'MedicalAssistant',\n MedicalSecretary = 'MedicalSecretary',\n Nurse = 'Nurse',\n Specialist = 'Specialist',\n LabAssistant = 'LabAssistant',\n Administrative = 'Administrative',\n ManualDispatcher = 'ManualDispatcher',\n Other = 'Other',\n}\n\nexport enum OtherRoleType {\n Patient = 'Patient',\n User = 'User',\n System = 'System',\n}\n\nexport type AllRoleType = OtherRoleType | PractitionnerRoleType\n\nexport enum LicenseStatus {\n Valid = 'Valid',\n Invalid = 'Invalid',\n Expired = 'Expired',\n NA = 'NA',\n Removed = 'Removed',\n}\n\nexport enum PeriodType {\n PerYear = 'PerYear',\n PerQuarter = 'PerQuarter',\n PerMonth = 'PerMonth',\n PerWeek = 'PerWeek',\n PerBusinessDay = 'PerBusinessDay',\n PerDay = 'PerDay',\n PerHour = 'PerHour',\n}\n\nexport enum SyncStatus {\n Requested = 'Requested',\n Started = 'Started',\n Succeeded = 'Succeeded',\n Failed = 'Failed',\n Cancelled = 'Cancelled',\n}\n\nexport enum PracticeEmailKind {\n SignedUp = 'SignedUp',\n Onboarded = 'Onboarded',\n OnboardedPractitioner = 'OnboardedPractitioner',\n OnboardedPatient = 'OnboardedPatient',\n Answered = 'Answered',\n ToAnswer = 'ToAnswer',\n FollowedUp = 'FollowedUp',\n Renewed = 'Renewed',\n DataRetrieved = 'DataRetrieved',\n}\n\nexport interface PracticeAccount {\n id?: number ///optional for insertion\n uuidPractice: string\n isoLocality?: string\n idStripeAccount?: string\n emailBillingContact: string\n urlSubdomain?: string\n}\n\nexport enum PracticeConfigKind {\n PractitionerConsultList = 'PractitionerConsultList',\n PractitionerChatbox = 'PractitionerChatbox',\n PracticeTheme = 'PracticeTheme',\n PracticeLocaleSwitcher = 'PracticeLocaleSwitcher',\n PracticeCookieBanner = 'PracticeCookieBanner',\n}\n\nexport interface PracticeConfig<K, T> {\n uuidPractice: string\n kind: K // PracticeConfigKind\n config: T\n}\n\nexport type PracticeConfigPractitionerConsultList = PracticeConfig<\n PracticeConfigKind.PractitionerConsultList,\n {\n hideLocality?: boolean\n hideFax?: boolean\n hideExpiresAt?: boolean\n }\n>\n\nexport type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<\n PracticeConfigKind.PracticeLocaleSwitcher,\n {\n hideLocaleSwitcher?: boolean\n }\n>\n\nexport type PracticeConfigPractitionerChatbox = PracticeConfig<\n PracticeConfigKind.PractitionerChatbox,\n {\n planAddedMessage?: { [languageISO639_3: string]: string }\n planUpdatedMessage?: { [languageISO639_3: string]: string }\n }\n>\n\nexport type PracticeConfigPracticeCookieBanner = PracticeConfig<\n PracticeConfigKind.PracticeCookieBanner,\n {\n showCookieBanner?: boolean\n policyLink?: string\n useOfCookieLink?: string\n }\n>\n\n// This type is for demonstration only for now\nexport type PracticeConfigPracticeTheme = PracticeConfig<\n PracticeConfigKind.PracticeTheme,\n { primaryColor?: string }\n>\n\nexport type PracticeConfigs =\n | PracticeConfigPractitionerConsultList\n | PracticeConfigPractitionerChatbox\n | PracticeConfigPracticeLocaleSwitcher\n | PracticeConfigPracticeCookieBanner\n | PracticeConfigPracticeTheme // Here for demonstration only\n\nexport interface PracticeWorkflow {\n id?: number ///optional for insertion\n uuidPractice: string\n uuidWorkflow: string\n typeWorkflow: WorkflowType\n tagSpecialty?: string\n}\n\nexport type PracticeWorkflowWithTagSpecialty = PracticeWorkflow & {\n tagSpecialty: string\n}\n\nexport interface PracticePlan {\n id?: number ///optional for insertion\n uuidPractice: string\n isoLocality?: string\n nameDefault: string\n descDefault: string\n hoursExpiration: number\n active: boolean\n namePriceCurrency: string // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceAmount: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceExtDecimal?: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceExtNegativeExponential?: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n kind: PlanType\n idStripeProduct: string\n idStripePrice: string // DEPRECATED: left only for in-app receipt display and lower migration risks\n dateCreatedAt: Date\n dateUpdateAt: Date\n ratePerThousandOverride: number // DEPRECATED: left only to lower migration risks\n}\n\nexport enum StripePriceType {\n Default = 'Default',\n Discount = 'Discount',\n}\n\n// Subset of Stripe.Price\nexport interface PracticePrice {\n /**\n * Unique identifier for the object in Stripe.\n */\n idStripePrice: string\n /**\n * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).\n */\n currency: string\n /**\n * The unit amount in %s to be charged, represented as a whole integer if possible.\n */\n unitAmount: number\n}\n\nexport interface PracticePlanPrices {\n idPlan: number\n default: PracticePrice\n discount?: PracticePrice\n}\n\nexport interface PracticeRate {\n id?: number\n uuidPractice: string\n idPlan: number\n isoLocality?: string\n dimension: RateDimension\n description: string\n uidTaxRate: string\n idStripeTaxRate: string\n}\n\nexport interface PracticePlatformFee {\n uuidPractice: string\n idPlan: number\n isoLocality?: string\n numPlatformFinalFee: number\n}\n\nexport interface PracticePayment {\n id?: number ///optional for insertion\n uuidPractice: string\n idPlan: number\n uuidConsult: string\n hoursConsultExpiration: number\n idStripeInvoiceOrPaymentIntent: string\n status: PaymentStatus\n dateCreatedAt: Date\n dateUpdateAt: Date\n}\n\nexport interface PracticePaymentIntent {\n id?: number ///optional for insertion\n uuidPractice: string\n idPlan: number\n idPayment: number\n hoursPlanExpiration: number\n isoLocality?: string\n textPaymentMethodOptions: string\n nameCurrency: string\n numTotalAmount: number\n numPlatformFeeAmount: number\n idStripeInvoice: string\n idStripePaymtIntent: string\n stripeClientSecret: string\n dateCreatedAt?: Date\n dateUpdateAt?: Date\n}\n\nexport interface Assignment {\n id?: number ///optional for insertion\n uuidPractice: string\n uuidAssignor: string //defaulting for insertion to the default practice admin\n uuidPractitioner?: string\n status?: AssignmentStatus\n uuidConsult?: string\n tagSpecialty?: string\n timeAssigned?: string //defaulting for insertion\n}\n\nexport interface PractitionerRole {\n id?: number //optional for insertion\n uuidPractice: string\n uuidPractitioner: string\n role: PractitionnerRoleType\n dateGiven?: Date //default during insertion\n}\n\nexport interface PractitionerLicense {\n id?: number ///optional for insertion\n uuidPractitioner: string\n country: string\n tagSpecialty: string\n isoLocality: string\n txtLicenseNumber: string\n txtComplementary?: string\n dateProvidedAt?: Date\n dateObtainedAt?: Date\n dateRenewedAt?: Date\n status?: LicenseStatus\n}\n\nexport interface PractitionerPreference {\n id?: number\n uuidPractitioner: string\n uuidPractice: string\n tagSpecialties: string\n isoLocalityConsult?: string\n periodQuotaConsult?: PeriodType\n quantityQuotaConsult?: number\n tagConsultLanguages?: string\n}\n\nexport interface PractitionerQuota {\n id?: number ///optional for insertion\n uuidPractitioner: string\n uuidPractice: string\n tagSpecialty: string\n isoLocality: string\n quantityLeft?: number\n dateRenewal?: Date\n dateLastUpdate?: Date\n}\n\nexport interface Practitioner {\n uuid: string\n uuidPractice: string\n txtFirstName: string\n txtLastName: string\n txtTitle: string\n emailAddress: string\n tagsSpecialties: string\n arrLanguages: string\n dateAddedAt?: Date //defaulting for insertion\n status?: PractitionerStatus //defaulting for insertion\n txtAddressTransmission?: string //the default non-fax address to send prescription to\n}\n\nexport interface HydratedPracticeConfigs {\n [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList\n [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox\n [PracticeConfigKind.PracticeTheme]?: PracticeConfigPracticeTheme\n [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher\n [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner\n}\n\nexport interface Practice {\n uuid: string\n name: string\n countryOperating: string\n urlPractice: string\n urlLinkedPage?: string\n urlTos?: string\n urlConfidentiality?: string\n uuidAdmin: string\n uuidDefaultAssigned: string\n uuidDefaultFallback: string\n prefDefaultLang: string\n keyGoogleTagNonProd: string\n keyGoogleTagProd: string\n txtAddress?: string\n phoneBusiness?: string\n urlSupport?: string\n emailSupport?: string\n phoneSupport?: string\n phoneFax?: string\n txtTaxID?: string\n txtVATID?: string\n txtRegistrationID?: string\n txtLegalInfos?: string\n txtDefaultTransmissionDriver?: string\n accounts?: PracticeAccount[]\n configs?: HydratedPracticeConfigs\n}\n\nexport interface Sync {\n id?: number\n status?: SyncStatus\n descriptionStep: string\n dateStarted?: Date\n dateFinished?: Date\n}\n\nexport interface PracticeEmail {\n id?: number\n uuidPractice: string\n kind: PracticeEmailKind\n idMailgunTemplate: string\n isoLanguage: string\n tags: string\n}\n\nexport interface PracticeSubscription {\n id?: number\n uuidPractice: string\n idMailChimpAudience: string\n isoLanguage: string\n}\n","import { Uuid, Base64String, Metadata } from './shared'\nimport { MetadataCategory } from './workflow'\n\nexport interface LockboxCreateResponse {\n lockboxUuid: Uuid\n}\n\nexport interface SharedSecretResponse {\n sharedSecret: Base64String\n}\n\nexport interface LockboxGrantRequest {\n granteeUuid: Uuid\n encryptedSecret: Base64String\n}\n\nexport interface LockboxDataRequest {\n publicMetadata?: Metadata\n privateMetadata?: Base64String\n data: Base64String\n}\n\nexport type LockboxManifest = ManifestEntry[]\n\nexport interface ManifestEntry {\n dataUuid: Uuid\n metadata: Metadata\n}\n\nexport interface GrantedLockboxes {\n grants: Grant[]\n}\n\nexport interface Grant {\n lockboxOwnerUuid?: Uuid\n encryptedLockbox?: Base64String\n lockboxUuid?: Uuid\n}\n\nexport interface DataCreateResponse {\n dataUuid: Uuid\n}\n\nexport interface DataResponse {\n data: Base64String\n}\n\nexport interface IndexEntry {\n uuid?: Uuid\n uniqueHash?: Base64String\n timestamp?: Date\n}\n\nexport interface IndexConsultLockbox extends IndexEntry {\n consultationId: Uuid\n grant: Grant\n}\n\nexport interface VaultIndex extends IndexEntry {\n [IndexKey.ConsultationLockbox]?: IndexConsultLockbox[] // only one should ever exist at a time\n [IndexKey.Consultation]?: IndexConsultLockbox[] // DEPRECATED REMOVE ME\n}\n\nexport interface EncryptedVaultIndex {\n [IndexKey.Consultation]?: EncryptedIndexEntry[]\n [IndexKey.ConsultationLockbox]?: EncryptedIndexEntry[]\n [IndexKey.IndexSnapshot]?: EncryptedIndexEntry[]\n}\n\nexport interface EncryptedIndexEntry extends IndexEntry {\n encryptedIndexEntry: Base64String\n}\n\nexport enum IndexKey {\n Consultation = 'Consultation', //DEPRECATED REMOVE ME\n IndexSnapshot = 'IndexSnapshot', //DEPRECATED REMOVE ME\n ConsultationLockbox = 'ConsultationLockbox'\n}\n\nexport interface Document extends ManifestEntry {\n lockboxOwnerUuid?: Uuid\n lockboxUuid: Uuid\n}\n\nexport interface Meta {\n documentType?: DocumentType\n category: MetadataCategory\n contentType?: string\n}\n\nexport interface PreferenceMeta extends Meta {\n category: MetadataCategory.Preference\n contentType: 'application/json'\n}\n\nexport interface RecoveryMeta extends Meta {\n category: MetadataCategory.Recovery\n contentType: 'application/json'\n}\n\nexport interface RawConsultationMeta extends Meta {\n category: MetadataCategory.Raw\n contentType: 'application/json'\n consultationId?: Uuid\n}\n\nexport interface ConsultationMeta extends Meta {\n documentType: DocumentType\n category: MetadataCategory.Consultation\n consultationId?: Uuid\n}\n\nexport interface ConsultationImageMeta extends ConsultationMeta {\n idbId: Uuid\n}\n\nexport interface MedicalMeta extends Meta {\n documentType:\n | DocumentType.PopulatedWorkflowData\n | DocumentType.Result\n | DocumentType.Prescription\n | DocumentType.DoctorsNote\n category: MetadataCategory.Medical\n consultationIds?: Uuid[]\n}\n\nexport interface PersonalMeta {\n documentType: DocumentType.PopulatedWorkflowData | DocumentType.Note\n category:\n | MetadataCategory.Personal\n | MetadataCategory.ChildPersonal\n | MetadataCategory.OtherPersonal\n consultationIds?: Uuid[]\n}\n\nexport enum DocumentType {\n Message = 'Message',\n Note = 'Note',\n DoctorsNote = 'DoctorsNote',\n Prescription = 'Prescription',\n ExamRequest = 'ExamRequest',\n Result = 'Result',\n Attachment = 'Attachment',\n BigFile = 'BigFile',\n MeetingRequest = 'MeetingRequest',\n AudioNote = 'AudioNote',\n VideoNote = 'VideoNote',\n PopulatedWorkflowData = 'PopulatedWorkflowData',\n TreatmentPlan = 'TreatmentPlan',\n ImageAlias = 'ImageAlias',\n}\n\nexport interface LocalizedData<T = any> {\n lockboxOwnerUuid?: string\n lockboxUuid: string\n dataUuid: string\n data: T\n}\n","export interface IndexedData<T> {\n [key: string]: T\n}\n\nexport type SelectedAnswerData = string | string[]\nexport type SelectedAnswersData = IndexedData<SelectedAnswerData>[]\n\nexport interface ChoiceInputData {\n text: string\n className?: string\n order?: number\n}\n\nexport interface RadioInputIconOptionsData {\n variant: 'icon'\n icon: string\n}\n\nexport interface RadioInputData extends ChoiceInputData {\n options?: RadioInputIconOptionsData\n}\n\nexport interface RadioCardInputData extends RadioInputData {\n bodyText: string\n}\nexport interface EntryData {\n id?: number\n label?: string\n summaryLabel?: string\n summaryHidden?: boolean\n className?: string\n triggers?: string[]\n}\n\nexport enum MetadataCategory { //these are generic metadata categories\n ChildPersonal = 'ChildPersonal',\n Consultation = 'Consultation',\n DataRetrieval = 'DataRetrieval',\n Followup = 'Followup',\n Recovery = 'Recovery',\n Medical = 'Medical',\n OtherPersonal = 'OtherPersonal',\n Personal = 'Personal',\n Preference = 'Preference',\n Prescription = 'Prescription',\n Raw = 'Raw',\n}\n\nexport interface GenericQuestionData<T, A = IndexedData<ChoiceInputData>>\n extends EntryData {\n kind: T\n metaCategory: MetadataCategory\n answers?: A\n formValidation?: any[] // use yup-ast expressions\n placeholder?: string\n defaultValue?: any\n value?: string\n}\n\nexport interface GroupedGenericQuestionData<\n T,\n A = IndexedData<ChoiceInputData>\n> extends GenericQuestionData<T, A> {\n inline?: boolean\n inlineLabel?: boolean\n order?: number\n}\n\nexport type QuestionData =\n | GenericQuestionData<'title' | 'paragraph' | 'checkbox', void>\n | GenericQuestionData<\n | 'text'\n | 'date'\n | 'number'\n | 'images'\n | 'images-alias'\n | 'body-parts'\n | 'pharmacy-picker'\n | 'place-address'\n >\n | GenericQuestionData<\n 'checkbox-group' | 'select' | 'multiple',\n IndexedData<ChoiceInputData>\n >\n | GroupedGenericQuestionData<'radio', IndexedData<RadioInputData>>\n | GroupedGenericQuestionData<'radio-card', IndexedData<RadioCardInputData>>\n\nexport interface FieldData {\n type: 'field'\n className?: string\n id: string\n}\n\nexport interface FieldGroupData {\n type: 'field-group'\n className?: string\n fieldsAndGroups: (FieldData | FieldGroupData)[]\n name?: string\n inline?: boolean\n fullWidth?: boolean\n}\n\nexport interface WorkflowPageData {\n className?: string\n groups?: FieldGroupData[]\n highlightMsg?: string\n questions: IndexedData<QuestionData>\n title?: string\n triggers?: string[]\n}\n\nexport interface WorkflowData {\n createdAt: string\n culDeSacs: EntryData[]\n id: string\n locale?: string\n pages: WorkflowPageData[]\n summaryImageFieldName?: string // this field is used to show the consult summary image\n summarySymptomsFieldName?: string // this field is used to show the consult summary symptoms\n selectedAnswers?: SelectedAnswersData\n}\n\n/**\n * This interface describes a workflow prepared and ready to be sent to vault\n */\nexport interface WorkflowUploadedImage {\n idbId?: string\n name: string\n imageData?: string\n}\nexport interface PopulatedWorkflowField {\n answer: SelectedAnswerData | WorkflowUploadedImage[] // Actual answer from the workflow\n displayedAnswer?: any // This answer is to be used only when it's impossible to get data from workflow\n kind: string // If we don't store question. We will need that field to at least know the field type\n}\n\nexport interface PopulatedWorkflowData {\n workflowId: string // The workflow id to refer\n workflowCreatedAt: string // The workflow version\n locale?: string\n fields: Record<string, PopulatedWorkflowField> // key corresponds to the QuestionData key in the workflow\n}\n","import { APIService } from './api'\nimport {\n Uuid,\n Consult,\n ConsultRequest,\n MedicalStatus,\n ConsultTransmission,\n TransmissionKind,\n TransmissionStatus,\n} from '../models'\n// import FormData from \"form-data\"\n\nexport class ConsultService {\n constructor(private api: APIService, private baseURL: string) {}\n\n public consultCreate(c: ConsultRequest): Promise<Consult> {\n return this.api.post<Consult>(`${this.baseURL}/v1/consults`, c)\n }\n\n /**\n * This function returns the number of consults using parameters\n * @param uuidPractice the practice uuid\n * @param uuidRequester the requester uuid\n * @param statusesMedical an array containing MedicalStatus to include\n * @param statusesExclude an array containing MedicalStatus to exclude\n * @param shortId a shortId matcher (will match all consult with a shortId starting with this `shortId`)\n * @param columnToSortTo the list of columns separated by commas, to sort to (in order of sorting)\n * @param orderToSortTo the type of sorting to do ('asc' for ascending or 'desc' for descending)\n * @param perPage the number of item to retrieve per \"page\"\n * @param indexPage the actual index of the page to retrieve (0 based: 0 is the first items)\n * @param filterAssignedDoctor the uuid of the doctor for which to filter with\n * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with\n * @param filterIsoLocality the of isoLocality to filter with\n * @returns a number of consult\n */\n public countConsults(\n uuidPractice?: Uuid,\n uuidRequester?: Uuid,\n statusesMedical?: MedicalStatus[],\n statusesExclude?: MedicalStatus[],\n shortId?: string,\n columnToSortTo?: string[],\n orderToSortTo?: string[],\n perPage?: number,\n indexPage?: number,\n filterAssignedDoctor?: string,\n filterCurrentPractitioner?: string,\n filterIsoLocality?: string[]\n ): Promise<number> {\n return this.api\n .head<any>(\n `${this.baseURL}/v1/consults`,\n {\n params: {\n uuidPractice,\n uuidRequester,\n statusesMedical,\n statusesExclude,\n shortId,\n perPage,\n page: indexPage,\n sortColumns: columnToSortTo,\n orderColumns: orderToSortTo,\n filterAssignedDoctor,\n filterCurrentPractitioner,\n filterIsoLocality,\n },\n },\n 'Content-Range'\n )\n .then((resContentRange) => {\n if (\n !resContentRange ||\n (typeof resContentRange !== 'string' &&\n typeof resContentRange !== 'number')\n ) {\n return 0\n }\n\n if (typeof resContentRange === 'number') {\n return resContentRange\n }\n\n return parseInt(resContentRange)\n })\n }\n\n /**\n * This function get consults using parameters\n * @param uuidPractice the practice uuid\n * @param uuidRequester the requester uuid\n * @param statusesMedical an array containing MedicalStatus to include\n * @param statusesExclude an array containing MedicalStatus to exclude\n * @param shortId a shortId matcher (will match all consult with a shortId starting with this `shortId`)\n * @param columnToSortTo the list of columns separated by commas, to sort to (in order of sorting)\n * @param orderToSortTo the type of sorting to do ('asc' for ascending or 'desc' for descending)\n * @param perPage the number of item to retrieve per \"page\"\n * @param indexPage the actual index of the page to retrieve (0 based: 0 is the first items)\n * @param filterAssignedDoctor the uuid of the doctor for which to filter with\n * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with\n * @param filterIsoLocality the of isoLocality to filter with\n * @returns a list of consult\n */\n public getConsults(\n uuidPractice?: Uuid,\n uuidRequester?: Uuid,\n statusesMedical?: MedicalStatus[],\n statusesExclude?: MedicalStatus[],\n shortId?: string,\n columnToSortTo?: string[],\n orderToSortTo?: string[],\n perPage?: number,\n indexPage?: number,\n filterAssignedDoctor?: string,\n filterCurrentPractitioner?: string,\n filterIsoLocality?: string[]\n ): Promise<Consult[]> {\n return this.api.get<Consult[]>(`${this.baseURL}/v1/consults`, {\n params: {\n uuidPractice,\n uuidRequester,\n statusesMedical,\n statusesExclude,\n shortId,\n perPage,\n page: indexPage,\n sortColumns: columnToSortTo,\n orderColumns: orderToSortTo,\n filterAssignedDoctor,\n filterCurrentPractitioner,\n filterIsoLocality,\n },\n })\n }\n\n public getConsultByUUID(\n uuidConsult: Uuid,\n uuidPractice?: Uuid\n ): Promise<Consult> {\n return this.api.get<Consult>(\n `${this.baseURL}/v1/consults/${uuidConsult}`,\n { params: { uuidPractice } }\n )\n }\n\n public updateConsultByUUID(\n uuidConsult: Uuid,\n consult: {\n statusMedical?: MedicalStatus\n uuidAssignedDoctor?: Uuid\n neverExpires?: boolean\n },\n uuidPractice?: Uuid,\n uuidRequester?: Uuid\n ): Promise<Consult> {\n return this.api.put<Consult>(\n `${this.baseURL}/v1/consults/${uuidConsult}`,\n consult,\n {\n params: {\n uuidPractice,\n uuidRequester,\n },\n }\n )\n }\n\n public getConsultFaxStatuses(\n uuidConsult: string\n ): Promise<ConsultTransmission[]> {\n return this.api.get<ConsultTransmission[]>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions`,\n {\n params: {\n kind: TransmissionKind.Fax,\n },\n }\n )\n }\n\n public postConsultTransmission(\n uuidConsult: string,\n nameDriver: string = 'Documo',\n addressOrPhoneToSendTo?: string,\n file?: File,\n nameReceiver?: string,\n txtTransmissionTitle?: string,\n txtTransmissionNotes?: string\n // numTry ?: number,\n // delay ?: number,\n ): Promise<ConsultTransmission> {\n let data = new FormData()\n\n data.append('nameDriverReceiver', nameDriver)\n if (addressOrPhoneToSendTo) {\n data.append('addressReceiver', addressOrPhoneToSendTo)\n }\n if (file) {\n data.append('file', file)\n }\n if (nameReceiver) {\n data.append('nameReceiver', nameReceiver)\n }\n if (txtTransmissionTitle) {\n data.append('txtTransmissionTitle', txtTransmissionTitle)\n }\n if (txtTransmissionNotes) {\n data.append('txtTransmissionNotes', txtTransmissionNotes)\n }\n\n return this.api.post<ConsultTransmission>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions`,\n data,\n {\n headers: { 'Content-Type': 'multipart/form-data;' },\n }\n )\n }\n\n public postConsultFax(\n uuidConsult: string,\n addressReceiver: string,\n file: File\n ): Promise<ConsultTransmission> {\n return this.postConsultTransmission(\n uuidConsult,\n 'Documo',\n addressReceiver,\n file\n )\n }\n\n public postConsultEmail(\n uuidConsult: string,\n file: File\n ): Promise<ConsultTransmission> {\n return this.postConsultTransmission(\n uuidConsult,\n 'Pharmacierge',\n undefined,\n file\n )\n }\n\n public retryConsultFax(\n uuidConsult: string,\n transmissionId: string\n ): Promise<ConsultTransmission> {\n return this.api.put<ConsultTransmission>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions/${transmissionId}`,\n { status: TransmissionStatus.Retrying }\n )\n }\n\n public updateConsultTransmissionStatus(\n transmissionId: string,\n uuidConsult: string,\n newStatus: TransmissionStatus\n ): Promise<ConsultTransmission> {\n return this.api.put<ConsultTransmission>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions/${transmissionId}`,\n { status: newStatus }\n )\n }\n}\n","import {\n Drug,\n TreatmentPlan,\n TreatmentPlans,\n TreatmentPlansRequest,\n TreatmentPlansResponse,\n Uuid,\n} from '..'\nimport { Diagnosis, Treatment, DiagnosisRequest, TreatmentRequest, TreatmentAndDrugPrescriptionUpdateRequest } from '../models/diagnosis'\nimport { APIService } from './api'\n\nexport class DiagnosisService {\n constructor(private api: APIService, private baseURL: string) {}\n\n public getDiagnoses(): Promise<Diagnosis[]> {\n return this.api.get<Diagnosis[]>(`${this.baseURL}/v1/diagnoses`)\n }\n\n /**\n * Get a diagnosis by uuid that belongs to your practice\n * @param uuidDiagnosis the uuid of the diagnosis\n * @returns a diagnosis\n */\n public getDiagnosisByUuid(uuidDiagnosis: Uuid): Promise<Diagnosis> {\n return this.api.get<Diagnosis>(\n `${this.baseURL}/v1/diagnoses/${uuidDiagnosis}`\n )\n }\n\n public createDiagnosis(diagnosis: DiagnosisRequest): Promise<Diagnosis> {\n return this.api.post<Diagnosis>(\n `${this.baseURL}/v1/diagnoses`,\n diagnosis\n )\n }\n\n public updateDiagnosis(\n uuid: string,\n diagnosis: DiagnosisRequest\n ): Promise<Diagnosis> {\n return this.api.put<Diagnosis>(\n `${this.baseURL}/v1/diagnoses/${uuid}`,\n diagnosis\n )\n }\n\n public getTreatmentsFromDiagnosisUuid(\n diagnosisUuid: Uuid\n ): Promise<Treatment[]> {\n return this.api.get<Treatment[]>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`\n )\n }\n\n /**\n * This function returns treatment plans associated to a consult\n * @param uuidConsult the consult uuid to fetch\n * @returns an array of TreatmentPlan\n */\n public getTreatmentPlansFromConsultUuid(\n uuidConsult: Uuid\n ): Promise<TreatmentPlan[]> {\n return this.api.get<TreatmentPlan[]>(\n `${this.baseURL}/v1/treatment-plans/`,\n { params: { uuidConsult } }\n )\n }\n\n /**\n * creates a new treatment for the diagnosis specified\n * @param diagnosisUuid uuid of the diagnosis that is linked to the treatment\n * @param treatmentRequest the treatment to be inserted\n */\n public createTreatment(diagnosisUuid: string, treatmentRequest: TreatmentRequest) {\n return this.api.post<Treatment>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`,\n treatmentRequest\n )\n }\n\n /**\n * This function returns populated treatment plans associated to a consult\n * @param uuidConsult the consult uuid to fetch\n * @returns a TreatmentPlans object\n */\n public getTreatmentPlansPopulatedFromConsultUuid(\n uuidConsult: Uuid\n ): Promise<TreatmentPlans> {\n return this.api.get<TreatmentPlans>(\n `${this.baseURL}/v1/treatment-plans/`,\n { params: { uuidConsult, populated: true } }\n )\n }\n\n public postPlans(\n plans: TreatmentPlansRequest\n ): Promise<TreatmentPlansResponse> {\n return this.api.post<TreatmentPlansResponse>(\n `${this.baseURL}/v1/treatment-plans`,\n plans\n )\n }\n\n public updateTreatmentPlan(\n uuidPlan: string,\n uuidConsult: string,\n diagnosisRequest: DiagnosisRequest,\n plan: TreatmentAndDrugPrescriptionUpdateRequest\n ): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(\n `${this.baseURL}/v1/treatment-plans/${uuidPlan}`,\n {\n uuidConsult,\n diagnosis: diagnosisRequest,\n plan\n }\n )\n }\n\n public acceptTreatmentPlan(\n uuidPlan: string,\n uuidConsult: string\n ): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(\n `${this.baseURL}/v1/treatment-plans/${uuidPlan}/accept`,\n { uuidConsult }\n )\n }\n\n /**\n * retrieves all the drugs of the specified practice\n * @param uuidPractice\n */\n public async getAllDrugs(\n uuidPractice: string\n ): Promise<Drug[] | undefined> {\n const res = await this.api.get<{foundDrugs: Drug[]}>(\n `${this.baseURL}/v1/drugs/practice/${uuidPractice}`,\n )\n if(res && res.foundDrugs)\n return res.foundDrugs\n return undefined\n }\n}\n","import { APIService } from './api'\nimport type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh'\nimport {\n AuthTokenRequest,\n AuthTokenResponse,\n AuthRecoverRequest,\n IdentityCreateRequest,\n IdentityUpdateRequest,\n IdentityResponse,\n QRCodeRequest,\n QRCodeResponse,\n Uuid,\n WhoAmIResponse,\n Base64String,\n AuthenticationFailed,\n IdentityCreationFailed,\n AuthenticationBadRequest,\n AuthenticationServerError,\n IdentityCreationBadRequest,\n IdentityCreationConflict,\n Tokens\n} from '../models'\nimport { AxiosError } from 'axios'\n\nexport interface GuardRequestConfig extends AxiosAuthRefreshRequestConfig {\n useRefreshToken : boolean\n}\nexport class GuardService {\n private identityCache: Record<string, IdentityResponse>\n private whoAmICache: Record<string, WhoAmIResponse>\n\n constructor(private api: APIService, private baseURL: string) {\n this.api.setAuthRefreshFn(this.authRefresh.bind(this))\n this.identityCache = {}\n this.whoAmICache = {}\n }\n\n /**\n * Will replace access and refresh tokens with `tokens`\n * \n * Note: \n * ```typescript\n * setTokens({accessToken: undefined, refreshToken: 'aTokenValue'}) // will erase accessToken and set refreshToken with 'aTokenValue'\n * setTokens({refreshToken: 'aTokenValue'}) // will keep actual value of accessToken and set refreshToken with 'aTokenValue'\n * \n * ```\n * @param tokens\n */\n public setTokens(tokens: Tokens) {\n this.api.setTokens({...this.api.getTokens() , ...tokens })\n }\n\n /**\n * Allow to retrieve an access token and a refresh token in order\n * to do authenticated request afterward\n *\n * @param req The credentials required to get an access token\n * @returns AuthTokenResponse\n */\n public async authToken(req: AuthTokenRequest): Promise<AuthTokenResponse> {\n let resp : AuthTokenResponse\n\n try {\n let config: AxiosAuthRefreshRequestConfig = {\n skipAuthRefresh: true\n }\n\n resp = await this.api.post<AuthTokenResponse>(`${this.baseURL}/v1/auth/token`, req, config)\n\n this.api.setTokens({\n accessToken: resp.accessToken,\n refreshToken: resp.refreshToken\n })\n } catch(e) {\n if((e as any).isAxiosError){\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new AuthenticationBadRequest()\n case 500:\n throw new AuthenticationServerError()\n case 401:\n default:\n throw new AuthenticationFailed()\n }\n }\n throw new AuthenticationFailed()\n\n }\n return resp\n }\n\n /**\n * Get new access and refresh token\n *\n * @returns AuthTokenResponse\n */\n public async authRefresh(refreshToken?: string): Promise<AuthTokenResponse> {\n let config: GuardRequestConfig = {\n skipAuthRefresh: true,\n useRefreshToken: true\n }\n return this.api.put<AuthTokenResponse>(`${this.baseURL}/v1/auth/token`, null, config)\n }\n\n\n /**\n * Call guard to overwrite existing refresh token cookie\n *\n * @returns void\n */\n public async authLogout(): Promise<void> {\n return this.api.get<void>(`${this.baseURL}/v1/auth/logout`)\n }\n\n\n /**\n * Call guard to attempt account recovery\n *\n * @param req The email address / practice of the account to recover\n * @returns void\n */\n public async authRecover(req: AuthRecoverRequest): Promise<void> {\n return this.api.post<void>(`${this.baseURL}/v1/auth/recover`, req)\n }\n\n\n /**\n * Allow to create a new identity. The identity will then need to be confirmed\n * via an email link\n *\n * @param req the information about the new identity to create\n * @returns IdentityResponse\n */\n public async identityCreate(req: IdentityCreateRequest): Promise<IdentityResponse> {\n let resp : IdentityResponse\n\n try {\n resp = await this.api.post<IdentityResponse>(`${this.baseURL}/v1/identities`, req)\n this.api.setTokens({\n refreshToken: resp.refreshToken\n })\n } catch (e) {\n if((e as any).isAxiosError){\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new IdentityCreationBadRequest()\n case 409:\n throw new IdentityCreationConflict()\n case 500:\n default:\n throw new IdentityCreationFailed()\n }\n }\n throw new IdentityCreationFailed()\n }\n return resp\n }\n\n\n /**\n * Retrieve an identity. Will return public fields only when requested\n * without authentication\n *\n * @param identityID Unique id of the identity to retrieve\n * @returns IdentityResponse\n */\n public async identityGet(\n identityID: Uuid\n ): Promise<IdentityResponse> {\n const tokens = this.api.getTokens()\n const cacheKey = (tokens.accessToken ?? '') + (tokens.refreshToken ?? '') + identityID\n\n if (!tokens.accessToken || !this.identityCache[cacheKey]) {\n this.identityCache[cacheKey] = await this.api.get<IdentityResponse>(\n `${this.baseURL}/v1/identities/${identityID}`\n )\n }\n return this.identityCache[cacheKey]\n }\n\n\n /**\n * Get information about the current authenticated user\n *\n * @param refreshCache if true it will refresh the whoAmI cache (default: false)\n * @returns WhoAmIResponse\n */\n public async whoAmI(refreshCache: boolean = false): Promise<WhoAmIResponse> {\n const cacheKey = this.api.getTokens().accessToken ?? ''\n if (!this.whoAmICache[cacheKey] || refreshCache) {\n this.whoAmICache[cacheKey] = await this.api.get<WhoAmIResponse>(`${this.baseURL}/v1/auth/whoami`)\n }\n return this.whoAmICache[cacheKey]\n }\n\n /**\n * Update an existing identity\n *\n * @param identityID unique id of identity to update\n * @param req update request\n * @returns IdentityResponse\n */\n public async identityUpdate(\n identityID: Uuid,\n req: IdentityUpdateRequest\n ): Promise<IdentityResponse> {\n return this.api.put<IdentityResponse>(`${this.baseURL}/v1/identities/${identityID}`, req)\n }\n\n /**\n * Return base64 data representing a QR code that the\n * current identity need in order to use MFA\n *\n * @param identityID unique id of the identity\n * @param password the identity password (already hashed and in base64)\n * @returns QRCodeResponse\n */\n public async identityMFAQRCode(\n identityID: Uuid,\n password: Base64String\n ): Promise<QRCodeResponse> {\n const req: QRCodeRequest = { password }\n return this.api.post<QRCodeResponse>(`${this.baseURL}/v1/identities/${identityID}/mfa`, req, { headers: { 'Accept': 'application/json' } })\n }\n}\n\n","import * as OroToolbox from 'oro-toolbox'\nimport { PracticeAccount, Uuid } from '../models'\nimport {\n Assignment,\n PlanType,\n Practice,\n PracticeConfigs,\n PracticeConfigKind,\n PracticePayment,\n PracticePaymentIntent,\n PracticePlan,\n PracticePlanPrices,\n PracticeWorkflow,\n PracticeWorkflowWithTagSpecialty,\n Practitioner,\n PractitionerLicense,\n PractitionerPreference,\n PractitionerQuota,\n PractitionerRole,\n WorkflowType,\n} from '../models/practice'\nimport { APIService } from './api'\n\nexport class PracticeService {\n constructor(\n private toolbox: typeof OroToolbox,\n private api: APIService,\n private baseURL: string\n ) {}\n\n /**\n * This function get the practice from the URL of a practice\n * It is the entry point of our web apps\n * @param practiceURL URL of the practice to search\n * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set\n * @param accounts (optional) if set true it the Practice field accounts will be set\n * @returns the found practice or undefined\n */\n public practiceGetFromURL(\n practiceURL: string,\n params?: {\n hydratePracticeConfigs?: boolean\n accounts?: boolean\n }\n ): Promise<Practice | undefined> {\n return this.api.get<Practice | undefined>(\n `${this.baseURL}/v1/practices`,\n {\n params: {\n url_practice: practiceURL,\n ...params,\n },\n }\n )\n }\n\n public practiceGetFromUuid(\n practiceUuid: Uuid,\n locale?: string,\n withAccounts?: boolean\n ): Promise<Practice> {\n return this.api.get<Practice>(\n `${this.baseURL}/v1/practices/${practiceUuid}`,\n { params: { locale, accounts: withAccounts } }\n )\n }\n\n /// Practice Configs\n\n /**\n * This function retrieves all configs of a specific practice\n * @param practiceUuid uuid of the practice\n * @returns the practice configs\n */\n public practiceConfigGetFromPracticeUuid(\n practiceUuid: Uuid\n ): Promise<PracticeConfigs[]> {\n return this.api.get<PracticeConfigs[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/configs`\n )\n }\n\n /**\n * This function retrieves a specific config of a practice\n * @param practiceUuid uuid of the practice\n * @param kind of the config\n * @returns the practice config\n */\n public practiceConfigGetByKindForPracticeUuid(\n practiceUuid: Uuid,\n kind: PracticeConfigKind\n ): Promise<PracticeConfigs> {\n return this.api.get<PracticeConfigs>(\n `${this.baseURL}/v1/practices/${practiceUuid}/configs/${kind}`\n )\n }\n\n /**\n * This function creates a config for a specific practice\n * @param practiceUuid uuid of the practice\n * @param config the config to add to the practice\n * @returns the created practice config\n */\n public practiceConfigCreateForPracticeUuid(\n practiceUuid: Uuid,\n config: PracticeConfigs\n ): Promise<PracticeConfigs> {\n return this.api.post<PracticeConfigs>(\n `${this.baseURL}/v1/practices/${practiceUuid}/configs`,\n config\n )\n }\n\n /**\n * This function updates a specific config of a practice\n * @param practiceUuid uuid of the practice\n * @param config the config to update\n * @returns the practice config\n */\n public practiceConfigUpdate(\n config: PracticeConfigs\n ): Promise<PracticeConfigs> {\n return this.api.put<PracticeConfigs>(\n `${this.baseURL}/v1/practices/${config.uuidPractice}/configs/${config.kind}`,\n config\n )\n }\n\n /// Accounts\n public practiceGetAccounts(practiceUuid: Uuid): Promise<PracticeAccount[]> {\n return this.api.get<PracticeAccount[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/accounts`\n )\n }\n\n public practiceGetAccount(\n practiceUuid: Uuid,\n accountUuid: Uuid\n ): Promise<PracticeAccount> {\n return this.api.get<PracticeAccount>(\n `${this.baseURL}/v1/practices/${practiceUuid}/accounts/${accountUuid}`\n )\n }\n\n /// Workflows\n public practiceGetWorkflows(\n practiceUuid: Uuid\n ): Promise<PracticeWorkflow[]> {\n return this.api.get<PracticeWorkflow[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/workflows`\n )\n }\n\n public practiceGetWorkflow(\n practiceUuid: Uuid,\n workflowType: WorkflowType\n ): Promise<PracticeWorkflowWithTagSpecialty> {\n return this.api.get<PracticeWorkflowWithTagSpecialty>(\n `${this.baseURL}/v1/practices/${practiceUuid}/workflows/${workflowType}`\n )\n }\n\n /// Plans\n public practiceGetPlans(\n practiceUuid: Uuid,\n planType?: PlanType\n ): Promise<PracticePlan[]> {\n return this.api.get<PracticePlan[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/plans`,\n { params: { kind: planType } }\n )\n }\n\n public practiceGetPlan(\n practiceUuid: Uuid,\n planId: number\n ): Promise<PracticePlan> {\n return this.api.get<PracticePlan>(\n `${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}`\n )\n }\n\n public practiceGetPlanPrices(\n practiceUuid: Uuid,\n planId: number\n ): Promise<PracticePlanPrices> {\n return this.api.get<PracticePlanPrices>(\n `${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}/prices`\n )\n }\n\n // Payments\n public practiceGetPayments(\n practiceUuid: Uuid,\n planType?: PlanType\n ): Promise<PracticePayment[]> {\n return this.api.get<PracticePayment[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments`,\n { params: { kind: planType } }\n )\n }\n\n public practiceGetPayment(\n practiceUuid: Uuid,\n idStripeInvoiceOrPaymentIntent: string\n ): Promise<PracticePayment> {\n return this.api.get<PracticePayment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/${idStripeInvoiceOrPaymentIntent}`\n )\n }\n\n public practiceGetPaymentForStripePaymentIntentWithID(\n practiceUuid: Uuid,\n stripePaymentIntentId: number\n ): Promise<PracticePayment> {\n return this.api.get<PracticePayment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/${stripePaymentIntentId}`\n )\n }\n\n // Payments Intent\n public practiceGetPaymentsIntents(\n practiceUuid: Uuid,\n planType?: PlanType\n ): Promise<PracticePaymentIntent[]> {\n return this.api.get<PracticePaymentIntent[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents`,\n { params: { kind: planType } }\n )\n }\n\n /**\n * This function return the user hased email to be use for creating payment intent\n * @param email the email to hash\n * @returns a hashed email\n */\n public getPaymentIntentHashedEmail(email: string): string {\n return this.toolbox.hashStringToBase64(email.toLowerCase())\n }\n\n public practiceCreatePaymentsIntent(\n practiceUuid: Uuid,\n planId: number,\n userEmail: string,\n isoLocality?: string,\n url_subdomain?: string,\n promotionCode?: string\n ): Promise<PracticePaymentIntent> {\n return this.api.post<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/`,\n {\n idPlan: planId,\n hashUserEmail: userEmail\n ? this.getPaymentIntentHashedEmail(userEmail)\n : undefined,\n isoLocality,\n },\n { params: { url_subdomain, promotionCode } }\n )\n }\n\n public practiceGetPaymentsIntent(\n practiceUuid: Uuid,\n paymentIntentId: number\n ): Promise<PracticePaymentIntent> {\n return this.api.get<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${paymentIntentId}`\n )\n }\n\n public practiceUpdatePaymentsIntent(\n practiceUuid: string,\n idPraticePaymentIntent: number,\n practicePaymentIntent: PracticePaymentIntent,\n userEmail: string,\n promotionCode?: string\n ) {\n return this.api.put<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${idPraticePaymentIntent}`,\n {\n ...practicePaymentIntent,\n hashUserEmail: userEmail\n ? this.getPaymentIntentHashedEmail(userEmail)\n : undefined,\n },\n { params: { promotionCode } }\n )\n }\n\n // Practitioner\n public practiceGetPractitioners(\n practiceUuid: Uuid\n ): Promise<Practitioner[]> {\n return this.api.get<Practitioner[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners`\n )\n }\n\n public practiceUpdatePractitioner(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: Practitioner\n ): Promise<Practitioner> {\n return this.api.put<Practitioner>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}`,\n requestBody\n )\n }\n\n public practiceGetPractitioner(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<Practitioner> {\n return this.api.get<Practitioner>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}`\n )\n }\n\n // Practitioner Licenses\n public practiceGetPractitionerLicenses(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<PractitionerLicense[]> {\n return this.api.get<PractitionerLicense[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses`\n )\n }\n\n public practiceCreatePractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerLicense\n ): Promise<PractitionerLicense> {\n return this.api.post<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses`,\n requestBody\n )\n }\n\n public practiceUpdatePractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n licenseId: number,\n requestBody: PractitionerLicense\n ): Promise<PractitionerLicense> {\n return this.api.put<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses/${licenseId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n licenseId: number\n ): Promise<PractitionerLicense> {\n return this.api.get<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses/${licenseId}`\n )\n }\n\n // Practitioner Preferences\n public practiceGetPractitionerPreferences(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<PractitionerPreference[]> {\n return this.api.get<PractitionerPreference[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences`\n )\n }\n\n public practiceCreatePractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerPreference\n ): Promise<PractitionerPreference> {\n return this.api.post<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences`,\n requestBody\n )\n }\n\n public practiceUpdatePractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n preferenceId: number,\n requestBody: PractitionerPreference\n ): Promise<PractitionerPreference> {\n return this.api.put<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences/${preferenceId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n preferenceId: number\n ): Promise<PractitionerPreference> {\n return this.api.get<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences/${preferenceId}`\n )\n }\n\n // Practitioner Roles\n public practiceGetPractitionerRoles(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<PractitionerRole[]> {\n return this.api.get<PractitionerRole[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`\n )\n }\n\n public practiceCreatePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerRole\n ): Promise<PractitionerRole> {\n return this.api.post<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`,\n requestBody\n )\n }\n\n public practiceDeletePractitionerRoles(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<PractitionerRole> {\n return this.api.deleteRequest<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`\n )\n }\n\n public practiceUpdatePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number,\n requestBody: PractitionerRole\n ): Promise<PractitionerRole> {\n return this.api.put<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number\n ): Promise<PractitionerRole> {\n return this.api.get<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`\n )\n }\n\n public practiceDeletePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number\n ): Promise<PractitionerRole> {\n return this.api.deleteRequest<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`\n )\n }\n\n // Practitioner signature\n\n /**\n * This function returns the practitioner's signature as a Blob\n * @param practiceUuid the practice uuid of the practitioner\n * @param practitionerUuid the practitioner uuid\n * @returns a blob representing the signature\n */\n public practiceGetPractitionerSignature(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<Blob> {\n return this.api.get<Blob>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/signature`,\n { responseType: 'blob' }\n )\n }\n\n // Assignments\n public practiceGetAssignments(practiceUuid: Uuid): Promise<Assignment[]> {\n return this.api.get<Assignment[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/assignments`\n )\n }\n\n public practiceCreateAssignment(\n practiceUuid: Uuid,\n requestBody: Assignment\n ): Promise<Assignment> {\n return this.api.post<Assignment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/assignments`,\n requestBody\n )\n }\n\n public practiceUpdateAssignment(\n practiceUuid: Uuid,\n assignmentId: number,\n requestBody: Assignment\n ): Promise<Assignment> {\n return this.api.put<Assignment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`,\n requestBody\n )\n }\n\n public practiceGetAssignment(\n practiceUuid: Uuid,\n assignmentId: number\n ): Promise<Assignment> {\n return this.api.get<Assignment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`\n )\n }\n\n // Quotas\n public practiceGetQuotas(practiceUuid: Uuid): Promise<PractitionerQuota[]> {\n return this.api.get<PractitionerQuota[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/quotas`\n )\n }\n\n public practiceGetQuota(\n practiceUuid: Uuid,\n quotaId: number\n ): Promise<PractitionerQuota> {\n return this.api.get<PractitionerQuota>(\n `${this.baseURL}/v1/practices/${practiceUuid}/quotas/${quotaId}`\n )\n }\n}\n","import { APIService } from './api'\nimport { Consult, DataCreateResponse, LockboxDataRequest, MedicalStatus, Uuid } from '../models'\nexport class TellerService {\n constructor(private api: APIService, private baseURL: string) { }\n\n public async lockboxDataStore(\n lockboxUuid: Uuid,\n req: LockboxDataRequest,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`,\n req,\n {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n },\n }\n )\n }\n\n public updateConsultByUUID(\n patientUuid: Uuid,\n uuidConsult: Uuid,\n statusMedical: MedicalStatus,\n neverExpires?: boolean,\n ): Promise<Consult> {\n return this.api.put<Consult>(\n `${this.baseURL}/v1/consults/${uuidConsult}`,\n {\n patientUuid,\n statusMedical,\n neverExpires,\n },\n )\n }\n}\n","import { APIService } from './api'\nimport {\n DataCreateResponse,\n DataResponse,\n GrantedLockboxes,\n LockboxCreateResponse,\n LockboxDataRequest,\n LockboxGrantRequest,\n LockboxManifest,\n SharedSecretResponse,\n Uuid,\n EncryptedVaultIndex,\n IndexKey,\n EncryptedIndexEntry\n} from '../models'\n\nexport class VaultService {\n constructor(private api: APIService, private baseURL: string) { }\n\n public async lockboxCreate(lockboxMetadata?: Object): Promise<LockboxCreateResponse> {\n return this.api.post<LockboxCreateResponse>(\n `${this.baseURL}/v1/lockbox`,\n lockboxMetadata\n )\n }\n\n public async lockboxMetadataAdd(\n lockboxUuid: Uuid,\n lockboxMetadata: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<LockboxCreateResponse> {\n return this.api.put<LockboxCreateResponse>(\n `${this.baseURL}/v1/lockbox/${lockboxUuid}`,\n lockboxMetadata,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n public async lockboxSecretGet(\n lockboxUuid: Uuid,\n lockboxOwnerUuid?: Uuid\n ): Promise<SharedSecretResponse> {\n return this.api.get<SharedSecretResponse>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/secret`,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n public async lockboxGrant(\n lockboxUuid: Uuid,\n req: LockboxGrantRequest,\n lockboxOwnerUuid?: Uuid\n ): Promise<void> {\n return this.api.post<void>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/grant`,\n req,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n /**\n * Get all lockboxes granted to user\n * @param filter filter of lockbox metadata\n * @returns decrypted lockboxes granted to user\n */\n public async grantsGet(): Promise<GrantedLockboxes> {\n return this.api.get<GrantedLockboxes>(`${this.baseURL}/v1/grants`)\n }\n\n /**\n * This function create or update a data into the vault.\n * @note At creation it is necessary to have all `req` filled\n * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.\n * @param lockboxUuid The lockbox uuid the data will be stored in\n * @param req The request (please see notes)\n * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)\n * @param previousDataUuid The data uuid of the data you want to update\n * @returns \n */\n public async lockboxDataStore(\n lockboxUuid: Uuid,\n req: LockboxDataRequest,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`,\n req,\n {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n },\n }\n )\n }\n\n public async lockboxDataGet(\n lockboxUuid: Uuid,\n dataUuid: Uuid,\n lockboxOwnerUuid?: Uuid,\n stream: boolean = true\n ): Promise<DataResponse> {\n let data = await this.api.get(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data/${dataUuid}`,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid, stream } }\n )\n\n // returned as stream, we need to put inside a DataResponse object\n if (stream)\n return { data }\n\n return data\n }\n\n public async lockboxManifestGet(\n lockboxUuid: Uuid,\n filter?: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<LockboxManifest> {\n return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}`, {\n params: { lockbox_owner_uuid: lockboxOwnerUuid, filter },\n })\n }\n\n public async lockboxMetadataGet(\n lockboxUuid: Uuid,\n fields: string[],\n groupby: string[],\n filter?: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<any[]> {\n return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/metadata`, {\n params: { lockbox_owner_uuid: lockboxOwnerUuid, fields, groupby, filter },\n })\n }\n\n /**\n * inserts or updates encrypted index entries\n * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`\n * @note if a uuid for an entry is provided, the service will perform an update\n * @param entries the encrypted index data\n * @param indexOwnerUuid\n */\n public async vaultIndexPut(entries: EncryptedVaultIndex, indexOwnerUuid?: Uuid): Promise<void> {\n return this.api.put(`${this.baseURL}/v1/index`,\n entries,\n {\n params: {\n index_owner_uuid: indexOwnerUuid,\n },\n }\n )\n }\n\n /**\n * inserts or updates index snapshot for the provided index owner\n * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`\n * @param entry the encrypted index snapshot\n */\n public async vaultIndexSnapshotPut(entry: EncryptedIndexEntry): Promise<void> {\n return this.api.put(`${this.baseURL}/v1/index-snapshot`, entry)\n }\n\n /**\n * Retrieves the encrypted index from the vault for the requesting user\n * @note index keys can be specified to narrow the scope of index being requested\n * @param indexKeys accepted index fields determined by vault\n * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry\n * @param timestamp the minimum timestamp that index entries were created\n * @returns the encrypted index\n */\n public async vaultIndexGet(indexKeys: IndexKey[], identifiers?: string[], timestamp?: Date): Promise<EncryptedVaultIndex> {\n return this.api.get<EncryptedVaultIndex>(`${this.baseURL}/v1/index`, {\n params: { index_keys: indexKeys, identifiers, timestamp },\n })\n }\n}\n","import { WorkflowData } from '../models/workflow'\nimport { APIService } from './api'\n\nexport class WorkflowService {\n private v1Url: string\n\n constructor(private api: APIService, url: string) {\n this.v1Url = `${url}/v1`\n }\n\n /**\n * This function returns all workflows\n * @returns desired workflow\n */\n public getWorkflows(): Promise<WorkflowData[]> {\n return this.api.get<WorkflowData[]>(`${this.v1Url}/workflows`)\n }\n\n /**\n * This function retrieves a workflow. If `locale` is not found, it will try to find 'en' version of it.\n * By default, will return most recent workflow of a specific `id`. `createdAt` can be used to select older version.\n * @param id The uuid of the workflow\n * @param locale (optional) The desired locale of the workflow (default: 'en')\n * @param createdAt (optional) The creation date of the workflow (also used for versionning)\n * @returns desired workflow\n */\n public getWorkflow(\n id: string,\n locale?: string,\n createdAt?: string\n ): Promise<WorkflowData> {\n return this.api.get<WorkflowData>(`${this.v1Url}/workflows/${id}`, {\n params: { locale, createdAt },\n })\n }\n}\n","import { AxiosService } from \"..\"\n\nexport type FacetFilter = 'type:PHARMACY' | 'type:CLINIC'\n\nexport interface CliniaResponse<T> {\n facets: any\n meta: {\n query: string\n page: number\n numPages: number\n perPage: number\n total: number\n }\n records: T[]\n}\n\nexport interface PlaceData {\n id: string // The Clinia Id of the resource.\n documentType: string // Type of document. This will always be set to health_facility.\n type: string // The type of the resource. Possible Place types are detailed here.\n name: string // The name of the resource.\n address: AddressData // The address of the resource.\n geoPoint: GeoPointData // The coordinates of the resource. Useful to locate resource on a map.\n distance: number // The distance (in meters) the is from the location used to filter the query.\n onlineBookingUrl: string // The url for the online booking system of the resource.\n openingHours: Map<string, Array<IntervalData>> // The opening hours of the resource. This object has integers from 1 to 7 as keys, representing days of the week from Monday to Sunday as per ISO 8601.\n phones: Array<PhoneData> // Phones associated with this resource.\n socials: Array<SocialData> // The social links of the resource. Can be a website or a social media link.\n note: string // Special notes on the resource.\n services: Array<string> // The services offered by the resource.\n owner: string // The owner of the resource in the Clinia ecosystem.\n}\n\nexport interface AddressData {\n streetAddress: string //\tStreet number plus route name.\n suiteNumber: string //\tSuite, door, appartment number.\n postalCode: string //\tPostal code.\n neighborhood: string //\tNeighborhood.\n locality: string //\tLocality.\n place: string //\tCity.\n region: string //\tName of the region.\n regionCode: string //\tISO 3166-2 region code.\n country: string //\tName of the country.\n countryCode: string //\tISO 3166 country code\n}\n\nexport interface PhoneData {\n number: string //The phone number.\n extension: string //The extension of the phone number.\n countryCode: string //The country code associated with this phone number.\n type:\n | 'MAIN'\n | 'ALTERNATE'\n | 'RECEPTION'\n | 'FAX'\n | 'TEXT_TELEPHONE_TTY'\n | 'INFO'\n | 'OTHER' //The type of phone.\n isTollFree: boolean //If the number is toll free or not.\n}\n\nexport interface IntervalData {\n start: string //\tStart time of the time interval. Format is HH:mm.\n end: string //\tEnd time of the time interval. Format is HH:mm.\n}\n\nexport interface GeoPointData {\n lat: number //\tLatitude\n lng: number //\tLongitude\n}\n\nexport interface SocialData {\n url: string //\tUrl representing the link.\n type: string // Type of link.\n}\n\nexport class CliniaService {\n private api: AxiosService\n\n constructor(private url: string, apiKey: string, private locale?: string) {\n this.api = new AxiosService({ headers: { 'X-Clinia-API-Key': apiKey } })\n }\n\n public placeSearch(searchOptions: {\n locale?: string\n query?: string\n facetFilters?: FacetFilter[]\n location?: string\n aroundLatLng?: string\n page?: number\n }) {\n const { locale, ...data } = searchOptions\n\n return this.api.post<CliniaResponse<PlaceData>>(\n `${this.url}/search/v1/indexes/health_facility/query`,\n data,\n {\n params: { locale: locale ?? this.locale },\n }\n )\n }\n\n public placeMatch(\n searchOptions: {\n locale?: string\n name?: string\n address?: string\n postalCode?: string\n place?: string\n region?: string\n country?: string\n },\n type?: string\n ) {\n const { locale, ...data } = searchOptions\n\n let request = this.api.post<PlaceData[]>(\n `${this.url}/search/v1/matches`,\n data,\n {\n params: { locale: locale ?? this.locale },\n }\n )\n\n if (type) {\n request = request.then((places) =>\n places.filter((place) => place.type === type)\n )\n }\n\n return request\n }\n}\n","import {\n PopulatedWorkflowData,\n MetadataCategory,\n SelectedAnswersData,\n} from '../models'\nimport { PersonalInformations } from '../models/client'\n\nconst personalMetaToPrefix = {\n [MetadataCategory.Personal]: 'you',\n [MetadataCategory.ChildPersonal]: 'child',\n [MetadataCategory.OtherPersonal]: 'other',\n}\n\n/**\n * This function extract PersonalInformations from data input object coming from workflow\n * @param data extracted from WorkflowData\n * @returns PersonalInformations of a patient\n */\nexport function identificationToPersonalInformations(\n data: any,\n category:\n | MetadataCategory.Personal\n | MetadataCategory.ChildPersonal\n | MetadataCategory.OtherPersonal\n): PersonalInformations {\n const prefix = personalMetaToPrefix[category]\n\n return {\n birthday: data[`${prefix}Birthday`],\n firstname: data[`${prefix}Firstname`],\n gender: data[`${prefix}Gender`],\n name: data[`${prefix}Name`],\n phone: data[`${prefix}Phone`],\n zip: data[`${prefix}Zip`],\n hid: data[`${prefix}HID`] ?? data[`${prefix}ID`], // This is done for backward compatibility (historically youID was used)\n pharmacy: data[`${prefix}Pharmacy`],\n address: data[`${prefix}Address`],\n }\n}\n\nexport function toActualObject(data: PopulatedWorkflowData) {\n const ret: any = {}\n\n Object.entries(data.fields).forEach(([key, field]) => {\n ret[key] = field.displayedAnswer ? field.displayedAnswer : field.answer\n })\n\n return ret\n}\n\n/**\n * This function update a PopulatedWorkflowData with PersonalInformations\n * @param infos the personal informations\n * @param data the PopulatedWorkflowData\n * @returns an updated PopulatedWorkflowData\n */\nexport function updatePersonalIntoPopulatedWorkflowData(\n infos: PersonalInformations,\n data: PopulatedWorkflowData,\n category:\n | MetadataCategory.Personal\n | MetadataCategory.ChildPersonal\n | MetadataCategory.OtherPersonal\n) {\n const prefix = personalMetaToPrefix[category]\n\n const ret = JSON.parse(JSON.stringify(data)) // deep copy PopulatedWorkflowData\n\n if (infos.birthday && ret.fields[`${prefix}Birthday`])\n ret.fields[`${prefix}Birthday`].answer = infos.birthday\n if (infos.firstname && ret.fields[`${prefix}Firstname`])\n ret.fields[`${prefix}Firstname`].answer = infos.firstname\n if (infos.gender && ret.fields[`${prefix}Gender`])\n ret.fields[`${prefix}Gender`].answer = infos.gender\n if (infos.name && ret.fields[`${prefix}Name`])\n ret.fields[`${prefix}Name`].answer = infos.name\n if (infos.phone && ret.fields[`${prefix}Phone`])\n ret.fields[`${prefix}Phone`].answer = infos.phone\n if (infos.zip && ret.fields[`${prefix}Zip`])\n ret.fields[`${prefix}Zip`].answer = infos.zip\n if (infos.hid) {\n if (ret.fields[`${prefix}HID`]) {\n ret.fields[`${prefix}HID`].answer = infos.hid\n } else if (ret.fields[`${prefix}ID`]) {\n // This is done for backward compatibility (historically youID was used)\n ret.fields[`${prefix}ID`].answer = infos.hid\n } else {\n // If does not exist create it\n ret.fields[`${prefix}HID`] = { kind: 'text', answer: infos.hid }\n }\n }\n\n return ret\n}\n\n/**\n * This function extract an ISO 3166-1 alpha-2 country and subdivision code from data input object coming from workflow\n * @param answers answers from the WorkflowData\n * @returns an ISO 3166 alpha-2 code or undefined\n */\nexport function extractISOLocalityForConsult(\n answers?: SelectedAnswersData\n): string | undefined {\n if (!answers) {\n return undefined\n }\n\n const arrAnswersWithLocality = answers\n .flatMap((currentAnswerPage) => {\n const arrCountryFields = Object.keys(currentAnswerPage)\n .filter(\n (workflowFieldName) =>\n workflowFieldName.indexOf('Country') !== -1\n )\n .flat()\n const arrProvinceFields = Object.keys(currentAnswerPage)\n .filter(\n (workflowFieldName) =>\n workflowFieldName.indexOf('Province') !== -1\n )\n .flat()\n const arrConsultLocalFields = Object.keys(currentAnswerPage)\n .filter(\n (workflowFieldName) =>\n workflowFieldName.indexOf('Locality') !== -1\n )\n .flat()\n //returning the actual selected values, skipping if their IDs are more complex than a string\n return [\n ...arrCountryFields.map(\n (currentFieldName) =>\n (typeof currentAnswerPage[currentFieldName] === 'string'\n ? currentAnswerPage[currentFieldName]\n : undefined) as string\n ),\n ...arrProvinceFields.map(\n (currentFieldName) =>\n (typeof currentAnswerPage[currentFieldName] === 'string'\n ? currentAnswerPage[currentFieldName]\n : undefined) as string\n ),\n ...arrConsultLocalFields.map(\n (currentFieldName) =>\n (typeof currentAnswerPage[currentFieldName] === 'string'\n ? currentAnswerPage[currentFieldName]\n : undefined) as string\n ),\n ]\n })\n .filter((item) => item !== undefined)\n\n const arrSelectedLocality = arrAnswersWithLocality.filter(\n (currentSelectedLocality) =>\n currentSelectedLocality.startsWith('isoLocalityConsult')\n )\n if (!arrSelectedLocality || arrSelectedLocality.length === 0) {\n console.log('no locality found in ' + arrSelectedLocality)\n return undefined\n }\n //to allow enforcing of an order, we will allow the following pattern in the isoLocalityConsult field name\n // isoLocalityConsult-QC-CA and isoLocalityConsult_1-QC-CA\n // or generally: isoLocalityConsult-<isoValue> or isoLocalityConsult_<priority>-<isoValue>\n const allowedLocalityPatterns = /isoLocalityConsult(?:_(?<indexPriority>\\d*))?-(?<isoValue>[a-zA-Z0-9]{2}-[a-zA-Z0-9]{1,3})/\n const finalLocality = arrSelectedLocality.reduce<string | undefined>(\n (finalLocality, currentSelectedLocality) => {\n const extractedSelected = allowedLocalityPatterns.exec(\n currentSelectedLocality\n )\n const [, indexSelectedPriority, isoSelectedValue] =\n extractedSelected ?? []\n if (!finalLocality) {\n return isoSelectedValue\n }\n\n const extractedFinal = allowedLocalityPatterns.exec(finalLocality)\n const [, indexFinalPriority, isoFinalValue] = extractedFinal ?? []\n //we only keep the old value if there's priority used\n // and the new value is of lower priority\n if (\n !indexSelectedPriority ||\n (indexFinalPriority &&\n indexFinalPriority > indexSelectedPriority)\n ) {\n return isoFinalValue\n }\n\n return isoSelectedValue\n },\n undefined\n )\n\n console.log('Picking locality ' + finalLocality)\n return finalLocality\n}\n\nconst sessionPrivateKeyPrefix = 'sess-pkey'\nexport function sessionStorePrivateKeyName(id: string): string {\n return sessionPrivateKeyPrefix + id\n}\n","import { getMany } from 'idb-keyval'\nimport {\n MetadataCategory,\n PopulatedWorkflowData,\n PopulatedWorkflowField,\n QuestionData,\n SelectedAnswerData,\n SelectedAnswersData,\n WorkflowAnswersMissingError,\n WorkflowData,\n WorkflowPageData,\n WorkflowUploadedImage,\n} from '../models'\n\nexport async function filterTriggeredAnsweredWithKind(\n workflowData: WorkflowData,\n kind:\n | 'text'\n | 'date'\n | 'number'\n | 'images'\n | 'images-alias'\n | 'body-parts'\n | 'pharmacy-picker'\n): Promise<SelectedAnswerData[]> {\n if (!workflowData.selectedAnswers) throw WorkflowAnswersMissingError\n\n // Flattens the list of answered questions\n let flattenedAnswers = flattenSelectedAnswers(workflowData.selectedAnswers)\n // Generates a list of applicable questions\n let triggeredQuestionsWithKind = Object.fromEntries(\n workflowData.pages\n .map((a) => {\n return Object.entries(a.questions).filter(\n ([_, question]) =>\n isTriggered(\n question.triggers || [],\n flattenedAnswers\n ) && question.kind === kind\n )\n })\n .flat()\n )\n\n const samePageAnswers = workflowData.selectedAnswers.reduce((prev, cur) => {\n return { ...prev, ...cur }\n }, {})\n\n const res = Object.keys(triggeredQuestionsWithKind).map(\n (questionFieldName) => {\n return samePageAnswers[questionFieldName]\n }\n )\n\n return res\n}\n\n/**\n * Filters and Populates the `selectedAnswers` from the workflow by\n * Cross-referencing the `MetaCategory` of the answer's respective question\n * Populates the fields labels and values that are of radio, dropdown and checkbox types\n *\n * @param workflowData\n * @param category\n * @returns An array of record key, value pairs\n */\nexport async function getWorkflowDataByCategory(\n workflowData: WorkflowData,\n category: MetadataCategory\n): Promise<PopulatedWorkflowData> {\n if (!workflowData.selectedAnswers) throw WorkflowAnswersMissingError\n\n // Flattens the list of answered questions\n let flattenedAnswers = flattenSelectedAnswers(workflowData.selectedAnswers)\n // Generates a list of applicable questions\n let triggeredQuestions = Object.fromEntries(\n workflowData.pages\n .map((a) => {\n return Object.entries(a.questions).filter(([_, question]) =>\n isTriggered(question.triggers || [], flattenedAnswers)\n )\n })\n .flat()\n )\n\n const fields: Record<string, PopulatedWorkflowField> = {}\n\n // Generates the answers of the specified category and adds the appropriate values if any are missing\n return Promise.all(\n workflowData.selectedAnswers\n .map((e) => Object.entries(e))\n .flat()\n .filter(\n ([k, v]) =>\n triggeredQuestions[k] &&\n triggeredQuestions[k]['metaCategory'] === category\n )\n .map(([k, v]) => {\n return populateWorkflowField(triggeredQuestions[k], v).then(\n (populatedValue) => {\n fields[k] = populatedValue\n }\n )\n })\n )\n .then(() => {\n const ret: PopulatedWorkflowData = {\n workflowCreatedAt: workflowData.createdAt,\n workflowId: workflowData.id,\n locale: workflowData.locale,\n fields,\n }\n return ret\n })\n .catch((err) => {\n console.error(\n `Error while extracting ${category} data from workflow`,\n err\n )\n throw err\n })\n}\n\nexport async function getImagesFromIndexDb(\n answer: SelectedAnswerData\n): Promise<WorkflowUploadedImage[]> {\n return await getMany<WorkflowUploadedImage>(\n (answer as any[]).map((v) => v.id ?? v) as string[]\n )\n}\n\n/**\n * (If applicable) Based on the question kind, and the answer type this function will add and replace the appropriate fields to the\n * field values if they are radio, dropdown and checkbox fields\n *\n *\n * @param question\n * @param answerValue\n * @returns\n */\nasync function populateWorkflowField(\n question: QuestionData,\n answerValue: SelectedAnswerData\n): Promise<PopulatedWorkflowField> {\n let answer: any\n let displayedAnswer: string | string[] | undefined = undefined\n\n switch (question.kind) {\n case 'radio':\n case 'radio-card':\n case 'select':\n if (question.answers) {\n displayedAnswer = question.answers[answerValue as string].text\n }\n\n answer = answerValue\n break\n case 'multiple':\n case 'checkbox-group':\n displayedAnswer = (answerValue as string[]).map((value) => {\n if (question.answers) {\n return question.answers[value].text\n }\n\n throw new WorkflowAnswersMissingError()\n })\n\n answer = answerValue\n break\n case 'images':\n answer = await getImagesFromIndexDb(answerValue).then((images) =>\n images.map((image) => {\n const { name, imageData } = image\n\n return { name, imageData }\n })\n )\n break\n default:\n answer = answerValue\n }\n\n return Promise.resolve({\n answer,\n displayedAnswer,\n kind: question.kind,\n })\n}\n\nexport function isTriggered(triggers: string[], answers: string[]): boolean {\n for (let trigger of triggers) {\n if (!answers.includes(trigger)) {\n return false\n }\n }\n return true\n}\n\nexport function flattenSelectedAnswers(answers: SelectedAnswersData) {\n const linearAnswers: SelectedAnswerData[] = []\n\n for (const answer of answers) {\n linearAnswers.push(...Object.values(answer))\n }\n\n return linearAnswers.flat(1)\n}\n\n/**\n * This function helps you to get a valid workflow selectedAnswers structure\n * @param workflow the workflow data to use to initialize selectedAnswers\n * @param useDefault use workflow default values or not (this is used to avoid having unset values to appear in summaries)\n * @returns a valid selectedAnswers structure\n */\nexport function getInitialisedSelectedAnswers(\n workflow: WorkflowData,\n useDefault: boolean = true\n) {\n return workflow.pages.map((page) => {\n const ret: any = {}\n for (const [id, question] of Object.entries(page.questions)) {\n if (question.kind === 'body-parts') {\n ret[id] = useDefault ? [] : undefined\n } else {\n ret[id] =\n useDefault && question.defaultValue\n ? question.defaultValue\n : undefined\n }\n }\n return ret\n })\n}\n\nexport function fillWorkflowFromPopulatedWorkflow(\n workflow: WorkflowData,\n populatedWorkflow: PopulatedWorkflowData\n) {\n const filledWorkflow = JSON.parse(JSON.stringify(workflow))\n\n if (!filledWorkflow.selectedAnswers) {\n filledWorkflow.selectedAnswers = getInitialisedSelectedAnswers(\n filledWorkflow,\n false\n )\n }\n\n filledWorkflow.pages.forEach((page: WorkflowPageData, pageIdx: number) => {\n const ret: any = {}\n for (const [id] of Object.entries(page.questions)) {\n if (populatedWorkflow.fields[id]) {\n if (filledWorkflow.selectedAnswers)\n filledWorkflow.selectedAnswers[pageIdx][\n id\n ] = populatedWorkflow.fields[id].answer as string | string[]\n }\n }\n })\n\n return filledWorkflow\n}\n","import {\n Consult,\n ConsultationImageMeta,\n getImagesFromIndexDb,\n getWorkflowDataByCategory,\n filterTriggeredAnsweredWithKind,\n MedicalStatus,\n OroClient,\n PersonalMeta,\n Practitioner,\n RegisterPatientOutput,\n} from '..'\nimport {\n ConsultationMeta,\n ConsultRequest,\n DocumentType,\n IndexKey,\n MedicalMeta,\n MetadataCategory,\n PreferenceMeta,\n RawConsultationMeta,\n Uuid,\n VaultIndex,\n WorkflowData,\n} from '../models'\n\nconst MAX_RETRIES = 15\n\nexport async function registerPatient(\n patientUuid: Uuid,\n consultRequest: ConsultRequest,\n workflow: WorkflowData,\n oroClient: OroClient,\n masterKey?: Uuid,\n recoveryQA?: {\n recoverySecurityQuestions: string[]\n recoverySecurityAnswers: string[]\n }\n): Promise<RegisterPatientOutput> {\n let consult: Consult | undefined = undefined\n let lockboxUuid: Uuid | undefined = undefined\n let practitionerAdmin: Uuid | undefined = undefined\n let retry = MAX_RETRIES\n let isExistingPatient = false\n\n for (; retry > 0; retry--) {\n try {\n // Wait a bit each retry (we also want the first one to wait)\n await new Promise((resolve) => setTimeout(resolve, 2000))\n\n // Retrieving practitioners\n if (!practitionerAdmin)\n practitionerAdmin = (\n await oroClient.practiceClient.practiceGetFromUuid(\n consultRequest.uuidPractice\n )\n ).uuidAdmin\n\n let practitioners: Practitioner[] = await oroClient.practiceClient\n .practiceGetPractitioners(consultRequest.uuidPractice)\n .catch((err) => {\n console.log(`Error retrieving practitioners`, err)\n return []\n })\n\n // Creating consult\n if (!consult) {\n consult = await getOrCreatePatientConsultationUuid(\n consultRequest,\n oroClient\n )\n }\n\n // Creating lockbox\n if (!lockboxUuid)\n lockboxUuid = await getOrCreatePatientLockbox(oroClient)\n\n isExistingPatient = await patientConsultExists(\n consult,\n lockboxUuid,\n oroClient\n ).catch((err) => {\n console.error(`Error when retrieving existing consults ${err}`)\n return false\n })\n await oroClient\n .grantLockbox(practitionerAdmin, lockboxUuid)\n .catch((err) => {\n console.error(\n `Error while granting lockbox to practitioner admin ${practitionerAdmin}`,\n err\n )\n // if we cannot grant to the admin, then the registration will fail\n throw err\n })\n\n // Patient Grant to practice\n let grantPromises = practitioners\n .filter(\n (practitioner) => practitioner.uuid !== practitionerAdmin\n )\n .map(async (practitioner) => {\n return oroClient\n .grantLockbox(practitioner.uuid, lockboxUuid!)\n .catch((err) => {\n console.error(\n `Error while granting lockbox to practitioner`,\n err\n )\n // Acceptable to continue as admin has already been granted, but we should still try to retry\n if (retry <= 1) return\n else throw err\n })\n })\n\n await storePatientData(\n consult.uuid,\n consultRequest.isoLanguageRequired,\n lockboxUuid,\n workflow,\n oroClient\n )\n\n // the index will identify in which lockbox a consultation live\n let consultIndex: VaultIndex = {\n [IndexKey.ConsultationLockbox]: [\n {\n grant: {\n lockboxUuid,\n lockboxOwnerUuid: patientUuid,\n },\n consultationId: consult.uuid,\n },\n ],\n }\n\n let consultIndexPromises = practitioners.map(async (practitioner) => {\n return oroClient\n .vaultIndexAdd(consultIndex, practitioner.uuid)\n .catch((err) => {\n console.error(\n `Error while adding to the practitioner's index ${practitioner.uuid}`,\n err\n )\n /// it's acceptable to continue registration\n return\n })\n })\n\n\n //DEPRECATED: REMOVE ME : BEGIN /////////////////////////////////////////\n\n let deprecatedConsultIndex: VaultIndex = {\n [IndexKey.Consultation]: [\n {\n grant: {\n lockboxUuid,\n lockboxOwnerUuid: patientUuid,\n },\n consultationId: consult.uuid,\n },\n ],\n }\n\n let deprecatedConsultIndexPromises = practitioners.map(async (practitioner) => {\n return oroClient\n .vaultIndexAdd(deprecatedConsultIndex, practitioner.uuid)\n .catch((err) => {\n console.error(\n `Error while adding to the practitioner's index ${practitioner.uuid}`,\n err\n )\n /// it's acceptable to continue registration\n return\n })\n })\n\n //DEPRECATED: REMOVE ME : END /////////////////////////////////////////\n\n\n if (masterKey && !isExistingPatient) {\n // generate and store recovery payload\n await oroClient\n .updateMasterKey(patientUuid, masterKey, lockboxUuid)\n .catch((err) => {\n console.error(`Error while updating master key`, err)\n /// it's acceptable to continue registration\n return\n })\n } else {\n // we did not set the master key so we do not return it\n masterKey = undefined\n }\n\n if (recoveryQA && !isExistingPatient)\n // Patient security question recovery threshold is 2 answers\n await oroClient\n .updateSecurityQuestions(\n patientUuid,\n recoveryQA.recoverySecurityQuestions,\n recoveryQA.recoverySecurityAnswers,\n 2\n )\n .catch((err) => {\n console.error(\n `Error while updating security questions`,\n err\n )\n /// it's acceptable to continue registration\n return\n })\n\n await Promise.all([...grantPromises, ...consultIndexPromises, ...deprecatedConsultIndexPromises])\n\n // Deem the consultation as ready\n await oroClient.consultClient.updateConsultByUUID(consult.uuid, {\n statusMedical: MedicalStatus.New,\n })\n\n // if we got through the complete flow, the registration succeeded\n break\n } catch (err) {\n console.error(\n `Error occured during registration, retrying... Retries remaining: ${retry}`\n )\n continue\n }\n }\n\n if (retry <= 0) {\n console.error('registration failed: MAX_RETRIES reached')\n throw 'RegistrationFailed'\n }\n\n console.log('Successfully Registered')\n await oroClient.cleanIndex()\n return {\n masterKey,\n consultationId: consult!.uuid,\n lockboxUuid: lockboxUuid!,\n }\n}\n\n/**\n * Returns whether the consultation creation is for an existing patient (ignores data from the current consultation)\n *\n * @param currentConsultation\n */\nasync function patientConsultExists(\n currentConsultation: Consult,\n lockboxUuid: Uuid,\n oroClient: OroClient\n): Promise<boolean> {\n let publicMetadata: ConsultationMeta = {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.PopulatedWorkflowData,\n }\n let manifest = await oroClient.vaultClient.lockboxMetadataGet(\n lockboxUuid,\n ['consultationId'],\n [],\n publicMetadata\n )\n return (\n manifest[0].findIndex(\n (v: { consultationId: Uuid }) =>\n v.consultationId != null &&\n v.consultationId !== currentConsultation.uuid\n ) !== -1\n )\n}\n\n/**\n * Creates a consultation if one has not been created and fails to be retrieved by the payment intent\n * @param consult\n * @param oroClient\n * @returns the consult Uuid\n */\nasync function getOrCreatePatientConsultationUuid(\n consult: ConsultRequest,\n oroClient: OroClient\n): Promise<Consult> {\n let payment = await oroClient.practiceClient.practiceGetPayment(\n consult.uuidPractice,\n consult.idStripeInvoiceOrPaymentIntent\n )\n if (payment && payment.uuidConsult) {\n return oroClient.consultClient\n .getConsultByUUID(payment.uuidConsult)\n .catch((err) => {\n console.error('Error while retrieving consult', err)\n throw err\n })\n } else {\n return await oroClient.consultClient\n .consultCreate(consult)\n .catch((err) => {\n console.error('Error while creating consult', err)\n throw err\n })\n }\n}\n\n/**\n * Creates a new lockbox for the patient if they do not have any, otherwise, use the first (and only one)\n * @param oroClient\n * @returns the lockbox Uuid\n */\nasync function getOrCreatePatientLockbox(oroClient: OroClient): Promise<Uuid> {\n let grants = await oroClient.getGrants(undefined, true)\n if (grants.length > 0) {\n console.log(\n 'The grant has already been created, skipping lockbox create step'\n )\n return grants[0].lockboxUuid!\n } else\n return (\n await oroClient.vaultClient.lockboxCreate().catch((err) => {\n console.error('Error while creating lockbox', err)\n throw err\n })\n ).lockboxUuid\n}\n\n/**\n * Store all patient related information into his/her lockbox\n * @param consultationId The consultation id\n * @param isoLanguage the prefered language of communication (ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes)\n * @param lockboxUuid the lockbox uuid to store data in\n * @param workflow the workflow used to extract informations\n * @param oroClient an oroClient instance\n * @returns\n */\nasync function storePatientData(\n consultationId: Uuid,\n isoLanguage: string,\n lockboxUuid: Uuid,\n workflow: WorkflowData,\n oroClient: OroClient\n): Promise<(Uuid | void)[]> {\n // Create and store registration data\n return Promise.all([\n storeImageAliases(\n consultationId,\n lockboxUuid,\n workflow,\n oroClient\n ).catch((err) => {\n console.error('[SDK] Some errors happened during image upload', err)\n }),\n // Storing Raw data first\n oroClient.getOrInsertJsonData<RawConsultationMeta>(\n lockboxUuid,\n workflow,\n {\n category: MetadataCategory.Raw,\n contentType: 'application/json',\n consultationId,\n },\n {}\n ),\n getWorkflowDataByCategory(workflow, MetadataCategory.Consultation).then(\n (data) =>\n oroClient.getOrInsertJsonData<ConsultationMeta>(\n lockboxUuid,\n data,\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.PopulatedWorkflowData,\n consultationId, // TODO: deprecated. Will finally only be in privateMetadata\n },\n { consultationId }\n )\n ),\n getWorkflowDataByCategory(workflow, MetadataCategory.Medical).then(\n (data) =>\n oroClient.getOrInsertJsonData<MedicalMeta>(\n lockboxUuid,\n data,\n {\n category: MetadataCategory.Medical,\n documentType: DocumentType.PopulatedWorkflowData,\n consultationIds: [consultationId!],\n },\n {}\n )\n ),\n extractAndStorePersonalWorkflowData(\n workflow,\n lockboxUuid,\n consultationId,\n MetadataCategory.Personal,\n oroClient\n ),\n extractAndStorePersonalWorkflowData(\n workflow,\n lockboxUuid,\n consultationId,\n MetadataCategory.ChildPersonal,\n oroClient\n ),\n extractAndStorePersonalWorkflowData(\n workflow,\n lockboxUuid,\n consultationId,\n MetadataCategory.OtherPersonal,\n oroClient\n ),\n oroClient.getOrInsertJsonData<PreferenceMeta>(\n lockboxUuid,\n { isoLanguage },\n {\n category: MetadataCategory.Preference,\n contentType: 'application/json',\n },\n {}\n ),\n ]).then((dataUuids) => dataUuids.flat())\n}\n\nasync function storeImageAliases(\n consultationId: Uuid,\n lockboxUuid: Uuid,\n workflow: WorkflowData,\n oroClient: OroClient\n): Promise<(Uuid | void)[]> {\n const images = await getImagesFromIndexDb(\n (await filterTriggeredAnsweredWithKind(workflow, 'images-alias')).flat()\n )\n\n const nonNullImages = images.filter((img) => !!img)\n\n if (images.length !== nonNullImages.length) {\n console.error(\n '[SDK] Some images have not been found, they have been skipped.'\n )\n }\n\n let promises = nonNullImages.map((image) => {\n return oroClient.getOrInsertJsonData<ConsultationImageMeta>(\n lockboxUuid,\n image,\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.ImageAlias,\n consultationId,\n idbId: image.idbId as string,\n },\n {}\n )\n })\n return Promise.all(promises)\n}\n\n/**\n * Extracts the workflow MetadataCategory for Personal, ChildPersonal and OtherPersonal\n * then stores it in the vault\n *\n * @param workflow\n * @param lockboxUuid\n * @param category\n * @returns The data uuid\n */\nexport async function extractAndStorePersonalWorkflowData(\n workflow: WorkflowData,\n lockboxUuid: Uuid,\n consultationId: Uuid,\n category:\n | MetadataCategory.Personal\n | MetadataCategory.ChildPersonal\n | MetadataCategory.OtherPersonal,\n oroClient: OroClient\n): Promise<Uuid | void> {\n return getWorkflowDataByCategory(\n workflow,\n (category as unknown) as MetadataCategory\n ).then((data) => {\n if (Object.keys(data.fields).length === 0) return\n return oroClient.getOrInsertJsonData<PersonalMeta>(\n lockboxUuid,\n data,\n {\n category,\n documentType: DocumentType.PopulatedWorkflowData,\n consultationIds: [consultationId],\n },\n {}\n )\n })\n}\n","import { CryptoRSA, uuidParse} from \"oro-toolbox\"\nimport { EncryptedIndexEntry, Grant, IndexConsultLockbox } from \"..\"\n\n/**\n * Decrypts and returns the encrypted grants\n * If something went wrong during decryption, that grant will be removed from the list\n *\n * @param encryptedGrants: an array of encrypted grants\n * @param rsaKey: the rsa key used to decrypt the encrypted grants\n * @returns an array of grants\n */\nexport function decryptGrants(encryptedGrants: Grant[], rsaKey: CryptoRSA): Grant[] {\n return encryptedGrants\n .map(grant => {\n if (grant.encryptedLockbox && !grant.lockboxUuid) {\n try {\n grant.lockboxUuid = uuidParse(\n rsaKey.base64DecryptToBytes(grant.encryptedLockbox)\n )\n } catch (e) {\n console.error('[sdk:index] The grant could not be decrypted or was not a valid UUID: ', e)\n }\n }\n return grant\n })\n .filter(grant => grant.lockboxUuid)\n}\n\n/**\n * Decrypts the encrypted consult lockboxes and returns their grants\n * If something went wrong during decryption, that grant will be removed from the list\n *\n * @param encryptedConsultLockboxes: an array of encrypted entries\n * @param rsaKey: the rsa key used to decrypt the encrypted entries\n * @returns an array of grants\n */\nexport function decryptConsultLockboxGrants(encryptedConsultLockboxes: EncryptedIndexEntry[], rsaKey: CryptoRSA): Grant[] {\n return encryptedConsultLockboxes\n .map(encryptedConsultLockboxes => {\n try {\n return [true, (rsaKey.base64DecryptToJson(\n encryptedConsultLockboxes.encryptedIndexEntry\n ) as IndexConsultLockbox).grant]\n } catch(e) {\n console.error('[sdk:index] The consult lockbox grant could not be decrypted: ', e)\n return [false, undefined] // if decryption fails, we want to ignore the grant but not fail the call\n }\n })\n .filter(grantsTuple => grantsTuple[0])\n .map(grantTuples => grantTuples[1] as Grant)\n}","import { IndexKey, OroClient, Uuid, VaultIndex } from \"..\";\nimport { Grant, MetadataCategory, IndexConsultLockbox } from \"../models\";\n\n/**\n * @name filterGrantsWithLockboxMetadata\n * @description searches for the applied filters in the vault index\n * @param oroClient\n * @param filter: the metadata filter applied to each the lockboxes\n * @param vaultIndex: the index to which the filter will be applied \n * @param forceRefresh\n * @returns the filtered grants\n */\nexport async function filterGrantsWithLockboxMetadata(oroClient: OroClient, filter?: { consultationId: Uuid}, vaultIndex?: VaultIndex, forceRefresh = false): Promise<Grant[]> {\n if (!vaultIndex || forceRefresh) {\n vaultIndex = await buildLegacyVaultIndex(oroClient)\n }\n if (vaultIndex[IndexKey.Consultation] && filter) {\n let indexConsults = (vaultIndex[IndexKey.Consultation]??[])\n .filter((consultGrant: {consultationId: Uuid}) => consultGrant.consultationId === filter.consultationId)\n .map((consultGrant: {consultationId: Uuid, grant: Grant}) => consultGrant.grant as Grant)\n return indexConsults as Grant[]\n } else {\n // No grants exist and the index has already been built\n return []\n }\n}\n\n/** Finds all grants for the logged user\n * requests a list of unique consultation ids for each lockbox the user has access to\n * builds and sets the index of consultations\n * @param oroClient\n * @returns the constructed vaultIndex\n */\nexport async function buildLegacyVaultIndex(oroClient: OroClient): Promise<VaultIndex> {\n let grants = await oroClient.getGrants()\n let consultGrants: IndexConsultLockbox[] = []\n for (let grant of grants) {\n let consults = (await oroClient.vaultClient\n .lockboxMetadataGet(\n grant.lockboxUuid!,\n ['consultationId'],\n [],\n { category: MetadataCategory.Consultation },\n ))[0] as Uuid[]\n\n consultGrants = [...consultGrants, ...consults.map((consult: any) => ({\n ...consult,\n grant: {\n lockboxOwnerUuid:\n grant.lockboxOwnerUuid,\n lockboxUuid: grant.lockboxUuid,\n },\n }))]\n }\n\n let vaultIndex = {\n [IndexKey.Consultation]: consultGrants\n }\n oroClient.setVaultIndex(vaultIndex)\n console.info('[sdk:index] Successfully Built Vault Index')\n return vaultIndex\n}","import * as OroToolbox from 'oro-toolbox'\nimport { CryptoRSA } from 'oro-toolbox'\nimport { registerPatient, sessionStorePrivateKeyName, decryptGrants, decryptConsultLockboxGrants} from './helpers'\nimport {\n AssociatedLockboxNotFound,\n AuthTokenRequest,\n Consult,\n ConsultRequest,\n DataCreateResponse,\n Document,\n DocumentType,\n EncryptedIndexEntry,\n EncryptedVaultIndex,\n Grant,\n IdentityCreateRequest,\n IdentityResponse,\n IncompleteAuthentication,\n IndexBuildError,\n IndexConsultLockbox,\n IndexKey,\n LocalEncryptedData,\n LocalizedData,\n LockboxDataRequest,\n LockboxGrantRequest,\n LockboxManifest,\n ManifestEntry,\n Meta,\n Metadata,\n MetadataCategory,\n MissingGrant,\n MissingLockbox,\n MissingLockboxOwner,\n PersonalMeta,\n PopulatedWorkflowData,\n Practice,\n PreferenceMeta,\n RecoveryData,\n RecoveryMeta,\n RegisterPatientOutput,\n SecretShard,\n TokenData,\n TosAndCpAcceptanceRequest,\n UserPreference,\n Uuid,\n VaultIndex,\n WorkflowData,\n} from './models'\nimport { filterGrantsWithLockboxMetadata, buildLegacyVaultIndex } from './sdk-revision'\nimport {\n ConsultService,\n DiagnosisService,\n GuardService,\n PracticeService,\n TellerService,\n VaultService,\n WorkflowService,\n} from './services'\n\nexport class OroClient {\n private rsa?: CryptoRSA\n private secrets: {\n lockboxUuid: string\n cryptor: OroToolbox.CryptoChaCha\n }[] = []\n private cachedMetadataGrants: {\n [filter: string]: Grant[]\n } = {}\n\n private cachedManifest: {\n [filter: string]: ManifestEntry[]\n } = {}\n\n private vaultIndex?: VaultIndex\n\n constructor(\n private toolbox: typeof OroToolbox,\n public tellerClient: TellerService,\n public vaultClient: VaultService,\n public guardClient: GuardService,\n public practiceClient: PracticeService,\n public consultClient: ConsultService,\n public workflowClient: WorkflowService,\n public diagnosisClient: DiagnosisService,\n private authenticationCallback?: (err: Error) => void\n ) {}\n\n /** \n * clears the vaultIndex and cached metadata grants\n */\n public async cleanIndex() {\n this.vaultIndex = undefined\n this.cachedMetadataGrants = {}\n this.cachedManifest = {} \n }\n\n /**\n * Generates an RSA key pair and password payload (rsa private key encrypted with the password)\n * Calls Guard to sign up with the email address, password, practice, legal and token data\n *\n * @param email\n * @param password\n * @param practice\n * @param legal\n * @param tokenData\n * @returns\n */\n public async signUp(\n email: string,\n password: string,\n practice: Practice,\n tosAndCpAcceptance: TosAndCpAcceptanceRequest,\n tokenData?: TokenData,\n subscription?: boolean\n ): Promise<IdentityResponse> {\n this.rsa = new CryptoRSA()\n const privateKey = this.rsa.private()\n\n const symmetricEncryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n password\n )\n const recoveryPassword = symmetricEncryptor.bytesEncryptToBase64Payload(\n privateKey\n )\n\n const hashedPassword = this.toolbox.hashStringToBase64(\n this.toolbox.hashStringToBase64(password)\n )\n\n const signupRequest: IdentityCreateRequest = {\n practiceUuid: practice.uuid,\n email: email.toLowerCase(),\n password: hashedPassword,\n publicKey: this.toolbox.encodeToBase64(this.rsa.public()),\n recoveryPassword,\n tosAndCpAcceptance,\n tokenData,\n subscription,\n }\n\n const identity = await this.guardClient.identityCreate(signupRequest)\n\n if (identity.recoveryLogin) {\n //Ensure we can recover from a page reload\n let symetricEncryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n identity.recoveryLogin\n )\n sessionStorage.setItem(\n sessionStorePrivateKeyName(identity.id),\n symetricEncryptor.bytesEncryptToBase64Payload(privateKey)\n )\n }\n\n return identity\n }\n\n /**\n * Parse the given accessToken claims by calling guard whoami and update theidentity to set it's emailConfirmed flag\n * @param accessToken\n * @returns The identity related to confirmedEmail\n */\n public async confirmEmail(accessToken: string): Promise<IdentityResponse> {\n this.guardClient.setTokens({ accessToken })\n const claims = await this.guardClient.whoAmI()\n return this.guardClient.identityUpdate(claims.sub, {\n emailConfirmed: true,\n })\n }\n\n /**\n * Calls Guard to sign in with the email address, password and one time password (if MFA is enabled)\n * Then recover's the rsa private key from the recovery payload\n *\n * @param practiceUuid\n * @param email\n * @param password\n * @param otp\n * @returns the user identity\n */\n public async signIn(\n practiceUuid: Uuid,\n email: string,\n password: string,\n otp?: string\n ): Promise<IdentityResponse> {\n const hashedPassword = this.toolbox.hashStringToBase64(\n this.toolbox.hashStringToBase64(password)\n )\n const tokenRequest: AuthTokenRequest = {\n practiceUuid,\n email: email.toLowerCase(),\n password: hashedPassword,\n otp,\n }\n\n await this.guardClient.authToken(tokenRequest)\n const userUuid = (await this.guardClient.whoAmI()).sub\n\n // Updates the rsa key to the one generated on the backend\n await this.recoverPrivateKeyFromPassword(userUuid, password)\n return await this.guardClient.identityGet(userUuid)\n }\n\n /**\n * Will attempt to recover an existing login session and set back\n * the private key in scope\n */\n public async resumeSession() {\n const id = (await this.guardClient.whoAmI()).sub\n const recoveryPayload = sessionStorage.getItem(\n sessionStorePrivateKeyName(id)\n )\n const recoveryKey = (await this.guardClient.identityGet(id))\n .recoveryLogin\n\n if (!recoveryKey || !recoveryPayload) throw IncompleteAuthentication\n\n const symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n recoveryKey\n )\n let privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(\n recoveryPayload\n )\n this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey)\n }\n\n /**\n * This function let's you encrypt locally an Object\n * @param value the Object to encrypt\n * @returns a LocalEncryptedData Object\n * @throws IncompleteAuthentication if rsa is not set\n * @calls authenticationCallback if rsa is not set\n */\n public localEncryptToJsonPayload(value: any): LocalEncryptedData {\n if (!this.rsa) {\n if (this.authenticationCallback) {\n this.authenticationCallback(new IncompleteAuthentication())\n }\n\n throw new IncompleteAuthentication()\n }\n\n const chaChaKey = new this.toolbox.CryptoChaCha()\n\n const encryptedData = chaChaKey.jsonEncryptToBase64Payload(value)\n const encryptedKey = this.toolbox.encodeToBase64(\n this.rsa.encryptToBytes(chaChaKey.key())\n )\n\n return { encryptedData, encryptedKey }\n }\n\n /**\n * This function let's you decrypt a LocalEncryptedData object\n * @param value a LocalEncryptedData object\n * @returns a decrypted Object\n * @throws IncompleteAuthentication if rsa is not set\n * @calls authenticationCallback if rsa is not set\n */\n public localDecryptJsonPayload({\n encryptedKey,\n encryptedData,\n }: LocalEncryptedData): any {\n if (!this.rsa) {\n if (this.authenticationCallback) {\n this.authenticationCallback(new IncompleteAuthentication())\n }\n\n throw new IncompleteAuthentication()\n }\n\n const chaChaKey = this.rsa.base64DecryptToBytes(encryptedKey)\n const decryptedData = this.toolbox.CryptoChaCha.fromKey(\n chaChaKey\n ).base64PayloadDecryptToJson(encryptedData)\n\n return decryptedData\n }\n\n /**\n * Effectively kills your \"session\"\n */\n public async signOut() {\n this.rsa = undefined\n this.secrets = []\n this.guardClient.setTokens({\n accessToken: undefined,\n refreshToken: undefined,\n })\n await this.guardClient.authLogout()\n }\n\n /**\n * @name registerPatient\n * @description The complete flow to register a patient\n *\n * Steps:\n * 1. Create a consult (checks if payment has been done)\n * 2. Creates a lockbox\n * 3. Grants lockbox access to all practice personnel\n * 4. Creates secure identification, medical, onboarding data\n * 5. Generates and stores the rsa key pair and recovery payloads\n *\n * @param patientUuid\n * @param consult\n * @param workflow\n * @param recoveryQA\n * @returns\n */\n public async registerPatient(\n patientUuid: Uuid,\n consult: ConsultRequest,\n workflow: WorkflowData,\n recoveryQA?: {\n recoverySecurityQuestions: string[]\n recoverySecurityAnswers: string[]\n }\n ): Promise<RegisterPatientOutput> {\n if (!this.rsa) throw IncompleteAuthentication\n return registerPatient(\n patientUuid,\n consult,\n workflow,\n this,\n this.toolbox.uuid(),\n recoveryQA\n )\n }\n\n /**\n * Builds the vault index for the logged user\n *\n * Steps:\n * 1. Retrieves, decrypts and sets the lockbox IndexSnapshot\n * 2. Retrieves, decrypts and adds all other index entries starting at the snapshot timestamp\n * 3. Updates the IndexSnapshot if changed\n * @deprecated\n * @returns the latest vault index\n */\n public async buildVaultIndex(forceRefresh: boolean = false) {\n if (!this.vaultIndex || forceRefresh)\n await buildLegacyVaultIndex(this)\n }\n\n /**\n * Setter for the vault index\n * @param index\n */\n public setVaultIndex(index: VaultIndex) {\n this.vaultIndex = index\n }\n\n /**\n * Fetches all grants, and consultations that exist in each lockbox\n * Then updates the index for the current user with the lockbox consult relationship\n */\n public async forceUpdateIndexEntries() {\n let grants = await this.getGrants()\n\n let indexConsultLockbox: IndexConsultLockbox[] = await Promise.all(\n grants.map(\n async (grant: Grant) =>\n await this.vaultClient\n .lockboxMetadataGet(\n grant.lockboxUuid!,\n ['consultationId'],\n [],\n { category: MetadataCategory.Consultation },\n grant.lockboxOwnerUuid\n )\n .then((consults) => {\n try {\n return consults[0].map((consult: any) => {\n return {\n ...consult,\n grant: {\n lockboxOwnerUuid:\n grant.lockboxOwnerUuid,\n lockboxUuid: grant.lockboxUuid,\n },\n }\n })\n } catch (e) {\n // No consultations in lockbox or index could not be created\n return []\n }\n })\n .catch(() => [])\n )\n ).then((consults) => consults.flat())\n this.vaultIndexAdd({\n [IndexKey.Consultation]: indexConsultLockbox,\n })\n .then(() => alert('The Index was successfully updated!'))\n .catch(() => console.error('The index failed to update!'))\n }\n\n /**\n * Generates, encrypts and adds entries to vault index for a given index owner\n *\n * @param entries\n * @param indexOwnerUuid\n */\n public async vaultIndexAdd(entries: VaultIndex, indexOwnerUuid?: Uuid) {\n if (!this.rsa) throw IncompleteAuthentication\n\n let rsaPub: Uint8Array\n if (indexOwnerUuid) {\n let base64IndexOwnerPubKey = (\n await this.guardClient.identityGet(indexOwnerUuid)\n ).publicKey\n rsaPub = this.toolbox.decodeFromBase64(base64IndexOwnerPubKey)\n } else {\n rsaPub = this.rsa.public()\n }\n\n let encryptedIndex: EncryptedVaultIndex = {}\n\n for (let keyString of Object.keys(entries)) {\n let key = keyString as keyof VaultIndex\n switch (key) {\n case IndexKey.ConsultationLockbox:\n encryptedIndex[key] = (entries[\n key\n ] as IndexConsultLockbox[])\n .map((e) => ({\n ...e,\n uniqueHash: e.consultationId,\n }))\n .map(\n (e: IndexConsultLockbox) =>\n ({\n uuid: e.uuid,\n timestamp: e.timestamp,\n uniqueHash: e.uniqueHash,\n encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(\n {\n consultationId: e.consultationId,\n grant: e.grant,\n },\n rsaPub\n ),\n } as EncryptedIndexEntry)\n )\n break\n //// DEPRECATED : REMOVE ME : BEGIN ///////////////////////////////////////////\n case IndexKey.Consultation:\n encryptedIndex[key] = (entries[\n key\n ] as IndexConsultLockbox[])\n .map((e) => ({\n ...e,\n uniqueHash: this.toolbox.hashStringToBase64(\n JSON.stringify({\n consultationId: e.consultationId,\n grant: e.grant,\n })\n ),\n }))\n .filter(\n (e) =>\n !this.vaultIndex ||\n !this.vaultIndex[IndexKey.Consultation]?.find(\n (v) => v.uniqueHash === e.uniqueHash\n )\n )\n .map(\n (e: IndexConsultLockbox) =>\n ({\n uuid: e.uuid,\n timestamp: e.timestamp,\n uniqueHash: e.uniqueHash,\n encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(\n {\n consultationId: e.consultationId,\n grant: e.grant,\n },\n rsaPub\n ),\n } as EncryptedIndexEntry)\n )\n break\n //// DEPRECATED : REMOVE ME : END ///////////////////////////////////////////\n }\n }\n await this.vaultClient.vaultIndexPut(encryptedIndex, indexOwnerUuid)\n }\n\n /**\n * adds or updates the index snapshot for the logged user\n * @param index\n */\n public async indexSnapshotAdd(index: VaultIndex) {\n if (!this.rsa) throw IncompleteAuthentication\n let rsaPub: Uint8Array = this.rsa.public()\n\n let cleanedIndex: VaultIndex = {\n [IndexKey.Consultation]: index[IndexKey.Consultation]\n ?.filter((c) => c)\n .map((c) => {\n return {\n grant: c.grant,\n consultationId: c.consultationId,\n }\n }),\n }\n\n // the data of the snapshot should not contain the `IndexEntry` data\n // (will create conflicts while updating)\n let encryptedIndexEntry = CryptoRSA.jsonWithPubEncryptToBase64(\n cleanedIndex,\n rsaPub\n )\n\n // The encryptedIndexEntry can have the uuid and timstamp (for updating)\n let encryptedIndex: EncryptedIndexEntry = {\n uuid: index.uuid,\n timestamp: index.timestamp,\n encryptedIndexEntry,\n }\n this.vaultClient.vaultIndexSnapshotPut(encryptedIndex)\n }\n\n /**\n * @name grantLockbox\n * @description Grants a lockbox by retrieving the shared secret of the lockbox and encrypting it with the grantees public key\n * @param granteeUuid\n * @param lockboxUuid\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n */\n public async grantLockbox(\n granteeUuid: Uuid,\n lockboxUuid: Uuid,\n lockboxOwnerUuid?: Uuid\n ) {\n if (!this.rsa) throw IncompleteAuthentication\n\n let secret = (\n await this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)\n ).key()\n let base64GranteePublicKey = (\n await this.guardClient.identityGet(granteeUuid)\n ).publicKey\n let granteePublicKey = this.toolbox.decodeFromBase64(\n base64GranteePublicKey\n )\n\n let granteeEncryptedSecret = CryptoRSA.bytesWithPubEncryptToBase64(\n secret,\n granteePublicKey\n )\n let request: LockboxGrantRequest = {\n encryptedSecret: granteeEncryptedSecret,\n granteeUuid: granteeUuid,\n }\n await this.vaultClient.lockboxGrant(\n lockboxUuid,\n request,\n lockboxOwnerUuid\n )\n }\n\n /**\n * @name createMessageData\n * @description Creates a Base64 encrypted Payload to send and store in the vault from a message string\n * @param lockboxUuid\n * @param message\n * @param consultationId the consultation for which this message is sent\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @param previousDataUuid if it's a revision of existing file, specify the previous data uuid\n * @returns the data uuid\n */\n public async createMessageData(\n lockboxUuid: Uuid,\n message: string,\n consultationId: string,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n if (!this.rsa) throw IncompleteAuthentication\n\n let symmetricEncryptor = await this.getCachedSecretCryptor(\n lockboxUuid,\n lockboxOwnerUuid\n )\n\n let encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(\n message\n )\n let encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(\n { author: (await this.guardClient.whoAmI()).sub }\n )\n\n let meta = {\n consultationId,\n category: MetadataCategory.Consultation,\n documentType: DocumentType.Message,\n contentType: 'text/plain',\n }\n\n let request: LockboxDataRequest = {\n data: encryptedData,\n publicMetadata: meta,\n privateMetadata: encryptedPrivateMeta,\n }\n\n return this.tellerClient.lockboxDataStore(\n lockboxUuid,\n request,\n lockboxOwnerUuid,\n previousDataUuid\n )\n }\n\n /**\n * @name createMessageAttachmentData\n * @description Creates a Base64 encrypted Payload to send and store in the vault from a file\n * @param lockboxUuid\n * @param data the file stored\n * @param consultationId the consultation for which this message is sent\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @param previousDataUuid if it's a revision of existing file, specify the previous data uuid\n * @returns the data uuid\n */\n public async createMessageAttachmentData(\n lockboxUuid: Uuid,\n data: File,\n consultationId: string,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n if (!this.rsa) throw IncompleteAuthentication\n\n let symmetricEncryptor = await this.getCachedSecretCryptor(\n lockboxUuid,\n lockboxOwnerUuid\n )\n let encryptedData = symmetricEncryptor.bytesEncryptToBase64Payload(\n new Uint8Array(await data.arrayBuffer())\n )\n let encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(\n {\n author: (await this.guardClient.whoAmI()).sub,\n fileName: data.name,\n lastModified: data.lastModified,\n size: data.size,\n }\n )\n\n let meta = {\n consultationId,\n category: MetadataCategory.Consultation,\n documentType: DocumentType.Message,\n contentType: data.type,\n }\n\n let request: LockboxDataRequest = {\n data: encryptedData,\n publicMetadata: meta,\n privateMetadata: encryptedPrivateMeta,\n }\n\n return this.tellerClient.lockboxDataStore(\n lockboxUuid,\n request,\n lockboxOwnerUuid,\n previousDataUuid\n )\n }\n\n /**\n * @name createAttachmentData\n * @description Creates a Base64 encrypted Payload to send and store in the vault from a file\n * @param lockboxUuid\n * @param data the file stored\n * @param consultationId the consultation for which this message is sent\n * @param category the category for the attachment data\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @param previousDataUuid if it's a revision of existing file, specify the previous data uuid\n * @returns the data uuid\n */\n public async createConsultationAttachmentData(\n lockboxUuid: Uuid,\n data: File,\n consultationId: string,\n documentType: DocumentType,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n if (!this.rsa) throw IncompleteAuthentication\n\n return this.createBytesData<Meta | any>(\n lockboxUuid,\n new Uint8Array(await data.arrayBuffer()),\n {\n consultationId,\n category: MetadataCategory.Consultation,\n documentType,\n contentType: data.type,\n },\n {\n author: (await this.guardClient.whoAmI()).sub,\n fileName: data.name,\n },\n lockboxOwnerUuid,\n previousDataUuid\n )\n }\n\n /**\n * @name createJsonData\n * @description Creates a Base64 encrypted Payload to send and store in the vault. With the data input as a JSON\n * @param lockboxUuid\n * @param data\n * @param meta\n * @param privateMeta the metadata that will be secured in the vault\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @param previousDataUuid if it's a revision of existing data, specify the previous data uuid\n * @returns the data uuid\n */\n public async createJsonData<T = Meta>(\n lockboxUuid: Uuid,\n data: any,\n meta?: T,\n privateMeta?: { [val: string]: any },\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n if (!this.rsa) throw IncompleteAuthentication\n\n let symmetricEncryptor = await this.getCachedSecretCryptor(\n lockboxUuid,\n lockboxOwnerUuid\n )\n let encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(data)\n let encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(\n privateMeta\n )\n\n let request: LockboxDataRequest = {\n data: encryptedData,\n publicMetadata: meta,\n privateMetadata: encryptedPrivateMeta,\n }\n\n return this.tellerClient.lockboxDataStore(\n lockboxUuid,\n request,\n lockboxOwnerUuid,\n previousDataUuid\n )\n }\n\n /**\n * Get or upsert a data in lockbox\n * @param lockboxUuid the lockbox uuid\n * @param data the data to insert\n * @param publicMetadata the public Metadata\n * @param privateMetadata the private Metadata\n * @param forceReplace set true when the insertion of data requires to replace the data when it exists already\n * @returns the data uuid\n */\n public async getOrInsertJsonData<M = Metadata>(\n lockboxUuid: Uuid,\n data: any,\n publicMetadata: M,\n privateMetadata: Metadata,\n forceReplace: boolean = false\n ): Promise<Uuid> {\n let manifest = await this.vaultClient.lockboxManifestGet(\n lockboxUuid,\n publicMetadata\n )\n if (!forceReplace && manifest.length > 0) {\n console.log(\n `The data for ${JSON.stringify(publicMetadata)} already exist`\n )\n return manifest[0].dataUuid\n } else\n return (\n await this.createJsonData<M>(\n lockboxUuid,\n data,\n publicMetadata,\n privateMetadata,\n undefined,\n forceReplace && manifest.length > 0\n ? manifest[0].dataUuid\n : undefined // if forceReplace and data already exist, then replace data. Otherwise insert it\n ).catch((err) => {\n console.error(\n `Error while upserting data ${JSON.stringify(\n publicMetadata\n )} data`,\n err\n )\n throw err\n })\n ).dataUuid\n }\n\n /**\n * @name createBytesData\n * @description Creates a Base64 encrypted Payload to send and store in the vault. With the data input as a Bytes\n * @param lockboxUuid\n * @param data\n * @param meta\n * @param privateMeta the metadata that will be secured in the vault\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @param previousDataUuid if it's a revision of existing data, specify the previous data uuid\n * @returns the data uuid\n */\n public async createBytesData<T = Meta>(\n lockboxUuid: Uuid,\n data: Uint8Array,\n meta: T,\n privateMeta: { [val: string]: any },\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n if (!this.rsa) throw IncompleteAuthentication\n let symmetricEncryptor = await this.getCachedSecretCryptor(\n lockboxUuid,\n lockboxOwnerUuid\n )\n let encryptedData = symmetricEncryptor.bytesEncryptToBase64Payload(data)\n let encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(\n privateMeta\n )\n\n let request: LockboxDataRequest = {\n data: encryptedData,\n publicMetadata: meta,\n privateMetadata: encryptedPrivateMeta,\n }\n\n return this.tellerClient.lockboxDataStore(\n lockboxUuid,\n request,\n lockboxOwnerUuid,\n previousDataUuid\n )\n }\n\n /**\n * @name getJsonData\n * @description Fetches and decrypts the lockbox data with the cached shared secret.\n * Decrypts the data to a valid JSON object. If this is impossible, the call to the WASM binary will fail\n *\n * @type T is the generic type specifying the return type object of the function\n * @param lockboxUuid\n * @param dataUuid\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @returns the data specified by the generic type <T>\n */\n public async getJsonData<T = any>(\n lockboxUuid: Uuid,\n dataUuid: Uuid,\n lockboxOwnerUuid?: Uuid\n ): Promise<T> {\n if (!this.rsa) throw IncompleteAuthentication\n\n let [encryptedPayload, symmetricDecryptor] = await Promise.all([\n this.vaultClient.lockboxDataGet(\n lockboxUuid,\n dataUuid,\n lockboxOwnerUuid\n ),\n this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid),\n ])\n\n return symmetricDecryptor.base64PayloadDecryptToJson(\n encryptedPayload.data\n )\n }\n /**\n * @description Fetches and decrypts the lockbox data with the cached shared secret.\n * @param lockboxUuid\n * @param dataUuid\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @returns the bytes data\n */\n public async getBytesData(\n lockboxUuid: Uuid,\n dataUuid: Uuid,\n lockboxOwnerUuid?: Uuid\n ): Promise<Uint8Array> {\n if (!this.rsa) throw IncompleteAuthentication\n\n let [encryptedPayload, symmetricDecryptor] = await Promise.all([\n this.vaultClient.lockboxDataGet(\n lockboxUuid,\n dataUuid,\n lockboxOwnerUuid\n ),\n this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid),\n ])\n\n return symmetricDecryptor.base64PayloadDecryptToBytes(\n encryptedPayload.data\n )\n }\n\n /**\n * @name getGrants\n * @description Get all lockboxes granted to user with the applied filter\n * @note this function returns cached grants and will not update unless the page is refreshed\n * @todo some versions of lockboxes do not make use of lockbox metadata\n * in this case, all lockboxes need to be filtered one-by-one to find the correct one\n * Remove if this is no longer the case\n * @param filter: the consultationId in which the grant exists\n * @returns decrypted lockboxes granted to user\n */\n public async getGrants(\n filter?: { consultationId: Uuid },\n forceRefresh: boolean = false\n ): Promise<Grant[]> {\n if (!this.rsa) throw IncompleteAuthentication\n\n let filterString = JSON.stringify(filter)\n // retrieves cached grants\n // Note: if filters is set to empty, it will be stored in the `undefined` key\n if (!forceRefresh && this.cachedMetadataGrants[filterString])\n return this.cachedMetadataGrants[filterString]\n\n // retrieves the consult lockbox from the vault directly if it exists\n // Note: will work only if the filter being applied is exclusively a consult id\n const grantsByConsultLockbox = (await this.vaultClient.vaultIndexGet([IndexKey.ConsultationLockbox], [filter?.consultationId!]))[IndexKey.ConsultationLockbox] \n const decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox ?? [], this.rsa)\n if (decryptedConsults.length > 0) {\n console.info('[sdk:index] Grants found in user`s constant time secure index')\n this.cachedMetadataGrants[JSON.stringify(filter)] = decryptedConsults\n return this.cachedMetadataGrants[filterString]\n }\n\n let encryptedGrants\n // if there are no grants with the applied filter from index, attempt for naive filter with backwards compatibility\n if (filter) {\n encryptedGrants = await filterGrantsWithLockboxMetadata(\n this, \n filter,\n this.vaultIndex,\n forceRefresh\n )\n } else {\n encryptedGrants = (await this.vaultClient.grantsGet()).grants\n }\n\n const decryptedGrants = await decryptGrants(encryptedGrants, this.rsa)\n // sets the cached grant\n this.cachedMetadataGrants[filterString] = decryptedGrants\n return decryptedGrants\n }\n\n /**\n * @name getCachedSecretCryptor\n * @description Retrieves the cached lockbox secret or fetches the secret from vault, then creates the symmetric cryptor and stores it in memory\n * @param lockboxUuid\n * @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)\n * @returns\n */\n async getCachedSecretCryptor(\n lockboxUuid: string,\n lockboxOwnerUuid?: string\n ): Promise<OroToolbox.CryptoChaCha> {\n if (!this.rsa) throw IncompleteAuthentication\n\n let index = this.secrets.findIndex(\n (secret) => secret.lockboxUuid === lockboxUuid\n )\n if (index === -1) {\n let encryptedSecret = (\n await this.vaultClient.lockboxSecretGet(\n lockboxUuid,\n lockboxOwnerUuid\n )\n ).sharedSecret\n\n let secret = this.rsa.base64DecryptToBytes(encryptedSecret)\n let cryptor = this.toolbox.CryptoChaCha.fromKey(secret)\n this.secrets.push({ lockboxUuid, cryptor })\n return cryptor\n } else {\n return this.secrets[index].cryptor\n }\n }\n\n /**\n * Retrieves the patient personal information associated to the `consultationId`\n * The `consultationId` only helps to retrieve the patient lockboxes\n * Note: it is possible to have several personal informations data\n * @param consultationId The consultation Id\n * @param category The personal MetadataCategory to fetch\n * @param forceRefresh force data refresh (default to false)\n * @returns the personal data\n */\n public async getPersonalInformationsFromConsultId(\n consultationId: Uuid,\n category:\n | MetadataCategory.Personal\n | MetadataCategory.ChildPersonal\n | MetadataCategory.OtherPersonal,\n forceRefresh = false\n ): Promise<LocalizedData<PopulatedWorkflowData>[]> {\n return this.getMetaCategoryFromConsultId(\n consultationId,\n category,\n forceRefresh\n )\n }\n\n /**\n * Retrieves the patient medical data associated to the `consultationId`\n * The `consultationId` only helps to retrieve the patient lockboxes\n * Note: it is possible to have several medical data\n * @param consultationId The consultation Id\n * @param forceRefresh force data refresh (default to false)\n * @returns the medical data\n */\n public async getMedicalDataFromConsultId(\n consultationId: Uuid,\n forceRefresh = false\n ): Promise<LocalizedData<PopulatedWorkflowData>[]> {\n return this.getMetaCategoryFromConsultId(\n consultationId,\n MetadataCategory.Medical,\n forceRefresh\n )\n }\n\n private async getMetaCategoryFromConsultId(\n consultationId: Uuid,\n category: MetadataCategory,\n forceRefresh = false\n ): Promise<LocalizedData<PopulatedWorkflowData>[]> {\n let grants = await this.getGrants({ consultationId })\n let workflowData: LocalizedData<PopulatedWorkflowData>[] = []\n for (let grant of grants) {\n let manifest = await this.getLockboxManifest(\n grant.lockboxUuid!,\n {\n category,\n documentType: DocumentType.PopulatedWorkflowData,\n consultationIds: [consultationId],\n },\n true,\n grant.lockboxOwnerUuid,\n forceRefresh\n )\n\n // TODO: find another solution for backwards compatibility (those without the metadata consultationIds)\n if (manifest.length === 0) {\n manifest = (\n await this.getLockboxManifest(\n grant.lockboxUuid!,\n {\n category,\n documentType: DocumentType.PopulatedWorkflowData,\n // backward compatiblility with TonTest\n },\n true,\n grant.lockboxOwnerUuid,\n forceRefresh\n )\n ).filter((entry) => !entry.metadata.consultationIds) // Keep only entries without associated consultationIds\n }\n let data = await Promise.all(\n manifest.map(async (entry) => {\n return {\n lockboxOwnerUuid: grant.lockboxOwnerUuid,\n lockboxUuid: grant.lockboxUuid!,\n dataUuid: entry.dataUuid,\n data: await this.getJsonData<PopulatedWorkflowData>(\n grant.lockboxUuid!,\n entry.dataUuid\n ),\n }\n })\n )\n workflowData = { ...workflowData, ...data }\n }\n return workflowData\n }\n\n /**\n * @description retrieves the personal information stored in the first owned lockbox\n * @param userId The user Id\n * @returns the personal data\n */\n public async getPersonalInformations(\n userId: Uuid\n ): Promise<LocalizedData<PopulatedWorkflowData>> {\n const grant = (await this.getGrants()).find(\n (lockbox) => lockbox.lockboxOwnerUuid === userId\n )\n\n if (!grant) {\n throw MissingGrant\n }\n\n const { lockboxUuid, lockboxOwnerUuid } = grant\n\n if (!lockboxUuid) throw MissingLockbox\n\n if (!lockboxOwnerUuid) throw MissingLockboxOwner\n\n const identificationDataUuid = (\n await this.getLockboxManifest(\n lockboxUuid,\n {\n category: MetadataCategory.Personal,\n documentType: DocumentType.PopulatedWorkflowData,\n },\n false,\n userId\n )\n )[0].dataUuid\n\n return {\n lockboxOwnerUuid,\n lockboxUuid,\n dataUuid: identificationDataUuid,\n data: await this.getJsonData<PopulatedWorkflowData>(\n lockboxUuid,\n identificationDataUuid\n ),\n }\n }\n\n /**\n * Retrieves the grant associated to a consultationId\n * @note returns the first grant only\n * @param consultationId The consultationId\n * @returns the grant\n */\n public async getGrantFromConsultId(\n consultationId: Uuid\n ): Promise<Grant | undefined> {\n let grants = await this.getGrants({ consultationId })\n\n if (grants.length === 0) {\n throw AssociatedLockboxNotFound\n }\n\n return grants[0]\n }\n\n /**\n * retrieves the identity associated to the `consultationId`\n * @param consultationId The consultation Id\n * @returns the identity\n */\n public async getIdentityFromConsultId(\n consultationId: Uuid\n ): Promise<IdentityResponse | undefined> {\n const grant = await this.getGrantFromConsultId(consultationId)\n\n if (grant && grant.lockboxOwnerUuid) {\n return await this.guardClient.identityGet(grant.lockboxOwnerUuid)\n } else {\n return undefined\n }\n }\n\n /**\n * retrieves the lockbox manifest for a given lockbox and add's its private metadata\n * @note the lockbox manifest will retrieved the cached manifest first unless force refresh is enabled\n * @param lockboxUuid\n * @param filter\n * @param expandPrivateMetadata\n * @param lockboxOwnerUuid\n * @param forceRefresh\n * @returns the lockbox manifest\n */\n public async getLockboxManifest(\n lockboxUuid: Uuid,\n filter: Metadata,\n expandPrivateMetadata: boolean,\n lockboxOwnerUuid?: Uuid,\n forceRefresh: boolean = false\n ): Promise<LockboxManifest> {\n let manifestKey = JSON.stringify({\n lockboxUuid,\n filter,\n expandPrivateMetadata,\n lockboxOwnerUuid,\n })\n if (!forceRefresh && this.cachedManifest[manifestKey])\n return this.cachedManifest[manifestKey]\n\n return this.vaultClient\n .lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid)\n .then((manifest) => {\n return Promise.all(\n manifest.map(async (entry) => {\n if (\n expandPrivateMetadata &&\n entry.metadata.privateMetadata\n ) {\n let privateMeta = await this.getJsonData<Metadata>(\n lockboxUuid!,\n entry.metadata.privateMetadata,\n lockboxOwnerUuid\n )\n entry.metadata = {\n ...entry.metadata,\n ...privateMeta,\n }\n }\n return entry\n })\n ).then(\n (manifest) => (this.cachedManifest[manifestKey] = manifest)\n )\n })\n }\n\n /**\n * @description Create or update the personal information and store it in the first owned lockbox\n * @param identity The identity to use\n * @param data The personal data to store\n * @param dataUuid (optional) The dataUuid to update\n * @returns\n */\n public async createPersonalInformations(\n identity: IdentityResponse,\n data: PopulatedWorkflowData,\n dataUuid?: string\n ): Promise<DataCreateResponse> {\n const lockboxUuid = (await this.getGrants()).find(\n (lockbox) => lockbox.lockboxOwnerUuid === identity.id\n )?.lockboxUuid\n\n if (lockboxUuid) {\n return this.createJsonData<PersonalMeta>(\n lockboxUuid,\n data,\n {\n category: MetadataCategory.Personal,\n documentType: DocumentType.PopulatedWorkflowData,\n },\n {},\n undefined,\n dataUuid\n )\n } else {\n throw MissingLockbox\n }\n }\n\n /**\n * Create or update user Preference\n * @param identity\n * @param preference\n * @param dataUuid\n * @returns\n */\n public async createUserPreference(\n identity: IdentityResponse,\n preference: UserPreference,\n dataUuid?: string\n ): Promise<DataCreateResponse> {\n const lockboxUuid = (await this.getGrants()).find(\n (lockbox) => lockbox.lockboxOwnerUuid === identity.id\n )?.lockboxUuid\n\n if (lockboxUuid) {\n return this.createJsonData<PreferenceMeta>(\n lockboxUuid,\n preference,\n {\n category: MetadataCategory.Preference,\n contentType: 'application/json',\n },\n {},\n undefined,\n dataUuid\n )\n } else {\n throw MissingLockbox\n }\n }\n\n /**\n * retrieves the user preference from a grant\n * @param grant The grant\n * @returns the user preference\n */\n public async getDataFromGrant<T = any>(\n grant: Grant,\n filter: Metadata\n ): Promise<LocalizedData<T>> {\n const { lockboxUuid, lockboxOwnerUuid } = grant\n\n if (!lockboxUuid) throw MissingLockbox\n if (!lockboxOwnerUuid) throw MissingLockboxOwner\n const identificationDataUuid = (\n await this.getLockboxManifest(\n lockboxUuid,\n\n filter,\n false,\n grant.lockboxOwnerUuid,\n true\n )\n )[0].dataUuid\n\n return {\n lockboxOwnerUuid,\n lockboxUuid,\n dataUuid: identificationDataUuid,\n data: await this.getJsonData<T>(\n lockboxUuid,\n identificationDataUuid\n ),\n }\n }\n\n /**\n * retrieves the user preference from a consultation id\n * @param consultationId The related consultationId\n * @returns the user preference\n */\n public async getUserPreferenceFromConsultId(\n consultationId: string\n ): Promise<LocalizedData<UserPreference>> {\n const grant = await this.getGrantFromConsultId(consultationId)\n\n if (!grant) throw MissingGrant\n\n return this.getDataFromGrant<UserPreference>(grant, {\n category: MetadataCategory.Preference,\n contentType: 'application/json',\n })\n }\n\n /**\n * retrieves the user preference stored in the first owned lockbox from identity\n * @param identity The identity to use\n * @returns the user preference\n */\n public async getUserPreference(\n identity: IdentityResponse\n ): Promise<LocalizedData<UserPreference>> {\n const grant = (await this.getGrants()).find(\n (lockbox) => lockbox.lockboxOwnerUuid === identity.id\n )\n\n if (!grant) throw MissingGrant\n\n return this.getDataFromGrant<UserPreference>(grant, {\n category: MetadataCategory.Preference,\n contentType: 'application/json',\n })\n }\n\n /**\n * retrieves the user preference from a consultation id\n * @param consultationId The related consultationId\n * @returns the user preference\n */\n public async getRecoveryDataFromConsultId(\n consultationId: string\n ): Promise<LocalizedData<RecoveryData>> {\n const grant = await this.getGrantFromConsultId(consultationId)\n\n if (!grant) throw MissingGrant\n\n return this.getDataFromGrant<RecoveryData>(grant, {\n category: MetadataCategory.Recovery,\n contentType: 'application/json',\n })\n }\n\n /**\n * retrieves the user preference stored in the first owned lockbox from identity\n * @param identity The identity to use\n * @returns the user preference\n */\n public async getRecoveryData(\n identity: IdentityResponse\n ): Promise<LocalizedData<RecoveryData>> {\n const grant = (await this.getGrants()).find(\n (lockbox) => lockbox.lockboxOwnerUuid === identity.id\n )\n\n if (!grant) throw MissingGrant\n\n return this.getDataFromGrant(grant, {\n category: MetadataCategory.Recovery,\n contentType: 'application/json',\n })\n }\n\n /**\n * @name getAssignedConsultations\n * @description finds all assigned or owned consultations for the logged user\n * Steps:\n * - Retrieves all granted lockboxes given to the logged user\n * - for each lockbox, find all consultation ids\n * - for each consultation id, retrieve the consult information\n * @param practiceUuid the uuid of the practice to look consult into\n * @returns the list of consults\n */\n public async getAssignedConsultations(\n practiceUuid: Uuid,\n forceRefresh: boolean = false\n ): Promise<Consult[]> {\n return Promise.all(\n (await this.getGrants(undefined, forceRefresh)).map((grant) =>\n this.getLockboxManifest(\n grant.lockboxUuid!,\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.PopulatedWorkflowData,\n },\n true,\n undefined,\n forceRefresh\n ).then((manifest) =>\n Promise.all(\n manifest.map(\n async (entry) =>\n await this.consultClient.getConsultByUUID(\n entry.metadata.consultationId,\n practiceUuid\n )\n )\n ).then((promise) => promise.flat())\n )\n )\n ).then((consults) => consults.flat())\n }\n\n /**\n * Gets the past consultations of the patient as well as his relatives if any\n * @param consultationId any consultation uuid from which we will fetch all the other consultations of the same patient as the owner of this consultation id\n * @param practiceUuid\n */\n public async getPastConsultationsFromConsultId(\n consultationId: string,\n practiceUuid: string\n ): Promise<Consult[] | undefined> {\n const grant = await this.getGrantFromConsultId(consultationId)\n if (!grant) return undefined\n\n let consultationsInLockbox: string[] = (\n await this.vaultClient.lockboxMetadataGet(\n grant.lockboxUuid!,\n ['consultationId'],\n ['consultationId'],\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.PopulatedWorkflowData,\n },\n grant.lockboxOwnerUuid\n )\n )\n .flat()\n .map(\n (metadata: { consultationId: string }) =>\n metadata.consultationId\n )\n\n if (consultationsInLockbox.length == 0) return []\n\n return await Promise.all(\n consultationsInLockbox.map(async (consultId: string) => {\n return await this.consultClient.getConsultByUUID(\n consultId,\n practiceUuid\n )\n })\n )\n }\n\n /**\n * @name getPatientConsultationData\n * @description retrieves the consultation data\n * @param consultationId\n * @returns\n */\n public async getPatientConsultationData(\n consultationId: Uuid,\n forceRefresh: boolean = false\n ): Promise<PopulatedWorkflowData[]> {\n //TODO: make use of getPatientDocumentsList instead of doing it manually here\n return Promise.all(\n (await this.getGrants({ consultationId }, forceRefresh))\n .map((grant) =>\n this.getLockboxManifest(\n grant.lockboxUuid!,\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.PopulatedWorkflowData,\n consultationId, //since we want to update the cached manifest (if another consult data exists)\n },\n true,\n grant.lockboxOwnerUuid,\n forceRefresh\n ).then((manifest) =>\n Promise.all(\n manifest.map((e) =>\n this.getJsonData<PopulatedWorkflowData>(\n grant.lockboxUuid!,\n e.dataUuid,\n grant.lockboxOwnerUuid\n )\n )\n )\n )\n )\n .flat()\n ).then((data) => data.flat())\n }\n\n /**\n * This function returns the patient prescriptions\n * @param consultationId\n * @returns\n */\n public async getPatientPrescriptionsList(\n consultationId: Uuid\n ): Promise<Document[]> {\n return this.getPatientDocumentsList(\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.Prescription,\n },\n true,\n consultationId\n )\n }\n\n /**\n * This function returns the patient results\n * @param consultationId\n * @returns\n */\n public async getPatientResultsList(\n consultationId: Uuid\n ): Promise<Document[]> {\n return this.getPatientDocumentsList(\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.Result,\n },\n true,\n consultationId\n )\n }\n\n /**\n * returns the patient treatment plan options\n * @param consultationId\n * @returns Document[] corresponding to the patient treatment plan options\n */\n public async getPatientTreatmentPlans(\n consultationId: Uuid\n ): Promise<Document[]> {\n return this.getPatientDocumentsList(\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.TreatmentPlan,\n },\n true,\n consultationId\n )\n }\n\n /**\n * returns a specific patient treatment plan option\n * @param consultationId\n * @param treatmentPlanId\n * @returns\n */\n public async getPatientTreatmentPlanByUuid(\n consultationId: Uuid,\n treatmentPlanId: Uuid\n ): Promise<Document[]> {\n return this.getPatientDocumentsList(\n {\n category: MetadataCategory.Consultation,\n documentType: DocumentType.TreatmentPlan,\n treatmentPlanId,\n },\n true,\n consultationId\n )\n }\n\n /**\n * @name getPatientDocumentsList\n * @description applies the provided filter to the vault to only find those documents\n * @param filters the applied filters (e.g. type of documents)\n * @param expandPrivateMetadata whether or not, the private metadata needs to be retrieved\n * (more computationally expensive)\n * @param consultationId\n * @returns the filtered document list\n */\n public async getPatientDocumentsList(\n filters: Object,\n expandPrivateMetadata: boolean,\n consultationId: Uuid\n ): Promise<Document[]> {\n return Promise.all(\n (await this.getGrants({ consultationId }))\n .map((grant) =>\n this.getLockboxManifest(\n grant.lockboxUuid!,\n { ...filters, consultationId },\n expandPrivateMetadata,\n grant.lockboxOwnerUuid,\n true\n ).then((manifest) =>\n Promise.all(\n manifest.map(\n async (entry): Promise<Document> => {\n return {\n lockboxOwnerUuid:\n grant.lockboxOwnerUuid,\n lockboxUuid: grant.lockboxUuid!,\n ...entry,\n }\n }\n )\n )\n )\n )\n .flat()\n ).then((data) => data.flat())\n }\n\n /****************************************************************************************************************\n * RECOVERY *\n ****************************************************************************************************************/\n\n /**\n * @name recoverPrivateKeyFromSecurityQuestions\n * @description Recovers and sets the rsa private key from the answered security questions\n * @param id\n * @param recoverySecurityQuestions\n * @param recoverySecurityAnswers\n * @param threshold the number of answers needed to recover the key\n */\n public async recoverPrivateKeyFromSecurityQuestions(\n id: Uuid,\n recoverySecurityQuestions: string[],\n recoverySecurityAnswers: string[],\n threshold: number\n ) {\n let shards: SecretShard[] = (await this.guardClient.identityGet(id))\n .recoverySecurityQuestions\n let answeredShards = shards\n .filter((shard: any) => {\n // filters all answered security questions\n let indexOfQuestion = recoverySecurityQuestions.indexOf(\n shard.securityQuestion\n )\n if (indexOfQuestion === -1) return false\n return (\n recoverySecurityAnswers[indexOfQuestion] &&\n recoverySecurityAnswers[indexOfQuestion] != ''\n )\n })\n .map((item: any) => {\n // appends the security answer to the answered shards\n let index = recoverySecurityQuestions.indexOf(\n item.securityQuestion\n )\n item.securityAnswer = recoverySecurityAnswers[index]\n return item\n })\n try {\n // reconstructs the key from the answered security answers\n let privateKey = this.toolbox.reconstructSecret(\n answeredShards,\n threshold\n )\n this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey)\n } catch (e) {\n console.error(e)\n }\n }\n\n /**\n * @name recoverPrivateKeyFromPassword\n * @description Recovers and sets the rsa private key from the password\n * @param id\n * @param password\n */\n public async recoverPrivateKeyFromPassword(id: Uuid, password: string) {\n let identity = await this.guardClient.identityGet(id)\n\n let recoveryPayload = identity.recoveryPassword\n let symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n password\n )\n let privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(\n recoveryPayload\n )\n\n if (identity.recoveryLogin) {\n //Ensure we can recover from a page reload\n let symetricEncryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n identity.recoveryLogin\n )\n sessionStorage.setItem(\n sessionStorePrivateKeyName(id),\n symetricEncryptor.bytesEncryptToBase64Payload(privateKey)\n )\n }\n\n this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey)\n }\n\n /**\n * @name recoverPrivateKeyFromMasterKey\n * @description Recovers and sets the rsa private key from the master key\n * @param id\n * @param masterKey\n */\n public async recoverPrivateKeyFromMasterKey(id: Uuid, masterKey: string) {\n let recoveryPayload = (await this.guardClient.identityGet(id))\n .recoveryMasterKey\n let symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n masterKey\n )\n let privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(\n recoveryPayload\n )\n this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey)\n }\n\n /**\n * @description Generates and updates the security questions and answers payload using new recovery questions and answers\n * Important: Since the security questions generate a payload for the private key, they will never be stored on the device as they must remain secret!!!\n * @param id\n * @param recoverySecurityQuestions\n * @param recoverySecurityAnswers\n * @param threshold the number of answers needed to rebuild the secret\n */\n public async updateSecurityQuestions(\n id: Uuid,\n recoverySecurityQuestions: string[],\n recoverySecurityAnswers: string[],\n threshold: number\n ) {\n if (!this.rsa) throw IncompleteAuthentication\n let securityQuestionPayload = this.toolbox.breakSecretIntoShards(\n recoverySecurityQuestions,\n recoverySecurityAnswers,\n this.rsa.private(),\n threshold\n )\n let updateRequest = {\n recoverySecurityQuestions: securityQuestionPayload,\n }\n\n return await this.guardClient.identityUpdate(id, updateRequest)\n }\n\n /**\n * @description Generates and stores the payload encrypted payload and updates the password itself (double hash)\n * @important\n * the recovery payload uses a singly hashed password and the password stored is doubly hashed so\n * the stored password cannot derive the decryption key in the payload\n * @note\n * the old password must be provided when not performing an account recovery\n * @param id\n * @param newPassword\n * @param oldPassword\n */\n public async updatePassword(\n id: Uuid,\n newPassword: string,\n oldPassword?: string\n ) {\n if (!this.rsa) throw IncompleteAuthentication\n\n let symmetricEncryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n newPassword\n )\n let passwordPayload = symmetricEncryptor.bytesEncryptToBase64Payload(\n this.rsa.private()\n )\n if (oldPassword) {\n oldPassword = this.toolbox.hashStringToBase64(\n this.toolbox.hashStringToBase64(oldPassword)\n )\n }\n\n newPassword = this.toolbox.hashStringToBase64(\n this.toolbox.hashStringToBase64(newPassword)\n )\n\n let updateRequest = {\n password: {\n oldPassword,\n newPassword,\n },\n recoveryPassword: passwordPayload,\n }\n\n return await this.guardClient.identityUpdate(id, updateRequest)\n }\n\n /**\n * @description Generates and stores the master key encrypted payload\n * Important\n * Since the master key is used to generate a payload for the private key, it will never be stored on the device as it must remain secret!\n * @param id\n * @param masterKey\n * @param lockboxUuid\n */\n async updateMasterKey(id: Uuid, masterKey: string, lockboxUuid: Uuid) {\n if (!this.rsa) throw IncompleteAuthentication\n\n let symmetricEncryptor = this.toolbox.CryptoChaCha.fromPassphrase(\n masterKey\n )\n let masterKeyPayload = symmetricEncryptor.bytesEncryptToBase64Payload(\n this.rsa.private()\n )\n let updateRequest = { recoveryMasterKey: masterKeyPayload }\n const updatedIdentity = await this.guardClient.identityUpdate(\n id,\n updateRequest\n )\n\n await this.getOrInsertJsonData<RecoveryMeta>(\n lockboxUuid,\n { masterKey },\n {\n category: MetadataCategory.Recovery,\n contentType: 'application/json',\n },\n {},\n true\n )\n\n return updatedIdentity\n }\n}\n","import {\n APIService,\n TellerService,\n VaultService,\n GuardService,\n PracticeService,\n ConsultService,\n WorkflowService,\n DiagnosisService,\n} from './services'\nimport { OroClient } from './client'\nimport * as OroToolboxNamespace from 'oro-toolbox'\n\nexport type OroToolbox = typeof OroToolboxNamespace\n\nexport let wasmPath = 'node_modules/oro-toolbox'\n\nconst init = (\n toolbox: OroToolbox,\n tellerBaseURL: string,\n vaultBaseURL: string,\n guardBaseURL: string,\n practiceBaseURL: string,\n consultBaseURL: string,\n workflowBaseURL: string,\n diagnosisBaseUrl: string,\n authenticationCallback?: (err: Error) => void,\n) => {\n const apiService = new APIService(undefined, authenticationCallback)\n const tellerService = new TellerService(apiService, tellerBaseURL)\n const practiceService = new PracticeService(\n toolbox,\n apiService,\n practiceBaseURL\n )\n const consultService = new ConsultService(apiService, consultBaseURL)\n const vaultService = new VaultService(apiService, vaultBaseURL)\n const guardService = new GuardService(apiService, guardBaseURL)\n const workflowService = new WorkflowService(apiService, workflowBaseURL)\n const diagnosisService = new DiagnosisService(apiService, diagnosisBaseUrl)\n const client = new OroClient(\n toolbox,\n tellerService,\n vaultService,\n guardService,\n practiceService,\n consultService,\n workflowService,\n diagnosisService,\n authenticationCallback\n )\n\n return client\n}\n\nexport { OroClient } from './client'\nexport * from './models'\nexport * from './helpers'\nexport * from './services'\nexport { OroToolboxNamespace }\nexport default init\n"],"names":["undefined","AxiosService","config","axios","create","apiRequest","url","data","headers","then","res","apiRequestHeader","headerToRetrieve","toLowerCase","get","method","deleteRequest","post","put","patch","head","APIService","tokenRefreshFailureCallback","self","interceptors","request","use","token","useRefreshToken","getTokens","refreshToken","accessToken","Authorization","error","Promise","reject","createAuthRefreshInterceptor","failedRequest","authRefreshFn","tokenResp","setTokens","response","resolve","console","statusCodes","setAuthRefreshFn","fn","tokens","localStorage","setItem","JSON","stringify","item","getItem","parse","AssistantType","TransmissionKind","TransmissionStatus","FeeStatus","MedicalStatus","TaskStatus","DiagnosisType","DrugType","PlanStatus","IncompleteAuthentication","Error","MissingGrant","MissingLockbox","MissingLockboxOwner","IndexBuildError","AssociatedLockboxNotFound","WorkflowAnswersMissingError","AuthenticationFailed","AuthenticationBadRequest","AuthenticationServerError","IdentityCreationFailed","IdentityCreationBadRequest","IdentityCreationConflict","WorkflowType","RateDimension","PlanType","PaymentStatus","PractitionerStatus","AssignmentStatus","PractitionnerRoleType","OtherRoleType","LicenseStatus","PeriodType","SyncStatus","PracticeEmailKind","PracticeConfigKind","StripePriceType","IndexKey","DocumentType","MetadataCategory","ConsultService","api","baseURL","consultCreate","c","countConsults","uuidPractice","uuidRequester","statusesMedical","statusesExclude","shortId","columnToSortTo","orderToSortTo","perPage","indexPage","filterAssignedDoctor","filterCurrentPractitioner","filterIsoLocality","params","page","sortColumns","orderColumns","resContentRange","parseInt","getConsults","getConsultByUUID","uuidConsult","updateConsultByUUID","consult","getConsultFaxStatuses","kind","Fax","postConsultTransmission","nameDriver","addressOrPhoneToSendTo","file","nameReceiver","txtTransmissionTitle","txtTransmissionNotes","FormData","append","postConsultFax","addressReceiver","postConsultEmail","retryConsultFax","transmissionId","status","Retrying","updateConsultTransmissionStatus","newStatus","DiagnosisService","getDiagnoses","getDiagnosisByUuid","uuidDiagnosis","createDiagnosis","diagnosis","updateDiagnosis","uuid","getTreatmentsFromDiagnosisUuid","diagnosisUuid","getTreatmentPlansFromConsultUuid","createTreatment","treatmentRequest","getTreatmentPlansPopulatedFromConsultUuid","populated","postPlans","plans","updateTreatmentPlan","uuidPlan","diagnosisRequest","plan","acceptTreatmentPlan","getAllDrugs","foundDrugs","GuardService","authRefresh","bind","identityCache","whoAmICache","authToken","req","skipAuthRefresh","resp","isAxiosError","code","authLogout","authRecover","identityCreate","identityGet","identityID","cacheKey","whoAmI","refreshCache","identityUpdate","identityMFAQRCode","password","PracticeService","toolbox","practiceGetFromURL","practiceURL","url_practice","practiceGetFromUuid","practiceUuid","locale","withAccounts","accounts","practiceConfigGetFromPracticeUuid","practiceConfigGetByKindForPracticeUuid","practiceConfigCreateForPracticeUuid","practiceConfigUpdate","practiceGetAccounts","practiceGetAccount","accountUuid","practiceGetWorkflows","practiceGetWorkflow","workflowType","practiceGetPlans","planType","practiceGetPlan","planId","practiceGetPlanPrices","practiceGetPayments","practiceGetPayment","idStripeInvoiceOrPaymentIntent","practiceGetPaymentForStripePaymentIntentWithID","stripePaymentIntentId","practiceGetPaymentsIntents","getPaymentIntentHashedEmail","email","hashStringToBase64","practiceCreatePaymentsIntent","userEmail","isoLocality","url_subdomain","promotionCode","idPlan","hashUserEmail","practiceGetPaymentsIntent","paymentIntentId","practiceUpdatePaymentsIntent","idPraticePaymentIntent","practicePaymentIntent","practiceGetPractitioners","practiceUpdatePractitioner","practitionerUuid","requestBody","practiceGetPractitioner","practiceGetPractitionerLicenses","practiceCreatePractitionerLicense","practiceUpdatePractitionerLicense","licenseId","practiceGetPractitionerLicense","practiceGetPractitionerPreferences","practiceCreatePractitionerPreference","practiceUpdatePractitionerPreference","preferenceId","practiceGetPractitionerPreference","practiceGetPractitionerRoles","practiceCreatePractitionerRole","practiceDeletePractitionerRoles","practiceUpdatePractitionerRole","roleId","practiceGetPractitionerRole","practiceDeletePractitionerRole","practiceGetPractitionerSignature","responseType","practiceGetAssignments","practiceCreateAssignment","practiceUpdateAssignment","assignmentId","practiceGetAssignment","practiceGetQuotas","practiceGetQuota","quotaId","TellerService","lockboxDataStore","lockboxUuid","lockboxOwnerUuid","previousDataUuid","lockbox_owner_uuid","data_uuid","patientUuid","statusMedical","neverExpires","VaultService","lockboxCreate","lockboxMetadata","lockboxMetadataAdd","lockboxSecretGet","lockboxGrant","grantsGet","lockboxDataGet","dataUuid","stream","lockboxManifestGet","filter","lockboxMetadataGet","fields","groupby","vaultIndexPut","entries","indexOwnerUuid","index_owner_uuid","vaultIndexSnapshotPut","entry","vaultIndexGet","indexKeys","identifiers","timestamp","index_keys","WorkflowService","v1Url","getWorkflows","getWorkflow","id","createdAt","CliniaService","apiKey","placeSearch","searchOptions","placeMatch","type","places","place","personalMetaToPrefix","Personal","ChildPersonal","OtherPersonal","identificationToPersonalInformations","category","prefix","birthday","firstname","gender","name","phone","zip","hid","pharmacy","address","toActualObject","ret","Object","forEach","key","field","displayedAnswer","answer","updatePersonalIntoPopulatedWorkflowData","infos","extractISOLocalityForConsult","answers","arrAnswersWithLocality","flatMap","currentAnswerPage","arrCountryFields","keys","workflowFieldName","indexOf","flat","arrProvinceFields","arrConsultLocalFields","map","currentFieldName","arrSelectedLocality","currentSelectedLocality","startsWith","length","log","allowedLocalityPatterns","finalLocality","reduce","extractedSelected","exec","indexSelectedPriority","isoSelectedValue","extractedFinal","indexFinalPriority","isoFinalValue","sessionPrivateKeyPrefix","sessionStorePrivateKeyName","filterTriggeredAnsweredWithKind","workflowData","selectedAnswers","flattenedAnswers","flattenSelectedAnswers","triggeredQuestionsWithKind","fromEntries","pages","a","questions","question","isTriggered","triggers","samePageAnswers","prev","cur","questionFieldName","getWorkflowDataByCategory","triggeredQuestions","all","e","k","v","populateWorkflowField","populatedValue","workflowCreatedAt","workflowId","err","getImagesFromIndexDb","getMany","answerValue","text","value","images","image","imageData","trigger","includes","linearAnswers","push","values","getInitialisedSelectedAnswers","workflow","useDefault","defaultValue","fillWorkflowFromPopulatedWorkflow","populatedWorkflow","filledWorkflow","pageIdx","MAX_RETRIES","registerPatient","consultRequest","oroClient","masterKey","recoveryQA","practitionerAdmin","retry","isExistingPatient","setTimeout","practiceClient","uuidAdmin","practitioners","getOrCreatePatientConsultationUuid","getOrCreatePatientLockbox","patientConsultExists","grantLockbox","grantPromises","practitioner","storePatientData","isoLanguageRequired","consultIndex","ConsultationLockbox","grant","consultationId","consultIndexPromises","vaultIndexAdd","deprecatedConsultIndex","Consultation","deprecatedConsultIndexPromises","updateMasterKey","updateSecurityQuestions","recoverySecurityQuestions","recoverySecurityAnswers","consultClient","New","cleanIndex","currentConsultation","publicMetadata","documentType","PopulatedWorkflowData","vaultClient","manifest","findIndex","payment","getGrants","grants","isoLanguage","storeImageAliases","getOrInsertJsonData","Raw","contentType","Medical","consultationIds","extractAndStorePersonalWorkflowData","Preference","dataUuids","nonNullImages","img","promises","ImageAlias","idbId","decryptGrants","encryptedGrants","rsaKey","encryptedLockbox","uuidParse","base64DecryptToBytes","decryptConsultLockboxGrants","encryptedConsultLockboxes","base64DecryptToJson","encryptedIndexEntry","grantsTuple","grantTuples","filterGrantsWithLockboxMetadata","vaultIndex","forceRefresh","buildLegacyVaultIndex","indexConsults","consultGrant","consultGrants","consults","setVaultIndex","info","OroClient","tellerClient","guardClient","workflowClient","diagnosisClient","authenticationCallback","cachedMetadataGrants","cachedManifest","signUp","practice","tosAndCpAcceptance","tokenData","subscription","rsa","CryptoRSA","privateKey","symmetricEncryptor","CryptoChaCha","fromPassphrase","recoveryPassword","bytesEncryptToBase64Payload","hashedPassword","signupRequest","publicKey","encodeToBase64","identity","recoveryLogin","symetricEncryptor","sessionStorage","confirmEmail","claims","sub","emailConfirmed","signIn","otp","tokenRequest","userUuid","recoverPrivateKeyFromPassword","resumeSession","recoveryPayload","recoveryKey","symmetricDecryptor","base64PayloadDecryptToBytes","fromKey","localEncryptToJsonPayload","chaChaKey","encryptedData","jsonEncryptToBase64Payload","encryptedKey","encryptToBytes","localDecryptJsonPayload","decryptedData","base64PayloadDecryptToJson","signOut","secrets","buildVaultIndex","index","forceUpdateIndexEntries","indexConsultLockbox","alert","base64IndexOwnerPubKey","rsaPub","decodeFromBase64","encryptedIndex","keyString","uniqueHash","jsonWithPubEncryptToBase64","find","indexSnapshotAdd","cleanedIndex","granteeUuid","getCachedSecretCryptor","secret","base64GranteePublicKey","granteePublicKey","granteeEncryptedSecret","bytesWithPubEncryptToBase64","encryptedSecret","createMessageData","message","author","encryptedPrivateMeta","meta","Message","privateMetadata","createMessageAttachmentData","Uint8Array","arrayBuffer","lastModified","size","fileName","createConsultationAttachmentData","createBytesData","createJsonData","privateMeta","forceReplace","getJsonData","encryptedPayload","getBytesData","filterString","grantsByConsultLockbox","decryptedConsults","decryptedGrants","sharedSecret","cryptor","getPersonalInformationsFromConsultId","getMetaCategoryFromConsultId","getMedicalDataFromConsultId","getLockboxManifest","metadata","getPersonalInformations","userId","lockbox","identificationDataUuid","getGrantFromConsultId","getIdentityFromConsultId","expandPrivateMetadata","manifestKey","createPersonalInformations","createUserPreference","preference","getDataFromGrant","getUserPreferenceFromConsultId","getUserPreference","getRecoveryDataFromConsultId","Recovery","getRecoveryData","getAssignedConsultations","promise","getPastConsultationsFromConsultId","consultationsInLockbox","consultId","getPatientConsultationData","getPatientPrescriptionsList","getPatientDocumentsList","Prescription","getPatientResultsList","Result","getPatientTreatmentPlans","TreatmentPlan","getPatientTreatmentPlanByUuid","treatmentPlanId","filters","recoverPrivateKeyFromSecurityQuestions","threshold","shards","answeredShards","shard","indexOfQuestion","securityQuestion","securityAnswer","reconstructSecret","recoverPrivateKeyFromMasterKey","recoveryMasterKey","securityQuestionPayload","breakSecretIntoShards","updateRequest","updatePassword","newPassword","oldPassword","passwordPayload","masterKeyPayload","updatedIdentity","wasmPath","init","tellerBaseURL","vaultBaseURL","guardBaseURL","practiceBaseURL","consultBaseURL","workflowBaseURL","diagnosisBaseUrl","apiService","tellerService","practiceService","consultService","vaultService","guardService","workflowService","diagnosisService","client"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,UAAU,OAAO,EAAE;AAElC;AACA,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AACjC,EAAE,IAAIA,WAAS,CAAC;AAChB,EAAE,IAAI,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,GAAG,EAAE,CAAC;AAC3D,EAAE,IAAI,cAAc,GAAG,OAAO,CAAC,QAAQ,IAAI,YAAY,CAAC;AACxD,EAAE,IAAI,mBAAmB,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAiB,CAAC;AACvE,EAAE,IAAI,iBAAiB,GAAG,OAAO,CAAC,WAAW,IAAI,eAAe,CAAC;AACjE;AACA,EAAE,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;AACnC,IAA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