oro-sdk-apis 5.14.0 → 5.14.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"oro-sdk-apis.esm.js","sources":["../src/helpers/hash.ts","../node_modules/regenerator-runtime/runtime.js","../src/services/axios.ts","../src/services/api.ts","../src/services/apisPracticeManager.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/models/search.ts","../src/services/consult.ts","../src/services/diagnosis.ts","../src/services/guard.ts","../src/services/search.ts","../src/services/practice.ts","../src/services/teller.ts","../src/services/vault.ts","../src/services/workflow.ts","../src/helpers/init.ts"],"sourcesContent":["import { sha256 } from 'hash.js'\nimport { Buffer } from 'buffer/'\n\n/**\n * This function return a base64 string representation of a hashed string\n * @param value the string to hash\n * @returns a base64 string representation of a hashed value\n */\nexport function hashToBase64String(value: string): string {\n return Buffer.from(sha256().update(value).digest('hex'), 'hex').toString('base64')\n}\n","/**\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\nexport class APIService extends AxiosService {\n private authRefreshFn?: AuthRefreshFunc\n private tokens: Tokens = {}\n\n /**\n * The API Service lets you use an axios API and handles oro backend services authentification via JWT tokens\n * @param useLocalStorage if set to true, tokens will be stored in localStorage\n * @param config (optional) an axios config\n * @param tokenRefreshFailureCallback (optional) callback to call when failing to refresh the auth token\n */\n constructor(\n private useLocalStorage: boolean,\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(\n this.axios,\n 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 ${\n self.getTokens().accessToken\n }`\n return Promise.resolve()\n } catch (e) {\n console.error('an error occured while refreshing tokens (notifying callback)', e)\n if (self.tokenRefreshFailureCallback) 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\n public setAuthRefreshFn(fn: AuthRefreshFunc) {\n this.authRefreshFn = fn\n }\n\n public setTokens(tokens: Tokens) {\n if (this.useLocalStorage) {\n localStorage.setItem('tokens', JSON.stringify(tokens))\n }\n this.tokens = tokens\n }\n\n public getTokens(): Tokens {\n if (this.useLocalStorage) {\n let tokens: Tokens = {}\n const item = localStorage.getItem('tokens')\n if (item) {\n tokens = JSON.parse(item)\n }\n return tokens\n } else {\n return this.tokens\n }\n }\n}\n","import { init } from '../helpers'\nimport { AuthTokenResponse, ServiceCollection, ServiceCollectionRequest } from '../models'\nimport { GuardService } from './guard'\n\n/**\n * This service enables you to handle one authentication token per practice\n */\nexport class ApisPracticeManager {\n private practiceInstances = new Map<string, ServiceCollection>()\n\n /**\n * The constructor\n * @param serviceCollReq the services to initialize. Only filled urls will get corresponding service to be initialized.\n * It will be used each time a new practices needs a `ServiceCollection`\n * @param getAuthTokenCbk the callback function used to get a new JWT token\n * @param useLocalStorage (default: false) if true store tokens into local storage (only for browsers)\n */\n constructor(\n private serviceCollReq: ServiceCollectionRequest,\n private getAuthTokenCbk: (guard: GuardService, practiceUuid?: string) => Promise<AuthTokenResponse>,\n private useLocalStorage = false\n ) {}\n\n /**\n * This function is used to get a `ServiceCollection` associated to a practice. If missing, it will initialize a new `ServiceCollection`.\n * @param practiceUuid the uuid of the practice\n * @returns a promise holding a `ServiceCollection`\n */\n public async get(practiceUuid?: string): Promise<ServiceCollection> {\n const cacheKey = practiceUuid ?? 'none'\n const practiceInstance = this.practiceInstances.get(cacheKey)\n if (practiceInstance) return practiceInstance\n\n const newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage)\n\n // Create one auth token callback per practice since the practice uuid needs to change\n const authTokenFunc = async () => {\n if (newPracticeInstance.guardService) {\n console.log(`\\x1b[36m[Auth] Refresh auth called (practiceUuid: ${practiceUuid})\\x1b[36m`)\n return await this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid)\n } else {\n throw Error('[Auth] Unable to refresh token guard service is undefined')\n }\n }\n\n // Initialize the M2M token\n await authTokenFunc()\n\n // Set the refresh tokens callback\n newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc)\n\n this.practiceInstances.set(cacheKey, newPracticeInstance)\n\n return newPracticeInstance\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 ConsultType {\n Onboard = 'Onboard',\n Refill = 'Refill',\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 Assigning = 'Assigning',\n Assigned = 'Assigned',\n New = 'New',\n ToAnswer = 'ToAnswer',\n Answered = 'Answered',\n Closed = 'Closed',\n Reopened = 'Reopened',\n Archived = 'Archived',\n Failed = 'Failed',\n}\n\nexport enum TaskStatus {\n None = 'None',\n ToDo = 'ToDo',\n InProgress = 'InProgress',\n Blocked = 'Blocked',\n Done = 'Done',\n}\n\nexport enum ClosedReasonType {\n /**\n * A completed consultation\n */\n Completed = 'Completed',\n /**\n * The conclusion was that what the patient submitted was not a disease\n */\n NotADisease = 'NotADisease',\n /**\n * The consultation was not appropriate for virtual\n */\n NotAppropriateForVirtual = 'NotAppropriateForVirtual',\n /**\n * Any other reason why the consultation was closed\n */\n Other = 'Other',\n /**\n * A consultation that is required to be done in person\n */\n RequiresInPerson = 'RequiresInPerson',\n}\n\nexport interface ClosedConsultReasonInsertFields {\n /**\n * The uuid of the consultation\n */\n consult_uuid: string\n /**\n * The reason why the consultation was closed\n */\n closed_reason_type: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closed_reason_description: string\n /**\n * When the consultation was closed\n */\n created_at: string\n}\n\nexport interface ConsultClosedReason {\n /**\n * The reason why the consultation was closed\n */\n closedReasonType: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closedReasonDescription?: string\n}\n\nexport interface ConsultRequest {\n uuidPractice: string\n consultType?: ConsultType\n tagSpecialtyRequired: string\n idStripeInvoiceOrPaymentIntent: string\n isoLocalityRequired?: string\n isoLanguageRequired: string\n uuidParent?: 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 consultType: ConsultType\n uuidAssignedDoctor: string\n uuidCurrentAssigned: string\n uuidParent?: string\n statusTask?: TaskStatus\n hasTransmissions?: boolean\n assignedAssistant?: ConsultAssignedAssistant[]\n closeConsultReason?: ConsultClosedReason\n shortId?: string\n createdAt?: string\n expiresAt?: string\n}\n","export enum VisibilityType {\n Generic = 'Generic',\n Private = 'Private',\n Instance = 'Instance',\n}\n\nexport type DiagnosisType = VisibilityType\n\nexport type TreatmentType = VisibilityType\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\n// Type defined to store all consult related data linked to a given treatment\nexport interface TreatmentAssociatedConsultData {\n uuidConsult: string\n consultKind: string\n}\n\nexport interface TreatmentRequest {\n uuid?: string\n uuidDiagnosis?: string\n uuidParentTreatment?: string\n uuidPreviousRevision?: string\n name: string\n description: string\n refillable?: boolean\n noteToPharmacy?: string\n urlMultimedia?: string\n type?: TreatmentType\n}\n\nexport interface Treatment extends TreatmentRequest {\n uuid: string\n uuidDiagnosis: string\n uuidPractitioner?: string\n createdAt: string\n arrAssociatedConsults?: TreatmentAssociatedConsultData[]\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 posology?: string // drug posology\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\n/**\n * Status of the prescription\n * Right now, it only serves a soft delete flag\n */\nexport enum PrescriptionStatus {\n Existing = 'Existing',\n Deleted = 'Deleted',\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 status?: PrescriptionStatus\n createdAt: string\n}\n\nexport enum PlanStatus {\n Pending = 'Pending',\n Accepted = 'Accepted',\n Rejected = 'Rejected',\n PreviouslyAccepted = 'PreviouslyAccepted',\n}\n\nexport interface TreatmentPlan {\n uuid: string\n uuidConsult: string\n uuidDiagnosis: string\n uuidTreatment?: string\n notes?: string\n status: PlanStatus\n decidedAt: string\n createdAt: string\n}\n\nexport interface DrugPrescription {\n prescription: Prescription\n drug: Drug\n}\n\nexport interface TreatmentAndDrugPrescription {\n treatmentsHistory?: TreatmentHistory[]\n notes?: string\n status: PlanStatus\n uuidTreatmentPlan: string\n /**\n * this field is used to store the datetime when the patient accepted or refused the prescription\n */\n decidedAt?: string\n createdAt: string\n}\n\n/**\n * An entry in the history of the treatments of the patient.\n * The history entry consists of the treatment and the prescriptions and the drugs\n * that were prescribed to the patient at that point of history\n */\nexport interface TreatmentHistory {\n treatment: Treatment\n treatmentRevisions: Treatment[]\n prescriptionsAndDrugs: DrugPrescription[]\n}\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 * request to refill the treatment plan\n */\n refill?: boolean\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\nexport interface TreatmentAssociatedConsultDataResponse extends Array<TreatmentAssociatedConsultData> {}\n","export class AuthenticationFailed extends Error { }\nexport class AuthenticationBadRequest extends Error { }\nexport class AuthenticationServerError extends Error { }\nexport class AuthenticationUnconfirmedEmail extends Error { }\nexport class IdentityCreationFailed extends Error { }\nexport class IdentityCreationBadRequest extends Error { }\nexport class IdentityCreationConflict extends Error { }\nexport class VaultDataMissing extends Error { }","import { PlaceData } from '.'\n\nexport 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 SuccessAndDelivered = 'SuccessAndDelivered',\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 Closed = 'Closed',\n PasswordRecovery = 'PasswordRecovery',\n FaxFailed = 'FaxFailed',\n ExamResult = 'ExamResult',\n Reassigned = 'Reassigned',\n OnlinePharmacyFaxSent = 'OnlinePharmacyFaxSent',\n ResumeConsult = 'ResumeConsult',\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\n/**\n * Defines all the practice config kind.\n *\n * Please respect the following when defining a new practice config:\n * - be really specific on its role\n * - all configs needs to have default values in app\n * - the default behavior should always to be display the feature.\n * In other words, practice configs should either be used to hide a functionnality or overwrite a default behavior.\n * To be extra explicit, if you want to show a functionnality only in one practice, you will have to add a practice configs in all other practice to hide it (yes it is cumbersome).\n *\n */\nexport enum PracticeConfigKind {\n PatientConsultCard = 'PatientConsultCard',\n PracticeCloseConsultationTypes = 'PracticeCloseConsultationTypes',\n PracticeConsultTabs = 'PracticeConsultTabs',\n PracticeConfigExample = 'PracticeConfigExample',\n PracticeCookieBanner = 'PracticeCookieBanner',\n PracticeCssVariables = 'PracticeCssVariables',\n PracticeFontsLinks = 'PracticeFontsLinks',\n PracticeLocaleSwitcher = 'PracticeLocaleSwitcher',\n PracticePharmacyPicker = 'PracticePharmacyPicker',\n PracticePrescriptionFields = 'PracticePrescriptionFields',\n PractitionerChatbox = 'PractitionerChatbox',\n PractitionerConsultList = 'PractitionerConsultList',\n PractitionerSearch = 'PractitionerSearch',\n PracticeRegisterWalkthrough = 'PracticeRegisterWalkthrough',\n PracticeExamsAndResults = 'PracticeExamsAndResults',\n PracticeLayout = 'PracticeLayout',\n PracticeAddressField = 'PracticeAddressField',\n PracticeDiagnosisAndTreatment = 'PracticeDiagnosisAndTreatment',\n PracticeInfoLetterDiscount = 'PracticeInfoLetterDiscount',\n}\n\n/**\n * Defines the close consultation types to hide in the close consultation modal of a practice\n */\nexport type PracticeConfigPracticeCloseConsultationTypes = PracticeConfig<\n PracticeConfigKind.PracticeCloseConsultationTypes,\n {\n /**\n * Should hide item with value \"Completed\"\n */\n hideCompleted?: boolean\n\n /**\n * Should hide item with value \"Requires-in-person\"\n */\n hideRequiresInPerson?: boolean\n\n /**\n * Should hide item with value \"Other\"\n */\n hideOther?: boolean\n\n /**\n * Should hide item with value \"Not-a-disease\"\n */\n hideNotADisease?: boolean\n\n /**\n * Should hide item with value \"Appropriate-for-virtual\"\n */\n hideNotAppropriateForVirtual?: boolean\n }\n>\n\n/**\n * Generic interface of a practice config\n *\n * Practice configs needs to have a JSDoc for **all** interface and fields.\n *\n */\nexport interface PracticeConfig<K, T> {\n /**\n * The uuid of the practice to apply the config\n */\n uuidPractice: string\n /**\n * The kind of the practice config. Used as a discriminator to help auto-completion.\n */\n kind: PracticeConfigKind\n /**\n * The actual interface of the config\n */\n config: T\n}\n\nexport type PracticeConfigPatientConsultCard = PracticeConfig<\n PracticeConfigKind.PatientConsultCard,\n { hideDiagnosis?: boolean }\n>\n\nexport type PracticeConfigPracticeConsultTabs = PracticeConfig<\n PracticeConfigKind.PracticeConsultTabs,\n { hideDxTx?: boolean }\n>\n\n/**\n * This type is for test (do not remove without updating the integration tests)\n */\nexport type PracticeConfigPracticeConfigExample = PracticeConfig<\n PracticeConfigKind.PracticeConfigExample,\n { primaryColor?: string }\n>\n\n/**\n * Defines the practice cookie banner\n */\nexport type PracticeConfigPracticeCookieBanner = PracticeConfig<\n PracticeConfigKind.PracticeCookieBanner,\n {\n showCookieBanner?: boolean\n policyLink?: string\n useOfCookieLink?: string\n }\n>\n\n/**\n * This interface describes all practice css variables\n * The keys should reflect the exact css name\n */\nexport type PracticeConfigPracticeCssVariables = PracticeConfig<\n PracticeConfigKind.PracticeCssVariables,\n Record<string, string>\n>\n\n/**\n * Defines the font of the practice css url\n */\nexport type PracticeConfigPracticeFontsLinks = PracticeConfig<\n PracticeConfigKind.PracticeFontsLinks,\n {\n /**\n * sans serif font family\n */\n sansSerif?: string\n /**\n * serif font family\n */\n serif?: string\n }\n>\n\n/**\n * Defines the locale switcher config\n */\nexport type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<\n PracticeConfigKind.PracticeLocaleSwitcher,\n {\n /**\n * Should hide the locale switcher\n */\n hideLocaleSwitcher?: boolean\n }\n>\n\n/**\n * Defines the online pharmacy address of the practice\n */\nexport type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<\n PracticeConfigKind.PracticePharmacyPicker,\n {\n /**\n * The address of the online pharmacy\n */\n onlinePharmacy?: PlaceData\n /**\n * Shows or hides the address input field in the treatment acceptance modal\n */\n showTreatmentAcceptanceAddressInput: boolean\n }\n>\n\n/**\n * Defines the consultation chatbox configs\n */\nexport type PracticeConfigPractitionerChatbox = PracticeConfig<\n PracticeConfigKind.PractitionerChatbox,\n {\n /**\n * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been added. Indexed by locale.\n */\n planAddedMessage?: { [languageISO639_3: string]: string }\n /**\n * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been updated. Indexed by locale.\n */\n planUpdatedMessage?: { [languageISO639_3: string]: string }\n /**\n * If defined will replace the automatic chatbox comment notifiying the patient a new exam has been dispatched. Indexed by locale.\n */\n examsUpdatedMessage?: { [languageISO639_3: string]: string }\n }\n>\n\n/**\n * This config is used to configure the layout of the consult list for practitioners\n */\nexport type PracticeConfigPractitionerConsultList = PracticeConfig<\n PracticeConfigKind.PractitionerConsultList,\n {\n /**\n * Hides the locality column\n */\n hideLocality?: boolean\n /**\n * Hides the plan name column\n */\n hidePlan?: boolean\n /**\n * Hides the fax column\n */\n hideFax?: boolean\n /**\n * Hides the expires at column\n */\n hideExpiresAt?: boolean\n }\n>\n\n/**\n * This config is used to configure the layout of the modular prescription fields\n */\nexport type PracticeConfigPracticePrescriptionFields = PracticeConfig<\n PracticeConfigKind.PracticePrescriptionFields,\n {\n /**\n * the y position in px of the first modular prescription\n */\n yCoordinate?: number\n }\n>\n\n/**\n * This config is used to enable or disable the Search feature\n */\nexport type PracticeConfigPractitionerSearch = PracticeConfig<\n PracticeConfigKind.PractitionerSearch,\n {\n /**\n * Disable search indexing a consultation on its creation\n */\n disableSearchIndexing?: boolean\n /**\n * Disable search for consultations from the ConsultList\n */\n disableSearch?: boolean\n }\n>\n\n/**\n * This config is used to configure the register walkthrough\n */\nexport type PracticeConfigPracticeRegisterWalkthrough = PracticeConfig<\n PracticeConfigKind.PracticeRegisterWalkthrough,\n {\n /**\n * The workflow uuid containing the walkthrough to display. If not defined, the walkthrough slides screen is skipped.\n */\n workflowUuid?: string\n }\n>\n\n/**\n * This config is used for all configs related to the Exams and Results module\n */\nexport type PracticeConfigPracticeExamsAndResults = PracticeConfig<\n PracticeConfigKind.PracticeExamsAndResults,\n {\n /**\n * If true, then show the deprecated URL prescription pad\n */\n showUrlPrescriptionPad?: boolean\n }\n>\n\n/**\n * This config is used for all configs related to the Layout of the app (Navbar, Footer, etc)\n */\nexport type PracticeConfigPracticeLayout = PracticeConfig<\n PracticeConfigKind.PracticeLayout,\n {\n /**\n * If true, then show the FAQ link in the Navbar\n */\n showFaqLink?: boolean\n }\n>\n\n/**\n * This config is used for all configs related to the Google Places address field\n */\nexport type PracticeConfigPracticeAddressField = PracticeConfig<\n PracticeConfigKind.PracticeAddressField,\n {\n /**\n * If true, then show the long version of the address, otherwise, show the short version\n */\n longAddress?: boolean\n }\n>\n\n/**\n * This config is used for all configs related to the Diagnosis and Treatments module\n */\nexport type PracticeConfigPracticeDiagnosisAndTreatment = PracticeConfig<\n PracticeConfigKind.PracticeDiagnosisAndTreatment,\n {\n /**\n * If true, then sort alphabetically the diagnoses, treatments, and drugs shown in their respective select dropdown\n */\n sortNames?: boolean\n /**\n * If true, it enables the Prescription Refill feature\n */\n enableRefill?: boolean\n }\n>\n\n/**\n * This config is used to set a discount code in case the info letter is accepted by the patient\n */\nexport type PracticeConfigPracticeInfoLetterDiscount = PracticeConfig<\n PracticeConfigKind.PracticeInfoLetterDiscount,\n {\n /**\n * The discount code to be applied when the info letter is accepted\n */\n discountCode?: string\n\n /**\n * Show the info letter subscription without a Discount code before the patient confirms his email,\n * if he confirms his email but still didn't check the subscription, then display a discount code for subscribing\n */\n promptInfoLetterBeforeEmailConfirmed?: boolean\n }\n>\n\nexport type PracticeConfigs =\n | PracticeConfigPractitionerSearch\n | PracticeConfigPractitionerConsultList\n | PracticeConfigPractitionerChatbox\n | PracticeConfigPracticeLocaleSwitcher\n | PracticeConfigPracticeCookieBanner\n | PracticeConfigPracticeOnlinePharmacy\n | PracticeConfigPracticeCssVariables\n | PracticeConfigPracticeFontsLinks\n | PracticeConfigPracticePrescriptionFields\n | PracticeConfigPracticeConfigExample // Here for integration tests only\n | PracticeConfigPracticeConsultTabs\n | PracticeConfigPatientConsultCard\n | PracticeConfigPracticeExamsAndResults\n | PracticeConfigPracticeLayout\n | PracticeConfigPracticeAddressField\n | PracticeConfigPracticeDiagnosisAndTreatment\n | PracticeConfigPracticeInfoLetterDiscount\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 /**\n * This value is set only after the PracticePaymentIntent has been finalized and ready to be paid\n */\n stripeClientSecret?: string\n dateCreatedAt?: Date\n dateUpdateAt?: Date\n}\n\n/**\n * All the PaymentIntentRequestMetadata Kind available\n */\nexport enum PaymentIntentRequestMetadataKind {\n ConsultRequestMetadata = 'ConsultRequestMetadata',\n RefillTreatmentRequestMetadata = 'RefillTreatmentRequestMetadata',\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to create the consult when stripe use our hook.\n */\nexport interface ConsultRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n *\n * Note: it can be `undefined` to handle backward compatibility when this interface didn't had a `kind`\n */\n kind: PaymentIntentRequestMetadataKind.ConsultRequestMetadata | undefined\n /**\n * The specialty required by the consultation\n */\n tagSpecialtyRequired: string\n /**\n * The locality required for the consultation in iso. COUNTRY (ISO 3166) - PROVINCE - COUNTY - CITY\n */\n isoLocalityRequired?: string\n /**\n * The language required for the consultation. Should respect ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes\n */\n isoLanguageRequired: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to refill a treatment plan of a consult.\n */\nexport interface RefillTreatmentRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n */\n kind: PaymentIntentRequestMetadataKind.RefillTreatmentRequestMetadata\n /**\n * The consult uuid to refill\n */\n consultUuid: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used when stripe uses our hook.\n */\nexport type PaymentIntentRequestMetadata = ConsultRequestMetadata | RefillTreatmentRequestMetadata\n\nexport interface AssignmentRequest {\n uuidAssignor: string //defaulting for insertion to the default practice admin\n uuidPractitioner?: string\n status?: AssignmentStatus\n uuidConsult?: string\n tagSpecialty?: string\n isoLocality?: string\n isoLanguage?: string\n}\n\nexport type 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.PatientConsultCard]?: PracticeConfigPatientConsultCard\n [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes\n [PracticeConfigKind.PracticeConsultTabs]?: PracticeConfigPracticeConsultTabs\n [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample\n [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner\n [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables\n [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks\n [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher\n [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy\n [PracticeConfigKind.PracticePrescriptionFields]?: PracticeConfigPracticePrescriptionFields\n [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox\n [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList\n [PracticeConfigKind.PractitionerSearch]?: PracticeConfigPractitionerSearch\n [PracticeConfigKind.PracticeRegisterWalkthrough]?: PracticeConfigPracticeRegisterWalkthrough\n [PracticeConfigKind.PracticeExamsAndResults]?: PracticeConfigPracticeExamsAndResults\n [PracticeConfigKind.PracticeLayout]?: PracticeConfigPracticeLayout\n [PracticeConfigKind.PracticeAddressField]?: PracticeConfigPracticeAddressField\n [PracticeConfigKind.PracticeDiagnosisAndTreatment]?: PracticeConfigPracticeDiagnosisAndTreatment\n [PracticeConfigKind.PracticeInfoLetterDiscount]?: PracticeConfigPracticeInfoLetterDiscount\n}\n\nexport interface Practice {\n uuid: string\n name: string\n shortName: 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 emailBusiness?: 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 txtDefaultTransmissionAddress?: 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\nexport interface PracticeInvoice {\n id: string //Stripe invoice ID\n customerEmail: string\n total: number\n subtotal: number\n currency: string\n discount: number\n}\n\n/**\n * This interface represents a practice secret\n * It is used to generate a symetric key to encrypt\n * practice related data\n */\nexport interface PracticeSecret {\n practiceUuid: string\n /**\n * The payload is the actual base64 encoded bytes that can\n * be used as the practice secret. In the db,\n * this field is base64 encoded nonce+encrypted-payload.\n * It's decrypted on the fly when returned by the api.\n */\n payload: 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","/**\n * This type represents all the patient profile kind\n */\nexport type ProfileKind = 'myself' | 'child' | 'other'\n/**\n * this type is done as an example on how to add another data kind\n */\nexport type OtherKind = 'otherKindOfType'\n\n/**\n * This type represents all the kind a data that can define `ChoiceInputData` (`OtherKind` is here only as an example on how to add a new kind)\n */\nexport type AllChoiceInputDataKind = ProfileKind | OtherKind\n\n/**\n * This interface represents a `StateTrigger` on selected profile kind\n */\nexport interface ProfileTrigger {\n kind: 'profileTrigger'\n value: ProfileKind\n}\n\n/**\n * This interface is meant as an example of another kind of `StateTrigger`\n */\nexport interface OtherTrigger {\n kind: 'otherTrigger'\n field1: number\n field2: string\n}\n\n/**\n * This type represents all the state triggers that are defined.\n *\n * A state trigger is triggered onto app states. In other words, it is for triggers that cannot be defined thanks to pure workflow answers.\n */\nexport type StateTrigger = ProfileTrigger | OtherTrigger\n\nexport 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 /** If defined, the choice input contains a kind that can be used into app. For instance, to check if a specific `kind` of answer has been selected */\n kind?: AllChoiceInputDataKind\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}\n\nexport interface LanguagePickerData extends ChoiceInputData {\n flag: string // iso3166-1\n locale: string\n}\n\nexport interface TileRadioData extends ChoiceInputData {\n fullText?: string\n image?: string\n description?: string\n}\n\nexport enum InputApplyFunctions { //these are generic metadata categories\n AllUpperCase = 'AllUpperCase',\n AllLowerCase = 'AllLowerCase',\n AllAlphabetical = 'AllAlphabetical',\n AllAlphanumeric = 'AllAlphanumeric',\n NoSpaces = 'NoSpaces',\n}\n\nexport interface EntryData {\n id?: number\n label?: string\n inputApply?: InputApplyFunctions | InputApplyFunctions[]\n hideLabel?: boolean\n minorLabel?: string\n summaryLabel?: string\n summaryHidden?: boolean\n className?: string\n /**\n * This field represents a list of `selectedAnswers` that must be set for this entry to be displayed using the followng logical combination of rules:\n *\n * #### Single string\n *\n * ```\n * // Required: rule1\n * rules: rule1\n * ```\n *\n * #### Array of strings (AND is applied between statements):\n *\n * ```\n * // Required: rule1 AND rule2\n * rules: [ rule1, rule2 ]\n * ```\n *\n * #### Array of arrays of strings (OR is applied between inner arrays. AND is applied between inner arrays statements)\n *\n * ```\n * // Required: rule1 OR rule2\n * rules: [\n * [ rule1 ],\n * [ rule2 ]\n * ]\n *\n * // Required: rule1 OR (rule2 AND rule3)\n * rules: [\n * [ rule1 ],\n * [ rule2, rule3 ]\n * ]\n *\n * // THIS IS FORBIDDEN\n * rules: [\n * rule1, // <-- THIS IS FORBIDDEN. Instead use [ rule1 ]\n * [ rule2, rule3 ]\n * ]\n * ```\n */\n triggers?: string[][] | string[] | string\n /**\n * This field represents a list of `StateTrigger` that must be fulfilled for this entry to be displayed.\n */\n stateTriggers?: StateTrigger[]\n // represents the modal that it will be rendered as\n componentKind?: string\n message?: string\n}\n\nexport interface SlideData {\n header: string\n body: string\n image?: {\n src: string\n alt: string\n }\n icon?: string\n}\n\nexport enum MetadataCategory { //these are generic metadata categories\n ChildPersonal = 'ChildPersonal',\n Consultation = 'Consultation',\n Refill = 'Refill',\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\n/**\n * This interface describes all images-alias question kind options\n */\nexport interface ImagesAliasQuestionOptions {\n /**\n * Comma separated list of accepted formats. Will be given to the input html element.\n * Use same format as described [here](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#accept)\n */\n accept?: string\n /**\n * Should allow multiple uploads or not\n */\n multiple?: boolean\n /**\n * Should display photo guide instructions or not\n */\n photoGuide?: boolean\n}\n\nexport interface GenericQuestionData<T, A = IndexedData<ChoiceInputData>, O = undefined> 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 * Options to forward to the workflow component\n */\n options?: O\n messages?: string\n}\n\nexport interface GroupedGenericQuestionData<T, A = IndexedData<ChoiceInputData>> extends GenericQuestionData<T, A> {\n inline?: boolean\n inlineLabel?: boolean\n order?: number\n}\n\nexport declare type QuestionData =\n | GenericQuestionData<'title' | 'paragraph' | 'checkbox', void>\n | GenericQuestionData<\n | 'text'\n | 'text-area'\n | 'date'\n | 'number'\n | 'images'\n | 'body-parts'\n | 'pharmacy-picker'\n | 'online-pharmacy-picker'\n | 'place-address'\n >\n | GenericQuestionData<'images-alias', IndexedData<ChoiceInputData>, ImagesAliasQuestionOptions>\n | GenericQuestionData<\n 'checkbox-group' | 'hair-loss-frontal' | 'select' | 'multiple' | 'text-select-group',\n IndexedData<ChoiceInputData>\n >\n | GroupedGenericQuestionData<\n 'radio' | 'hair-selector-women' | 'hair-selector-men' | 'hair-loss-stage' | 'hair-loss-other',\n IndexedData<RadioInputData>\n >\n | GroupedGenericQuestionData<'radio-card' | 'profile-selector', IndexedData<RadioCardInputData>>\n | GroupedGenericQuestionData<'language-picker', IndexedData<LanguagePickerData>>\n | GroupedGenericQuestionData<'tile-radio', IndexedData<TileRadioData>>\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 * This field represents a list of `ids` which will be spliced from the workflow groups and inserted into a designated location\n */\n prioritizeIds?: 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 serviceImage?: string\n walkthroughSlides?: SlideData[]\n /**\n * (optional) the service name this workflow provides\n */\n serviceName?: string\n /**\n * (optional) the description of the service this workflow provides\n */\n serviceDescription?: string\n /**\n * (optional) rules to hide certain payment plans depending on the workflow answers\n */\n hidePlanRules?: HidePlanRule[]\n}\n\nexport interface HidePlanRule {\n /**\n * the stripe plan id from the practice service\n */\n idPlan: string\n /**\n * Questions to apply yup rules on in, if rules are met then hide the plan\n */\n rules: QuestionHidePlanRule[] | QuestionHidePlanRule[][]\n}\n\nexport interface QuestionHidePlanRule {\n /**\n * the id of the question to check the rule on\n */\n questionId: string\n /**\n * a collection of yup validated rules (same exact syntax we used for the workflow formValidation field, please reuse same functions)\n */\n yupRuleValueToHide: any\n}\n\n/**\n * This interface describes an upload of an image (could be a picture, a pdf, a text file, etc.)\n */\nexport interface WorkflowUploadedImage {\n /**\n * Depending on the driver used by WorkflowInput:\n * - 'indexdb': will fetch the image in IndexDB with this id\n * - 'vault': will fetch the image in the vault with this id\n */\n idbId?: string\n /**\n * The name of the image\n */\n name: string\n /**\n * the image data (could be a picture, a pdf, a text file, etc.)\n */\n imageData?: string\n}\n\n/**\n * This interface describes a workflow prepared and ready to be sent to vault\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","export interface SearchRequest {\n terms: Terms\n}\n\nexport interface SearchResponse {\n results: SearchResult[]\n}\n\nexport interface SearchResult {\n consultUuid: string\n kind: string\n score: number\n}\n\nexport interface IndexRequest {\n consultUUID: string\n terms: Terms\n}\n\nexport type Terms = Term[]\nexport interface Term {\n kind?: string\n value: string\n}\n\n\nexport enum IndexKind {\n consultUuid,\n consultShortid,\n firstName,\n lastName,\n healthId,\n dob,\n}\n","import { APIService } from './api'\nimport {\n Uuid,\n Consult,\n ConsultRequest,\n MedicalStatus,\n ConsultTransmission,\n ClosedReasonType,\n TransmissionKind,\n TransmissionStatus,\n ConsultType,\n} from '../models'\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 * @param filterAssignee array of practitioner uuids with which you want to filter the consultations\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 filterAssignee?: string[],\n typesConsult?: ConsultType[],\n uuidParent?: Uuid\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 filterAssignee,\n typesConsult,\n uuidParent,\n },\n },\n 'Content-Range'\n )\n .then((resContentRange) => {\n if (!resContentRange || (typeof resContentRange !== 'string' && typeof resContentRange !== 'number')) {\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 filterAssignee?: string[],\n uuidParent?: Uuid,\n typesConsult?: ConsultType[]\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 filterAssignee,\n typesConsult,\n uuidParent,\n },\n })\n }\n\n public getConsultByUUID(uuidConsult: Uuid, uuidPractice?: Uuid): Promise<Consult> {\n return this.api.get<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, { params: { uuidPractice } })\n }\n\n public getConsultByPracticePaymentID(idPracticePayment: Number, uuidPractice?: Uuid): Promise<Consult> {\n return this.api.get<Consult>(`${this.baseURL}/v1/consults/payment-${idPracticePayment}`, {\n params: { uuidPractice },\n })\n }\n\n public updateConsultByUUID(\n uuidConsult: Uuid,\n consult: {\n statusMedical?: MedicalStatus\n closedReasonType?: ClosedReasonType\n closedReasonDescription?: string\n uuidAssignedDoctor?: Uuid\n neverExpires?: boolean\n },\n uuidPractice?: Uuid,\n uuidRequester?: Uuid\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, consult, {\n params: {\n uuidPractice,\n uuidRequester,\n },\n })\n }\n\n public getConsultFaxStatuses(uuidConsult: string): Promise<ConsultTransmission[]> {\n return this.api.get<ConsultTransmission[]>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, {\n params: {\n kind: TransmissionKind.Fax,\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>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, data, {\n headers: { 'Content-Type': 'multipart/form-data;' },\n })\n }\n\n public postConsultFax(uuidConsult: string, addressReceiver: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file)\n }\n\n public postConsultEmail(uuidConsult: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file)\n }\n\n public retryConsultFax(uuidConsult: string, transmissionId: string): 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 Consult,\n Drug,\n TreatmentAssociatedConsultData,\n TreatmentPlan,\n TreatmentPlans,\n TreatmentPlansRequest,\n TreatmentPlansResponse,\n TreatmentPlanUpdateRequest,\n Uuid,\n} from '..'\nimport {\n Diagnosis,\n Treatment,\n DiagnosisRequest,\n TreatmentAndDrugPrescriptionUpdateRequest,\n TreatmentRequest,\n} 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>(`${this.baseURL}/v1/diagnoses/${uuidDiagnosis}`)\n }\n\n public createDiagnosis(diagnosis: DiagnosisRequest): Promise<Diagnosis> {\n return this.api.post<Diagnosis>(`${this.baseURL}/v1/diagnoses`, diagnosis)\n }\n\n public updateDiagnosis(uuid: string, diagnosis: DiagnosisRequest): Promise<Diagnosis> {\n return this.api.put<Diagnosis>(`${this.baseURL}/v1/diagnoses/${uuid}`, diagnosis)\n }\n\n public getTreatmentByUuid(uuidDiagnosis: Uuid, uuidTreatment: Uuid): Promise<Treatment[]> {\n return this.api.get<Treatment[]>(`${this.baseURL}/v1/diagnoses/${uuidDiagnosis}/treatments/${uuidTreatment}`)\n }\n\n public getTreatmentsFromDiagnosisUuid(diagnosisUuid: Uuid): Promise<Treatment[]> {\n return this.api.get<Treatment[]>(`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`)\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(uuidConsult: Uuid): Promise<TreatmentPlan[]> {\n return this.api.get<TreatmentPlan[]>(`${this.baseURL}/v1/treatment-plans/`, { params: { uuidConsult } })\n }\n\n /**\n * creates a new treatment for the specified diagnosis\n * @param diagnosisUuid uuid of the diagnosis that the treatment is linked to\n * @param treatmentRequest the treatment to be inserted\n */\n public createTreatment(diagnosisUuid: string, treatmentRequest: TreatmentRequest) {\n return this.api.post<Treatment>(`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`, treatmentRequest)\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(uuidConsult: Uuid): Promise<TreatmentPlans> {\n return this.api.get<TreatmentPlans>(`${this.baseURL}/v1/treatment-plans/`, {\n params: { uuidConsult, populated: true },\n })\n }\n\n public postPlans(plans: TreatmentPlansRequest): Promise<TreatmentPlansResponse> {\n return this.api.post<TreatmentPlansResponse>(`${this.baseURL}/v1/treatment-plans`, plans)\n }\n\n public updateTreatmentPlan(\n uuidPlan: string,\n uuidConsult: string,\n diagnosisRequest: DiagnosisRequest,\n plan: TreatmentAndDrugPrescriptionUpdateRequest,\n refill?: boolean\n ): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}`, <\n TreatmentPlanUpdateRequest\n >{\n uuidConsult,\n diagnosis: diagnosisRequest,\n plan,\n refill,\n })\n }\n\n public setAssociatedConsultsToTreatment(\n diagnosisUuid: string,\n treatmentUuid: string,\n arrAssociatedConsults: TreatmentAssociatedConsultData[]\n ): Promise<TreatmentAssociatedConsultData[]> {\n return this.api.post<TreatmentAssociatedConsultData[]>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`,\n arrAssociatedConsults\n )\n }\n\n public updateAssociatedConsultsToTreatment(\n diagnosisUuid: string,\n treatmentUuid: string,\n arrAssociatedConsults: TreatmentAssociatedConsultData[]\n ): Promise<TreatmentAssociatedConsultData[]> {\n return this.api.put<TreatmentAssociatedConsultData[]>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`,\n arrAssociatedConsults\n )\n }\n\n public acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}/accept`, { uuidConsult })\n }\n\n /**\n * retrieves all the drugs of the specified practice\n * @param uuidPractice\n */\n public async getAllDrugs(uuidPractice: string): Promise<Drug[] | undefined> {\n const res = await this.api.get<{ foundDrugs: Drug[] }>(`${this.baseURL}/v1/drugs/practice/${uuidPractice}`)\n if (res && res.foundDrugs) return res.foundDrugs\n return undefined\n }\n}","import { AxiosError } from 'axios'\nimport type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh'\nimport {\n AuthenticationBadRequest,\n AuthenticationFailed,\n AuthenticationServerError,\n AuthenticationUnconfirmedEmail,\n AuthRecoverRequest,\n AuthTokenRequest,\n AuthTokenResponse,\n Base64String,\n IdentityCreateRequest,\n IdentityCreationBadRequest,\n IdentityCreationConflict,\n IdentityCreationFailed,\n IdentityResendConfirmEmailRequest,\n IdentityResponse,\n IdentityUpdateRequest,\n M2MTokenRequest,\n QRCodeRequest,\n QRCodeResponse,\n Tokens,\n Uuid,\n WhoAmIResponse,\n} from '../models'\nimport { APIService } from './api'\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)) // This is the default behavior for User JWT tokens. If you want other kind of refresh you shall overwrite this call\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 a M2M token for a service\n *\n * @param req The credentials required to get an access token\n * @returns AuthTokenResponse\n */\n public async m2mToken(req: M2MTokenRequest): Promise<AuthTokenResponse> {\n let resp: AuthTokenResponse | undefined\n\n try {\n let config: AxiosAuthRefreshRequestConfig = {\n skipAuthRefresh: true,\n }\n\n resp = await this.api.post<AuthTokenResponse>(`${this.baseURL}/v1/m2m/token`, req, config)\n\n this.api.setTokens({\n accessToken: resp.accessToken,\n })\n } catch (e) {\n console.error('Error while posting m2m token:', e)\n\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 * 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 console.error('Error while posting auth token:', e)\n\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 424:\n throw new AuthenticationUnconfirmedEmail()\n case 500:\n throw new AuthenticationServerError()\n case 401:\n default:\n throw new AuthenticationFailed()\n }\n }\n throw new AuthenticationFailed()\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 * 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 * 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 * 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 * 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 * @param skipCache (default: false) will skip identity cache (not even update it)\n * @returns IdentityResponse\n */\n public async identityGet(identityID: Uuid, skipCache = false): Promise<IdentityResponse> {\n const tokens = this.api.getTokens()\n const cacheKey = (tokens.accessToken ?? '') + (tokens.refreshToken ?? '') + identityID\n\n if (skipCache || !tokens.accessToken || !this.identityCache[cacheKey]) {\n const identity = await this.api.get<IdentityResponse>(`${this.baseURL}/v1/identities/${identityID}`)\n\n if (skipCache) return identity\n\n this.identityCache[cacheKey] = identity\n }\n return this.identityCache[cacheKey]\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(identityID: Uuid, req: IdentityUpdateRequest): 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(identityID: Uuid, password: Base64String): Promise<QRCodeResponse> {\n const req: QRCodeRequest = { password }\n return this.api.post<QRCodeResponse>(`${this.baseURL}/v1/identities/${identityID}/mfa`, req, {\n headers: { Accept: 'application/json' },\n })\n }\n\n /**\n * Attempt to resend the email confirmation email\n *\n * @param req IdentityResendConfirmEmailRequest\n * @return void\n */\n public async identitySendConfirmEmail(req: IdentityResendConfirmEmailRequest): Promise<void> {\n return this.api.post<void>(`${this.baseURL}/v1/identity/confirm`, req)\n }\n\n /**\n * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)\n *\n * @param email the customer email\n * @returns IdentityResponse\n */\n public async identityGetByCustomerEmail(email: string): Promise<IdentityResponse> {\n return this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@')))\n }\n\n /**\n * Get an identity using a base64 hash\n *\n * @param b64Hash base64 hash of the identity\n * @returns IdentityResponse\n */\n public async identityGetByHash(b64Hash: string): Promise<IdentityResponse> {\n //TODO: Right now this maps directly to the IdentityGet call.\n //Eventually, with the mapping table method, this would lead to another\n //call (ie: /v1/mapping/[b64Hash]) which would return a blob to decrypt\n //which would contain the real identityID to call IdentityGet with.\n\n //The hash comes in base64 format but it isn't URL safe soe we have to convert\n //to base64URL (see https://en.wikipedia.org/wiki/Base64#The_URL_applications)\n return this.identityGet(b64Hash.replace(/\\+/g, '-').replace(/\\//g, '_'))\n }\n}\n","import {APIService} from \"./api\";\nimport {IndexRequest, SearchRequest, SearchResponse, Terms} from \"../models/search\";\n\nexport class SearchService {\n constructor(private api: APIService, private baseURL: string) {}\n\n /**\n * Creates search indexes for the terms passed in order to be able to search for it in the future\n * @param consultUUID\n * @param terms the search terms to be indexed\n */\n public index(\n consultUUID: string,\n terms: Terms\n ): Promise<any> {\n return this.api.post<IndexRequest>(\n `${this.baseURL}/v1/index`,\n <IndexRequest> {\n consultUUID,\n terms\n }\n )\n }\n\n /**\n * Searches for the consultations corresponding to the search terms entered in the query\n * @param terms array of search terms\n */\n public search(\n terms: Terms\n ): Promise<SearchResponse> {\n return this.api.post<SearchResponse>(\n `${this.baseURL}/v1/search`,\n <SearchRequest> {\n terms\n }\n )\n }\n}","import { hashToBase64String } from '../helpers'\nimport { PaymentStatus, PracticeAccount, Uuid } from '../models'\nimport {\n Assignment,\n AssignmentRequest,\n PaymentIntentRequestMetadata,\n PlanType,\n Practice,\n PracticeConfigKind,\n PracticeConfigs,\n PracticeInvoice,\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(private api: APIService, private baseURL: string) {}\n\n /**\n * This function will only work if the service is initialized with\n * an M2M with the scope `practice.practices.get`\n * @returns an array of practices\n */\n public practiceGetAll(): Promise<Practice[]> {\n return this.api.get<Practice[]>(`${this.baseURL}/v1/practices`)\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>(`${this.baseURL}/v1/practices`, {\n params: {\n url_practice: practiceURL,\n ...params,\n },\n })\n }\n\n public practiceGetFromUuid(practiceUuid: Uuid, locale?: string, withAccounts?: boolean): Promise<Practice> {\n return this.api.get<Practice>(`${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(practiceUuid: Uuid): Promise<PracticeConfigs[]> {\n return this.api.get<PracticeConfigs[]>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`)\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>(`${this.baseURL}/v1/practices/${practiceUuid}/configs/${kind}`)\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(practiceUuid: Uuid, config: PracticeConfigs): Promise<PracticeConfigs> {\n return this.api.post<PracticeConfigs>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`, config)\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(config: PracticeConfigs): 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[]>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts`)\n }\n\n public practiceGetAccount(practiceUuid: Uuid, accountUuid: Uuid): Promise<PracticeAccount> {\n return this.api.get<PracticeAccount>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts/${accountUuid}`)\n }\n\n /**\n * Get the PracticeWorkflows of a specific practice\n * @param practiceUuid the uuid of the practice\n * @param kind (optional) the kind of WorkflowType to filter in\n * @returns a list of PracticeWorkflow\n */\n public practiceGetWorkflows(practiceUuid: Uuid, kind?: WorkflowType): Promise<PracticeWorkflow[]> {\n return this.api.get<PracticeWorkflow[]>(`${this.baseURL}/v1/practices/${practiceUuid}/workflows`, {\n params: { kind },\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(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePlan[]> {\n return this.api.get<PracticePlan[]>(`${this.baseURL}/v1/practices/${practiceUuid}/plans`, {\n params: { kind: planType },\n })\n }\n\n public practiceGetPlan(practiceUuid: Uuid, planId: number): Promise<PracticePlan> {\n return this.api.get<PracticePlan>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}`)\n }\n\n public practiceGetPlanPrices(practiceUuid: Uuid, planId: number): Promise<PracticePlanPrices> {\n return this.api.get<PracticePlanPrices>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}/prices`)\n }\n\n // Payments\n public practiceGetPayments(\n practiceUuid: Uuid,\n statusPayment?: PaymentStatus,\n withConsultUUIDNULL?: boolean,\n perPage?: number,\n indexPage?: number\n ): Promise<PracticePayment[]> {\n return this.api.get<PracticePayment[]>(`${this.baseURL}/v1/practices/${practiceUuid}/payments`, {\n params: {\n status: statusPayment,\n withConsultUUIDNULL,\n perPage,\n indexPage,\n },\n })\n }\n\n public practiceGetPayment(practiceUuid: Uuid, idStripeInvoiceOrPaymentIntent: string): 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(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePaymentIntent[]> {\n return this.api.get<PracticePaymentIntent[]>(`${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 hashToBase64String(email.toLowerCase())\n }\n\n /**\n * Creates a PracticePaymentIntent\n * @param practiceUuid the uuid of the practice\n * @param planId the plan id to use\n * @param userEmail the email address of the user\n * @param isoLocality (optional) the desired locality\n * @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)\n * @param promotionCode (optional) promotion code to apply\n * @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).\n * @returns\n */\n public practiceCreatePaymentsIntent(\n practiceUuid: Uuid,\n planId: number,\n userEmail: string,\n isoLocality?: string,\n url_subdomain?: string,\n requestMetadata?: PaymentIntentRequestMetadata\n ): Promise<PracticePaymentIntent> {\n return this.api.post<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/`,\n {\n idPlan: planId,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n isoLocality,\n requestMetadata,\n },\n { params: { url_subdomain } }\n )\n }\n\n public practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent> {\n return this.api.get<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${paymentIntentId}`\n )\n }\n\n /**\n * Updates a PracticePaymentIntent\n * @param practiceUuid the practice uuid\n * @param idPraticePaymentIntent the id of the PracticePaymentIntent to update\n * @param practicePaymentIntent the desired PracticePaymentIntent\n * @param userEmail the email of the user\n * @param promotionCode (optional) promotional code to apply\n * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.\n * @returns the updated PracticePaymentIntent\n */\n public practiceUpdatePaymentsIntent(\n practiceUuid: string,\n idPraticePaymentIntent: number,\n practicePaymentIntent: PracticePaymentIntent,\n userEmail: string,\n promotionCode?: string,\n finalize?: boolean\n ) {\n return this.api.put<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${idPraticePaymentIntent}`,\n {\n ...practicePaymentIntent,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n },\n { params: { promotionCode, finalize } }\n )\n }\n\n /**\n * Invoice\n * @param practiceUuid UUID of the practice to get the invoice from\n * @param invoiceId ID of the invoice in stripe\n */\n public getInvoice(practiceUuid: Uuid, invoiceId: string): Promise<PracticeInvoice> {\n return this.api.get<PracticeInvoice>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/invoices/${invoiceId}`\n )\n }\n\n // Practitioner\n public practiceGetPractitioners(practiceUuid: Uuid): Promise<Practitioner[]> {\n return this.api.get<Practitioner[]>(`${this.baseURL}/v1/practices/${practiceUuid}/practitioners`)\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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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[]>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`)\n }\n\n public practiceCreateAssignment(practiceUuid: Uuid, requestBody: AssignmentRequest): Promise<Assignment> {\n return this.api.post<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`, requestBody)\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(practiceUuid: Uuid, assignmentId: number): Promise<Assignment> {\n return this.api.get<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`)\n }\n\n // Quotas\n public practiceGetQuotas(practiceUuid: Uuid): Promise<PractitionerQuota[]> {\n return this.api.get<PractitionerQuota[]>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas`)\n }\n\n public practiceGetQuota(practiceUuid: Uuid, quotaId: number): Promise<PractitionerQuota> {\n return this.api.get<PractitionerQuota>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas/${quotaId}`)\n }\n}\n","import { APIService } from './api'\nimport {\n ClosedReasonType,\n Consult,\n DataCreateResponse,\n LockboxDataRequest,\n MedicalStatus,\n ResumeConsultEmailRequest,\n Uuid,\n} 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 options: {\n updateMedicalStatus: boolean\n } = { updateMedicalStatus: true },\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`, req, {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n update_medical_status: options.updateMedicalStatus,\n },\n })\n }\n\n public updateConsultByUUID(\n patientUuid: Uuid,\n uuidConsult: Uuid,\n statusMedical: MedicalStatus,\n closedReasonType?: ClosedReasonType,\n closedReasonDescription?: string,\n neverExpires?: boolean\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, {\n patientUuid,\n statusMedical,\n closedReasonType,\n closedReasonDescription,\n neverExpires,\n })\n }\n\n /**\n * This function notifies teller that the fax sent for a specific consult did not get through\n * @todo - Make service only exposed route\n * @param practiceUuid the practice uuid linked to the consult\n * @param consultationUuid the consultation uuid\n * @param consultationShortId the consultation short id\n * @param fax the address where to send the fax\n * @returns void\n */\n public notifyFaxFailed(practiceUuid: Uuid, consultationUuid: Uuid, consultationShortId: string, fax: string) {\n return this.api.post<void>(\n `${this.baseURL}/v1/fax-failed`,\n {\n consultationUuid,\n consultationShortId,\n fax,\n },\n {\n params: { practice_uuid: practiceUuid },\n }\n )\n }\n\n /**\n * This function let's you reassign a practictioner to a consult and send a notification email\n * @todo - Make service only exposed route\n * @param uuidConsult the uuid of the consult to reassign\n * @param newPractitionerUuid the uuid of the practitioner that will get reassigned\n */\n public reassignmentEmail(uuidConsult: Uuid, newPractitionerUuid: Uuid) {\n return this.api.post<void>(`${this.baseURL}/v1/consult/${uuidConsult}/reassignment-email`, {\n newPractitionerUuid,\n })\n }\n\n /**\n * This function will send an email to the patientUuid, saying that the online practice has been sent a fax successfully\n * @todo - Make service only exposed route\n * @param consult\n * @param patientUuid\n * @returns void\n */\n public sendOnlineFaxSuccessfulEmail(consult: Consult, patientUuid: Uuid): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/online-fax-notify`, { consult, patientUuid })\n }\n\n /**\n * This function will send an email to patient to allow them to resume the consult.\n * @param req the body of the resume consult request\n * @returns void\n */\n public sendResumeConsultEmail(req: ResumeConsultEmailRequest): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/resume-consult-email`, req)\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 { ServiceCollection, ServiceCollectionRequest } from '../models'\nimport {\n APIService,\n ConsultService,\n DiagnosisService,\n GuardService,\n PracticeService,\n SearchService,\n TellerService,\n VaultService,\n WorkflowService,\n} from '../services'\n\n/**\n * This function is used to initialize services with a provided url\n * @param services an object containing the url of the services to init\n * @param authenticationCallback (optional) the authentification callback. Called when the token were not able to be refreshed.\n * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)\n * @returns an instance of each services with a provided url\n */\nexport const init = (\n services: ServiceCollectionRequest,\n authenticationCallback?: (err: Error, practiceUuid?: string) => void,\n useLocalStorage = true\n): ServiceCollection => {\n const {\n tellerBaseURL,\n practiceBaseURL,\n consultBaseURL,\n vaultBaseURL,\n guardBaseURL,\n searchBaseURL,\n workflowBaseURL,\n diagnosisBaseURL,\n } = services\n\n const apiService = new APIService(useLocalStorage, undefined, authenticationCallback)\n\n return {\n apiService,\n tellerService: tellerBaseURL ? new TellerService(apiService, tellerBaseURL) : undefined,\n practiceService: practiceBaseURL ? new PracticeService(apiService, practiceBaseURL) : undefined,\n consultService: consultBaseURL ? new ConsultService(apiService, consultBaseURL) : undefined,\n vaultService: vaultBaseURL ? new VaultService(apiService, vaultBaseURL) : undefined,\n guardService: guardBaseURL ? new GuardService(apiService, guardBaseURL) : undefined,\n searchService: searchBaseURL ? new SearchService(apiService, searchBaseURL) : undefined,\n workflowService: workflowBaseURL ? new WorkflowService(apiService, workflowBaseURL) : undefined,\n diagnosisService: diagnosisBaseURL ? new DiagnosisService(apiService, diagnosisBaseURL) : undefined,\n }\n}\n"],"names":["hashToBase64String","value","Buffer","from","sha256","update","digest","toString","undefined","AxiosService","config","axios","create","apiRequest","url","data","headers","then","res","apiRequestHeader","headerToRetrieve","toLowerCase","get","method","deleteRequest","post","put","patch","head","APIService","useLocalStorage","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","ApisPracticeManager","serviceCollReq","getAuthTokenCbk","Map","practiceUuid","cacheKey","practiceInstance","practiceInstances","newPracticeInstance","init","authTokenFunc","guardService","log","Error","apiService","set","AssistantType","TransmissionKind","TransmissionStatus","ConsultType","FeeStatus","MedicalStatus","TaskStatus","ClosedReasonType","VisibilityType","DrugType","PrescriptionStatus","PlanStatus","AuthenticationFailed","AuthenticationBadRequest","AuthenticationServerError","AuthenticationUnconfirmedEmail","IdentityCreationFailed","IdentityCreationBadRequest","IdentityCreationConflict","VaultDataMissing","WorkflowType","RateDimension","PlanType","PaymentStatus","PractitionerStatus","AssignmentStatus","PractitionnerRoleType","OtherRoleType","LicenseStatus","PeriodType","SyncStatus","PracticeEmailKind","PracticeConfigKind","StripePriceType","PaymentIntentRequestMetadataKind","IndexKey","DocumentType","InputApplyFunctions","MetadataCategory","IndexKind","ConsultService","api","baseURL","consultCreate","c","countConsults","uuidPractice","uuidRequester","statusesMedical","statusesExclude","shortId","columnToSortTo","orderToSortTo","perPage","indexPage","filterAssignedDoctor","filterCurrentPractitioner","filterIsoLocality","filterAssignee","typesConsult","uuidParent","params","page","sortColumns","orderColumns","resContentRange","parseInt","getConsults","getConsultByUUID","uuidConsult","getConsultByPracticePaymentID","idPracticePayment","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","getTreatmentByUuid","uuidTreatment","getTreatmentsFromDiagnosisUuid","diagnosisUuid","getTreatmentPlansFromConsultUuid","createTreatment","treatmentRequest","getTreatmentPlansPopulatedFromConsultUuid","populated","postPlans","plans","updateTreatmentPlan","uuidPlan","diagnosisRequest","plan","refill","setAssociatedConsultsToTreatment","treatmentUuid","arrAssociatedConsults","updateAssociatedConsultsToTreatment","acceptTreatmentPlan","getAllDrugs","foundDrugs","GuardService","authRefresh","bind","identityCache","whoAmICache","m2mToken","req","skipAuthRefresh","resp","isAxiosError","code","authToken","authLogout","authRecover","identityCreate","identityGet","identityID","skipCache","identity","whoAmI","refreshCache","identityUpdate","identityMFAQRCode","password","Accept","identitySendConfirmEmail","identityGetByCustomerEmail","email","identityGetByHash","substring","indexOf","b64Hash","replace","SearchService","index","consultUUID","terms","search","PracticeService","practiceGetAll","practiceGetFromURL","practiceURL","url_practice","practiceGetFromUuid","locale","withAccounts","accounts","practiceConfigGetFromPracticeUuid","practiceConfigGetByKindForPracticeUuid","practiceConfigCreateForPracticeUuid","practiceConfigUpdate","practiceGetAccounts","practiceGetAccount","accountUuid","practiceGetWorkflows","practiceGetWorkflow","workflowType","practiceGetPlans","planType","practiceGetPlan","planId","practiceGetPlanPrices","practiceGetPayments","statusPayment","withConsultUUIDNULL","practiceGetPayment","idStripeInvoiceOrPaymentIntent","practiceGetPaymentForStripePaymentIntentWithID","stripePaymentIntentId","practiceGetPaymentsIntents","getPaymentIntentHashedEmail","practiceCreatePaymentsIntent","userEmail","isoLocality","url_subdomain","requestMetadata","idPlan","hashUserEmail","practiceGetPaymentsIntent","paymentIntentId","practiceUpdatePaymentsIntent","idPraticePaymentIntent","practicePaymentIntent","promotionCode","finalize","getInvoice","invoiceId","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","options","updateMedicalStatus","lockbox_owner_uuid","data_uuid","update_medical_status","patientUuid","statusMedical","closedReasonType","closedReasonDescription","neverExpires","notifyFaxFailed","consultationUuid","consultationShortId","fax","practice_uuid","reassignmentEmail","newPractitionerUuid","sendOnlineFaxSuccessfulEmail","sendResumeConsultEmail","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","services","authenticationCallback","tellerBaseURL","practiceBaseURL","consultBaseURL","vaultBaseURL","guardBaseURL","searchBaseURL","workflowBaseURL","diagnosisBaseURL","tellerService","practiceService","consultService","vaultService","searchService","workflowService","diagnosisService"],"mappings":";;;;;AAGA;;;;;;SAKgBA,mBAAmBC;AAC/B,SAAOC,MAAM,CAACC,IAAP,CAAYC,MAAM,GAAGC,MAAT,CAAgBJ,KAAhB,EAAuBK,MAAvB,CAA8B,KAA9B,CAAZ,EAAkD,KAAlD,EAAyDC,QAAzD,CAAkE,QAAlE,CAAP;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAAgD3X,SANvE;AAOHmY,IAAAA,aAAa,EAAEP,aAAa,GAAG,IAAIrJ,aAAJ,CAAkBjK,UAAlB,EAA8BsT,aAA9B,CAAH,GAAkD5X,SAP3E;AAQHoY,IAAAA,eAAe,EAAEP,eAAe,GAAG,IAAId,eAAJ,CAAoBzS,UAApB,EAAgCuT,eAAhC,CAAH,GAAsD7X,SARnF;AASHqY,IAAAA,gBAAgB,EAAEP,gBAAgB,GAAG,IAAIvN,gBAAJ,CAAqBjG,UAArB,EAAiCwT,gBAAjC,CAAH,GAAwD9X;AATvF,GAAP;AAWH,CA7BM;;;;;"}
1
+ {"version":3,"file":"oro-sdk-apis.esm.js","sources":["../src/helpers/hash.ts","../src/services/axios.ts","../src/services/api.ts","../src/services/apisPracticeManager.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/models/search.ts","../src/services/consult.ts","../src/services/diagnosis.ts","../src/services/guard.ts","../src/services/search.ts","../src/services/practice.ts","../src/services/teller.ts","../src/services/vault.ts","../src/services/workflow.ts","../src/helpers/init.ts"],"sourcesContent":["import { sha256 } from 'hash.js'\nimport { Buffer } from 'buffer/'\n\n/**\n * This function return a base64 string representation of a hashed string\n * @param value the string to hash\n * @returns a base64 string representation of a hashed value\n */\nexport function hashToBase64String(value: string): string {\n return Buffer.from(sha256().update(value).digest('hex'), 'hex').toString('base64')\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\nexport class APIService extends AxiosService {\n private authRefreshFn?: AuthRefreshFunc\n private tokens: Tokens = {}\n\n /**\n * The API Service lets you use an axios API and handles oro backend services authentification via JWT tokens\n * @param useLocalStorage if set to true, tokens will be stored in localStorage\n * @param config (optional) an axios config\n * @param tokenRefreshFailureCallback (optional) callback to call when failing to refresh the auth token\n */\n constructor(\n private useLocalStorage: boolean,\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(\n this.axios,\n 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 ${\n self.getTokens().accessToken\n }`\n return Promise.resolve()\n } catch (e) {\n console.error('an error occured while refreshing tokens (notifying callback)', e)\n if (self.tokenRefreshFailureCallback) 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\n public setAuthRefreshFn(fn: AuthRefreshFunc) {\n this.authRefreshFn = fn\n }\n\n public setTokens(tokens: Tokens) {\n if (this.useLocalStorage) {\n localStorage.setItem('tokens', JSON.stringify(tokens))\n }\n this.tokens = tokens\n }\n\n public getTokens(): Tokens {\n if (this.useLocalStorage) {\n let tokens: Tokens = {}\n const item = localStorage.getItem('tokens')\n if (item) {\n tokens = JSON.parse(item)\n }\n return tokens\n } else {\n return this.tokens\n }\n }\n}\n","import { init } from '../helpers'\nimport { AuthTokenResponse, ServiceCollection, ServiceCollectionRequest } from '../models'\nimport { GuardService } from './guard'\n\n/**\n * This service enables you to handle one authentication token per practice\n */\nexport class ApisPracticeManager {\n private practiceInstances = new Map<string, ServiceCollection>()\n\n /**\n * The constructor\n * @param serviceCollReq the services to initialize. Only filled urls will get corresponding service to be initialized.\n * It will be used each time a new practices needs a `ServiceCollection`\n * @param getAuthTokenCbk the callback function used to get a new JWT token\n * @param useLocalStorage (default: false) if true store tokens into local storage (only for browsers)\n */\n constructor(\n private serviceCollReq: ServiceCollectionRequest,\n private getAuthTokenCbk: (guard: GuardService, practiceUuid?: string) => Promise<AuthTokenResponse>,\n private useLocalStorage = false\n ) {}\n\n /**\n * This function is used to get a `ServiceCollection` associated to a practice. If missing, it will initialize a new `ServiceCollection`.\n * @param practiceUuid the uuid of the practice\n * @returns a promise holding a `ServiceCollection`\n */\n public async get(practiceUuid?: string): Promise<ServiceCollection> {\n const cacheKey = practiceUuid ?? 'none'\n const practiceInstance = this.practiceInstances.get(cacheKey)\n if (practiceInstance) return practiceInstance\n\n const newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage)\n\n // Create one auth token callback per practice since the practice uuid needs to change\n const authTokenFunc = async () => {\n if (newPracticeInstance.guardService) {\n console.log(`\\x1b[36m[Auth] Refresh auth called (practiceUuid: ${practiceUuid})\\x1b[36m`)\n return await this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid)\n } else {\n throw Error('[Auth] Unable to refresh token guard service is undefined')\n }\n }\n\n // Initialize the M2M token\n await authTokenFunc()\n\n // Set the refresh tokens callback\n newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc)\n\n this.practiceInstances.set(cacheKey, newPracticeInstance)\n\n return newPracticeInstance\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 ConsultType {\n Onboard = 'Onboard',\n Refill = 'Refill',\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 Assigning = 'Assigning',\n Assigned = 'Assigned',\n New = 'New',\n ToAnswer = 'ToAnswer',\n Answered = 'Answered',\n Closed = 'Closed',\n Reopened = 'Reopened',\n Archived = 'Archived',\n Failed = 'Failed',\n}\n\nexport enum TaskStatus {\n None = 'None',\n ToDo = 'ToDo',\n InProgress = 'InProgress',\n Blocked = 'Blocked',\n Done = 'Done',\n}\n\nexport enum ClosedReasonType {\n /**\n * A completed consultation\n */\n Completed = 'Completed',\n /**\n * The conclusion was that what the patient submitted was not a disease\n */\n NotADisease = 'NotADisease',\n /**\n * The consultation was not appropriate for virtual\n */\n NotAppropriateForVirtual = 'NotAppropriateForVirtual',\n /**\n * Any other reason why the consultation was closed\n */\n Other = 'Other',\n /**\n * A consultation that is required to be done in person\n */\n RequiresInPerson = 'RequiresInPerson',\n}\n\nexport interface ClosedConsultReasonInsertFields {\n /**\n * The uuid of the consultation\n */\n consult_uuid: string\n /**\n * The reason why the consultation was closed\n */\n closed_reason_type: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closed_reason_description: string\n /**\n * When the consultation was closed\n */\n created_at: string\n}\n\nexport interface ConsultClosedReason {\n /**\n * The reason why the consultation was closed\n */\n closedReasonType: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closedReasonDescription?: string\n}\n\nexport interface ConsultRequest {\n uuidPractice: string\n consultType?: ConsultType\n tagSpecialtyRequired: string\n idStripeInvoiceOrPaymentIntent: string\n isoLocalityRequired?: string\n isoLanguageRequired: string\n uuidParent?: 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 consultType: ConsultType\n uuidAssignedDoctor: string\n uuidCurrentAssigned: string\n uuidParent?: string\n statusTask?: TaskStatus\n hasTransmissions?: boolean\n assignedAssistant?: ConsultAssignedAssistant[]\n closeConsultReason?: ConsultClosedReason\n shortId?: string\n createdAt?: string\n expiresAt?: string\n}\n","export enum VisibilityType {\n Generic = 'Generic',\n Private = 'Private',\n Instance = 'Instance',\n}\n\nexport type DiagnosisType = VisibilityType\n\nexport type TreatmentType = VisibilityType\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\n// Type defined to store all consult related data linked to a given treatment\nexport interface TreatmentAssociatedConsultData {\n uuidConsult: string\n consultKind: string\n}\n\nexport interface TreatmentRequest {\n uuid?: string\n uuidDiagnosis?: string\n uuidParentTreatment?: string\n uuidPreviousRevision?: string\n name: string\n description: string\n refillable?: boolean\n noteToPharmacy?: string\n urlMultimedia?: string\n type?: TreatmentType\n}\n\nexport interface Treatment extends TreatmentRequest {\n uuid: string\n uuidDiagnosis: string\n uuidPractitioner?: string\n createdAt: string\n arrAssociatedConsults?: TreatmentAssociatedConsultData[]\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 posology?: string // drug posology\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\n/**\n * Status of the prescription\n * Right now, it only serves a soft delete flag\n */\nexport enum PrescriptionStatus {\n Existing = 'Existing',\n Deleted = 'Deleted',\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 status?: PrescriptionStatus\n createdAt: string\n}\n\nexport enum PlanStatus {\n Pending = 'Pending',\n Accepted = 'Accepted',\n Rejected = 'Rejected',\n PreviouslyAccepted = 'PreviouslyAccepted',\n}\n\nexport interface TreatmentPlan {\n uuid: string\n uuidConsult: string\n uuidDiagnosis: string\n uuidTreatment?: string\n notes?: string\n status: PlanStatus\n decidedAt: string\n createdAt: string\n}\n\nexport interface DrugPrescription {\n prescription: Prescription\n drug: Drug\n}\n\nexport interface TreatmentAndDrugPrescription {\n treatmentsHistory?: TreatmentHistory[]\n notes?: string\n status: PlanStatus\n uuidTreatmentPlan: string\n /**\n * this field is used to store the datetime when the patient accepted or refused the prescription\n */\n decidedAt?: string\n createdAt: string\n}\n\n/**\n * An entry in the history of the treatments of the patient.\n * The history entry consists of the treatment and the prescriptions and the drugs\n * that were prescribed to the patient at that point of history\n */\nexport interface TreatmentHistory {\n treatment: Treatment\n treatmentRevisions: Treatment[]\n prescriptionsAndDrugs: DrugPrescription[]\n}\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 * request to refill the treatment plan\n */\n refill?: boolean\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\nexport interface TreatmentAssociatedConsultDataResponse extends Array<TreatmentAssociatedConsultData> {}\n","export class AuthenticationFailed extends Error { }\nexport class AuthenticationBadRequest extends Error { }\nexport class AuthenticationServerError extends Error { }\nexport class AuthenticationUnconfirmedEmail extends Error { }\nexport class IdentityCreationFailed extends Error { }\nexport class IdentityCreationBadRequest extends Error { }\nexport class IdentityCreationConflict extends Error { }\nexport class VaultDataMissing extends Error { }","import { PlaceData } from '.'\n\nexport 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 SuccessAndDelivered = 'SuccessAndDelivered',\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 Closed = 'Closed',\n PasswordRecovery = 'PasswordRecovery',\n FaxFailed = 'FaxFailed',\n ExamResult = 'ExamResult',\n Reassigned = 'Reassigned',\n OnlinePharmacyFaxSent = 'OnlinePharmacyFaxSent',\n ResumeConsult = 'ResumeConsult',\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\n/**\n * Defines all the practice config kind.\n *\n * Please respect the following when defining a new practice config:\n * - be really specific on its role\n * - all configs needs to have default values in app\n * - the default behavior should always to be display the feature.\n * In other words, practice configs should either be used to hide a functionnality or overwrite a default behavior.\n * To be extra explicit, if you want to show a functionnality only in one practice, you will have to add a practice configs in all other practice to hide it (yes it is cumbersome).\n *\n */\nexport enum PracticeConfigKind {\n PatientConsultCard = 'PatientConsultCard',\n PracticeCloseConsultationTypes = 'PracticeCloseConsultationTypes',\n PracticeConsultTabs = 'PracticeConsultTabs',\n PracticeConfigExample = 'PracticeConfigExample',\n PracticeCookieBanner = 'PracticeCookieBanner',\n PracticeCssVariables = 'PracticeCssVariables',\n PracticeFontsLinks = 'PracticeFontsLinks',\n PracticeLocaleSwitcher = 'PracticeLocaleSwitcher',\n PracticePharmacyPicker = 'PracticePharmacyPicker',\n PracticePrescriptionFields = 'PracticePrescriptionFields',\n PractitionerChatbox = 'PractitionerChatbox',\n PractitionerConsultList = 'PractitionerConsultList',\n PractitionerSearch = 'PractitionerSearch',\n PracticeRegisterWalkthrough = 'PracticeRegisterWalkthrough',\n PracticeExamsAndResults = 'PracticeExamsAndResults',\n PracticeLayout = 'PracticeLayout',\n PracticeAddressField = 'PracticeAddressField',\n PracticeDiagnosisAndTreatment = 'PracticeDiagnosisAndTreatment',\n PracticeInfoLetterDiscount = 'PracticeInfoLetterDiscount',\n}\n\n/**\n * Defines the close consultation types to hide in the close consultation modal of a practice\n */\nexport type PracticeConfigPracticeCloseConsultationTypes = PracticeConfig<\n PracticeConfigKind.PracticeCloseConsultationTypes,\n {\n /**\n * Should hide item with value \"Completed\"\n */\n hideCompleted?: boolean\n\n /**\n * Should hide item with value \"Requires-in-person\"\n */\n hideRequiresInPerson?: boolean\n\n /**\n * Should hide item with value \"Other\"\n */\n hideOther?: boolean\n\n /**\n * Should hide item with value \"Not-a-disease\"\n */\n hideNotADisease?: boolean\n\n /**\n * Should hide item with value \"Appropriate-for-virtual\"\n */\n hideNotAppropriateForVirtual?: boolean\n }\n>\n\n/**\n * Generic interface of a practice config\n *\n * Practice configs needs to have a JSDoc for **all** interface and fields.\n *\n */\nexport interface PracticeConfig<K, T> {\n /**\n * The uuid of the practice to apply the config\n */\n uuidPractice: string\n /**\n * The kind of the practice config. Used as a discriminator to help auto-completion.\n */\n kind: PracticeConfigKind\n /**\n * The actual interface of the config\n */\n config: T\n}\n\nexport type PracticeConfigPatientConsultCard = PracticeConfig<\n PracticeConfigKind.PatientConsultCard,\n { hideDiagnosis?: boolean }\n>\n\nexport type PracticeConfigPracticeConsultTabs = PracticeConfig<\n PracticeConfigKind.PracticeConsultTabs,\n { hideDxTx?: boolean }\n>\n\n/**\n * This type is for test (do not remove without updating the integration tests)\n */\nexport type PracticeConfigPracticeConfigExample = PracticeConfig<\n PracticeConfigKind.PracticeConfigExample,\n { primaryColor?: string }\n>\n\n/**\n * Defines the practice cookie banner\n */\nexport type PracticeConfigPracticeCookieBanner = PracticeConfig<\n PracticeConfigKind.PracticeCookieBanner,\n {\n showCookieBanner?: boolean\n policyLink?: string\n useOfCookieLink?: string\n }\n>\n\n/**\n * This interface describes all practice css variables\n * The keys should reflect the exact css name\n */\nexport type PracticeConfigPracticeCssVariables = PracticeConfig<\n PracticeConfigKind.PracticeCssVariables,\n Record<string, string>\n>\n\n/**\n * Defines the font of the practice css url\n */\nexport type PracticeConfigPracticeFontsLinks = PracticeConfig<\n PracticeConfigKind.PracticeFontsLinks,\n {\n /**\n * sans serif font family\n */\n sansSerif?: string\n /**\n * serif font family\n */\n serif?: string\n }\n>\n\n/**\n * Defines the locale switcher config\n */\nexport type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<\n PracticeConfigKind.PracticeLocaleSwitcher,\n {\n /**\n * Should hide the locale switcher\n */\n hideLocaleSwitcher?: boolean\n }\n>\n\n/**\n * Defines the online pharmacy address of the practice\n */\nexport type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<\n PracticeConfigKind.PracticePharmacyPicker,\n {\n /**\n * The address of the online pharmacy\n */\n onlinePharmacy?: PlaceData\n /**\n * Shows or hides the address input field in the treatment acceptance modal\n */\n showTreatmentAcceptanceAddressInput: boolean\n }\n>\n\n/**\n * Defines the consultation chatbox configs\n */\nexport type PracticeConfigPractitionerChatbox = PracticeConfig<\n PracticeConfigKind.PractitionerChatbox,\n {\n /**\n * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been added. Indexed by locale.\n */\n planAddedMessage?: { [languageISO639_3: string]: string }\n /**\n * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been updated. Indexed by locale.\n */\n planUpdatedMessage?: { [languageISO639_3: string]: string }\n /**\n * If defined will replace the automatic chatbox comment notifiying the patient a new exam has been dispatched. Indexed by locale.\n */\n examsUpdatedMessage?: { [languageISO639_3: string]: string }\n }\n>\n\n/**\n * This config is used to configure the layout of the consult list for practitioners\n */\nexport type PracticeConfigPractitionerConsultList = PracticeConfig<\n PracticeConfigKind.PractitionerConsultList,\n {\n /**\n * Hides the locality column\n */\n hideLocality?: boolean\n /**\n * Hides the plan name column\n */\n hidePlan?: boolean\n /**\n * Hides the fax column\n */\n hideFax?: boolean\n /**\n * Hides the expires at column\n */\n hideExpiresAt?: boolean\n }\n>\n\n/**\n * This config is used to configure the layout of the modular prescription fields\n */\nexport type PracticeConfigPracticePrescriptionFields = PracticeConfig<\n PracticeConfigKind.PracticePrescriptionFields,\n {\n /**\n * the y position in px of the first modular prescription\n */\n yCoordinate?: number\n }\n>\n\n/**\n * This config is used to enable or disable the Search feature\n */\nexport type PracticeConfigPractitionerSearch = PracticeConfig<\n PracticeConfigKind.PractitionerSearch,\n {\n /**\n * Disable search indexing a consultation on its creation\n */\n disableSearchIndexing?: boolean\n /**\n * Disable search for consultations from the ConsultList\n */\n disableSearch?: boolean\n }\n>\n\n/**\n * This config is used to configure the register walkthrough\n */\nexport type PracticeConfigPracticeRegisterWalkthrough = PracticeConfig<\n PracticeConfigKind.PracticeRegisterWalkthrough,\n {\n /**\n * The workflow uuid containing the walkthrough to display. If not defined, the walkthrough slides screen is skipped.\n */\n workflowUuid?: string\n }\n>\n\n/**\n * This config is used for all configs related to the Exams and Results module\n */\nexport type PracticeConfigPracticeExamsAndResults = PracticeConfig<\n PracticeConfigKind.PracticeExamsAndResults,\n {\n /**\n * If true, then show the deprecated URL prescription pad\n */\n showUrlPrescriptionPad?: boolean\n }\n>\n\n/**\n * This config is used for all configs related to the Layout of the app (Navbar, Footer, etc)\n */\nexport type PracticeConfigPracticeLayout = PracticeConfig<\n PracticeConfigKind.PracticeLayout,\n {\n /**\n * If true, then show the FAQ link in the Navbar\n */\n showFaqLink?: boolean\n }\n>\n\n/**\n * This config is used for all configs related to the Google Places address field\n */\nexport type PracticeConfigPracticeAddressField = PracticeConfig<\n PracticeConfigKind.PracticeAddressField,\n {\n /**\n * If true, then show the long version of the address, otherwise, show the short version\n */\n longAddress?: boolean\n }\n>\n\n/**\n * This config is used for all configs related to the Diagnosis and Treatments module\n */\nexport type PracticeConfigPracticeDiagnosisAndTreatment = PracticeConfig<\n PracticeConfigKind.PracticeDiagnosisAndTreatment,\n {\n /**\n * If true, then sort alphabetically the diagnoses, treatments, and drugs shown in their respective select dropdown\n */\n sortNames?: boolean\n /**\n * If true, it enables the Prescription Refill feature\n */\n enableRefill?: boolean\n }\n>\n\n/**\n * This config is used to set a discount code in case the info letter is accepted by the patient\n */\nexport type PracticeConfigPracticeInfoLetterDiscount = PracticeConfig<\n PracticeConfigKind.PracticeInfoLetterDiscount,\n {\n /**\n * The discount code to be applied when the info letter is accepted\n */\n discountCode?: string\n\n /**\n * Show the info letter subscription without a Discount code before the patient confirms his email,\n * if he confirms his email but still didn't check the subscription, then display a discount code for subscribing\n */\n promptInfoLetterBeforeEmailConfirmed?: boolean\n }\n>\n\nexport type PracticeConfigs =\n | PracticeConfigPractitionerSearch\n | PracticeConfigPractitionerConsultList\n | PracticeConfigPractitionerChatbox\n | PracticeConfigPracticeLocaleSwitcher\n | PracticeConfigPracticeCookieBanner\n | PracticeConfigPracticeOnlinePharmacy\n | PracticeConfigPracticeCssVariables\n | PracticeConfigPracticeFontsLinks\n | PracticeConfigPracticePrescriptionFields\n | PracticeConfigPracticeConfigExample // Here for integration tests only\n | PracticeConfigPracticeConsultTabs\n | PracticeConfigPatientConsultCard\n | PracticeConfigPracticeExamsAndResults\n | PracticeConfigPracticeLayout\n | PracticeConfigPracticeAddressField\n | PracticeConfigPracticeDiagnosisAndTreatment\n | PracticeConfigPracticeInfoLetterDiscount\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 /**\n * This value is set only after the PracticePaymentIntent has been finalized and ready to be paid\n */\n stripeClientSecret?: string\n dateCreatedAt?: Date\n dateUpdateAt?: Date\n}\n\n/**\n * All the PaymentIntentRequestMetadata Kind available\n */\nexport enum PaymentIntentRequestMetadataKind {\n ConsultRequestMetadata = 'ConsultRequestMetadata',\n RefillTreatmentRequestMetadata = 'RefillTreatmentRequestMetadata',\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to create the consult when stripe use our hook.\n */\nexport interface ConsultRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n *\n * Note: it can be `undefined` to handle backward compatibility when this interface didn't had a `kind`\n */\n kind: PaymentIntentRequestMetadataKind.ConsultRequestMetadata | undefined\n /**\n * The specialty required by the consultation\n */\n tagSpecialtyRequired: string\n /**\n * The locality required for the consultation in iso. COUNTRY (ISO 3166) - PROVINCE - COUNTY - CITY\n */\n isoLocalityRequired?: string\n /**\n * The language required for the consultation. Should respect ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes\n */\n isoLanguageRequired: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to refill a treatment plan of a consult.\n */\nexport interface RefillTreatmentRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n */\n kind: PaymentIntentRequestMetadataKind.RefillTreatmentRequestMetadata\n /**\n * The consult uuid to refill\n */\n consultUuid: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used when stripe uses our hook.\n */\nexport type PaymentIntentRequestMetadata = ConsultRequestMetadata | RefillTreatmentRequestMetadata\n\nexport interface AssignmentRequest {\n uuidAssignor: string //defaulting for insertion to the default practice admin\n uuidPractitioner?: string\n status?: AssignmentStatus\n uuidConsult?: string\n tagSpecialty?: string\n isoLocality?: string\n isoLanguage?: string\n}\n\nexport type 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.PatientConsultCard]?: PracticeConfigPatientConsultCard\n [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes\n [PracticeConfigKind.PracticeConsultTabs]?: PracticeConfigPracticeConsultTabs\n [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample\n [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner\n [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables\n [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks\n [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher\n [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy\n [PracticeConfigKind.PracticePrescriptionFields]?: PracticeConfigPracticePrescriptionFields\n [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox\n [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList\n [PracticeConfigKind.PractitionerSearch]?: PracticeConfigPractitionerSearch\n [PracticeConfigKind.PracticeRegisterWalkthrough]?: PracticeConfigPracticeRegisterWalkthrough\n [PracticeConfigKind.PracticeExamsAndResults]?: PracticeConfigPracticeExamsAndResults\n [PracticeConfigKind.PracticeLayout]?: PracticeConfigPracticeLayout\n [PracticeConfigKind.PracticeAddressField]?: PracticeConfigPracticeAddressField\n [PracticeConfigKind.PracticeDiagnosisAndTreatment]?: PracticeConfigPracticeDiagnosisAndTreatment\n [PracticeConfigKind.PracticeInfoLetterDiscount]?: PracticeConfigPracticeInfoLetterDiscount\n}\n\nexport interface Practice {\n uuid: string\n name: string\n shortName: 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 emailBusiness?: 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 txtDefaultTransmissionAddress?: 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\nexport interface PracticeInvoice {\n id: string //Stripe invoice ID\n customerEmail: string\n total: number\n subtotal: number\n currency: string\n discount: number\n}\n\n/**\n * This interface represents a practice secret\n * It is used to generate a symetric key to encrypt\n * practice related data\n */\nexport interface PracticeSecret {\n practiceUuid: string\n /**\n * The payload is the actual base64 encoded bytes that can\n * be used as the practice secret. In the db,\n * this field is base64 encoded nonce+encrypted-payload.\n * It's decrypted on the fly when returned by the api.\n */\n payload: 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","/**\n * This type represents all the patient profile kind\n */\nexport type ProfileKind = 'myself' | 'child' | 'other'\n/**\n * this type is done as an example on how to add another data kind\n */\nexport type OtherKind = 'otherKindOfType'\n\n/**\n * This type represents all the kind a data that can define `ChoiceInputData` (`OtherKind` is here only as an example on how to add a new kind)\n */\nexport type AllChoiceInputDataKind = ProfileKind | OtherKind\n\n/**\n * This interface represents a `StateTrigger` on selected profile kind\n */\nexport interface ProfileTrigger {\n kind: 'profileTrigger'\n value: ProfileKind\n}\n\n/**\n * This interface is meant as an example of another kind of `StateTrigger`\n */\nexport interface OtherTrigger {\n kind: 'otherTrigger'\n field1: number\n field2: string\n}\n\n/**\n * This type represents all the state triggers that are defined.\n *\n * A state trigger is triggered onto app states. In other words, it is for triggers that cannot be defined thanks to pure workflow answers.\n */\nexport type StateTrigger = ProfileTrigger | OtherTrigger\n\nexport 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 /** If defined, the choice input contains a kind that can be used into app. For instance, to check if a specific `kind` of answer has been selected */\n kind?: AllChoiceInputDataKind\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}\n\nexport interface LanguagePickerData extends ChoiceInputData {\n flag: string // iso3166-1\n locale: string\n}\n\nexport interface TileRadioData extends ChoiceInputData {\n fullText?: string\n image?: string\n description?: string\n}\n\nexport enum InputApplyFunctions { //these are generic metadata categories\n AllUpperCase = 'AllUpperCase',\n AllLowerCase = 'AllLowerCase',\n AllAlphabetical = 'AllAlphabetical',\n AllAlphanumeric = 'AllAlphanumeric',\n NoSpaces = 'NoSpaces',\n}\n\nexport interface EntryData {\n id?: number\n label?: string\n inputApply?: InputApplyFunctions | InputApplyFunctions[]\n hideLabel?: boolean\n minorLabel?: string\n summaryLabel?: string\n summaryHidden?: boolean\n className?: string\n /**\n * This field represents a list of `selectedAnswers` that must be set for this entry to be displayed using the followng logical combination of rules:\n *\n * #### Single string\n *\n * ```\n * // Required: rule1\n * rules: rule1\n * ```\n *\n * #### Array of strings (AND is applied between statements):\n *\n * ```\n * // Required: rule1 AND rule2\n * rules: [ rule1, rule2 ]\n * ```\n *\n * #### Array of arrays of strings (OR is applied between inner arrays. AND is applied between inner arrays statements)\n *\n * ```\n * // Required: rule1 OR rule2\n * rules: [\n * [ rule1 ],\n * [ rule2 ]\n * ]\n *\n * // Required: rule1 OR (rule2 AND rule3)\n * rules: [\n * [ rule1 ],\n * [ rule2, rule3 ]\n * ]\n *\n * // THIS IS FORBIDDEN\n * rules: [\n * rule1, // <-- THIS IS FORBIDDEN. Instead use [ rule1 ]\n * [ rule2, rule3 ]\n * ]\n * ```\n */\n triggers?: string[][] | string[] | string\n /**\n * This field represents a list of `StateTrigger` that must be fulfilled for this entry to be displayed.\n */\n stateTriggers?: StateTrigger[]\n // represents the modal that it will be rendered as\n componentKind?: string\n message?: string\n}\n\nexport interface SlideData {\n header: string\n body: string\n image?: {\n src: string\n alt: string\n }\n icon?: string\n}\n\nexport enum MetadataCategory { //these are generic metadata categories\n ChildPersonal = 'ChildPersonal',\n Consultation = 'Consultation',\n Refill = 'Refill',\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\n/**\n * This interface describes all images-alias question kind options\n */\nexport interface ImagesAliasQuestionOptions {\n /**\n * Comma separated list of accepted formats. Will be given to the input html element.\n * Use same format as described [here](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#accept)\n */\n accept?: string\n /**\n * Should allow multiple uploads or not\n */\n multiple?: boolean\n /**\n * Should display photo guide instructions or not\n */\n photoGuide?: boolean\n}\n\nexport interface GenericQuestionData<T, A = IndexedData<ChoiceInputData>, O = undefined> 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 * Options to forward to the workflow component\n */\n options?: O\n messages?: string\n}\n\nexport interface GroupedGenericQuestionData<T, A = IndexedData<ChoiceInputData>> extends GenericQuestionData<T, A> {\n inline?: boolean\n inlineLabel?: boolean\n order?: number\n}\n\nexport declare type QuestionData =\n | GenericQuestionData<'title' | 'paragraph' | 'checkbox', void>\n | GenericQuestionData<\n | 'text'\n | 'text-area'\n | 'date'\n | 'number'\n | 'images'\n | 'body-parts'\n | 'pharmacy-picker'\n | 'online-pharmacy-picker'\n | 'place-address'\n >\n | GenericQuestionData<'images-alias', IndexedData<ChoiceInputData>, ImagesAliasQuestionOptions>\n | GenericQuestionData<\n 'checkbox-group' | 'hair-loss-frontal' | 'select' | 'multiple' | 'text-select-group',\n IndexedData<ChoiceInputData>\n >\n | GroupedGenericQuestionData<\n 'radio' | 'hair-selector-women' | 'hair-selector-men' | 'hair-loss-stage' | 'hair-loss-other',\n IndexedData<RadioInputData>\n >\n | GroupedGenericQuestionData<'radio-card' | 'profile-selector', IndexedData<RadioCardInputData>>\n | GroupedGenericQuestionData<'language-picker', IndexedData<LanguagePickerData>>\n | GroupedGenericQuestionData<'tile-radio', IndexedData<TileRadioData>>\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 * This field represents a list of `ids` which will be spliced from the workflow groups and inserted into a designated location\n */\n prioritizeIds?: 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 serviceImage?: string\n walkthroughSlides?: SlideData[]\n /**\n * (optional) the service name this workflow provides\n */\n serviceName?: string\n /**\n * (optional) the description of the service this workflow provides\n */\n serviceDescription?: string\n /**\n * (optional) rules to hide certain payment plans depending on the workflow answers\n */\n hidePlanRules?: HidePlanRule[]\n}\n\nexport interface HidePlanRule {\n /**\n * the stripe plan id from the practice service\n */\n idPlan: string\n /**\n * Questions to apply yup rules on in, if rules are met then hide the plan\n */\n rules: QuestionHidePlanRule[] | QuestionHidePlanRule[][]\n}\n\nexport interface QuestionHidePlanRule {\n /**\n * the id of the question to check the rule on\n */\n questionId: string\n /**\n * a collection of yup validated rules (same exact syntax we used for the workflow formValidation field, please reuse same functions)\n */\n yupRuleValueToHide: any\n}\n\n/**\n * This interface describes an upload of an image (could be a picture, a pdf, a text file, etc.)\n */\nexport interface WorkflowUploadedImage {\n /**\n * Depending on the driver used by WorkflowInput:\n * - 'indexdb': will fetch the image in IndexDB with this id\n * - 'vault': will fetch the image in the vault with this id\n */\n idbId?: string\n /**\n * The name of the image\n */\n name: string\n /**\n * the image data (could be a picture, a pdf, a text file, etc.)\n */\n imageData?: string\n}\n\n/**\n * This interface describes a workflow prepared and ready to be sent to vault\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","export interface SearchRequest {\n terms: Terms\n}\n\nexport interface SearchResponse {\n results: SearchResult[]\n}\n\nexport interface SearchResult {\n consultUuid: string\n kind: string\n score: number\n}\n\nexport interface IndexRequest {\n consultUUID: string\n terms: Terms\n}\n\nexport type Terms = Term[]\nexport interface Term {\n kind?: string\n value: string\n}\n\n\nexport enum IndexKind {\n consultUuid,\n consultShortid,\n firstName,\n lastName,\n healthId,\n dob,\n}\n","import { APIService } from './api'\nimport {\n Uuid,\n Consult,\n ConsultRequest,\n MedicalStatus,\n ConsultTransmission,\n ClosedReasonType,\n TransmissionKind,\n TransmissionStatus,\n ConsultType,\n} from '../models'\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 * @param filterAssignee array of practitioner uuids with which you want to filter the consultations\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 filterAssignee?: string[],\n typesConsult?: ConsultType[],\n uuidParent?: Uuid\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 filterAssignee,\n typesConsult,\n uuidParent,\n },\n },\n 'Content-Range'\n )\n .then((resContentRange) => {\n if (!resContentRange || (typeof resContentRange !== 'string' && typeof resContentRange !== 'number')) {\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 filterAssignee?: string[],\n uuidParent?: Uuid,\n typesConsult?: ConsultType[]\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 filterAssignee,\n typesConsult,\n uuidParent,\n },\n })\n }\n\n public getConsultByUUID(uuidConsult: Uuid, uuidPractice?: Uuid): Promise<Consult> {\n return this.api.get<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, { params: { uuidPractice } })\n }\n\n public getConsultByPracticePaymentID(idPracticePayment: Number, uuidPractice?: Uuid): Promise<Consult> {\n return this.api.get<Consult>(`${this.baseURL}/v1/consults/payment-${idPracticePayment}`, {\n params: { uuidPractice },\n })\n }\n\n public updateConsultByUUID(\n uuidConsult: Uuid,\n consult: {\n statusMedical?: MedicalStatus\n closedReasonType?: ClosedReasonType\n closedReasonDescription?: string\n uuidAssignedDoctor?: Uuid\n neverExpires?: boolean\n },\n uuidPractice?: Uuid,\n uuidRequester?: Uuid\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, consult, {\n params: {\n uuidPractice,\n uuidRequester,\n },\n })\n }\n\n public getConsultFaxStatuses(uuidConsult: string): Promise<ConsultTransmission[]> {\n return this.api.get<ConsultTransmission[]>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, {\n params: {\n kind: TransmissionKind.Fax,\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>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, data, {\n headers: { 'Content-Type': 'multipart/form-data;' },\n })\n }\n\n public postConsultFax(uuidConsult: string, addressReceiver: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file)\n }\n\n public postConsultEmail(uuidConsult: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file)\n }\n\n public retryConsultFax(uuidConsult: string, transmissionId: string): 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 Consult,\n Drug,\n TreatmentAssociatedConsultData,\n TreatmentPlan,\n TreatmentPlans,\n TreatmentPlansRequest,\n TreatmentPlansResponse,\n TreatmentPlanUpdateRequest,\n Uuid,\n} from '..'\nimport {\n Diagnosis,\n Treatment,\n DiagnosisRequest,\n TreatmentAndDrugPrescriptionUpdateRequest,\n TreatmentRequest,\n} 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>(`${this.baseURL}/v1/diagnoses/${uuidDiagnosis}`)\n }\n\n public createDiagnosis(diagnosis: DiagnosisRequest): Promise<Diagnosis> {\n return this.api.post<Diagnosis>(`${this.baseURL}/v1/diagnoses`, diagnosis)\n }\n\n public updateDiagnosis(uuid: string, diagnosis: DiagnosisRequest): Promise<Diagnosis> {\n return this.api.put<Diagnosis>(`${this.baseURL}/v1/diagnoses/${uuid}`, diagnosis)\n }\n\n public getTreatmentByUuid(uuidDiagnosis: Uuid, uuidTreatment: Uuid): Promise<Treatment> {\n return this.api.get<Treatment>(`${this.baseURL}/v1/diagnoses/${uuidDiagnosis}/treatments/${uuidTreatment}`)\n }\n\n public getTreatmentsFromDiagnosisUuid(diagnosisUuid: Uuid): Promise<Treatment[]> {\n return this.api.get<Treatment[]>(`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`)\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(uuidConsult: Uuid): Promise<TreatmentPlan[]> {\n return this.api.get<TreatmentPlan[]>(`${this.baseURL}/v1/treatment-plans/`, { params: { uuidConsult } })\n }\n\n /**\n * creates a new treatment for the specified diagnosis\n * @param diagnosisUuid uuid of the diagnosis that the treatment is linked to\n * @param treatmentRequest the treatment to be inserted\n */\n public createTreatment(diagnosisUuid: string, treatmentRequest: TreatmentRequest) {\n return this.api.post<Treatment>(`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`, treatmentRequest)\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(uuidConsult: Uuid): Promise<TreatmentPlans> {\n return this.api.get<TreatmentPlans>(`${this.baseURL}/v1/treatment-plans/`, {\n params: { uuidConsult, populated: true },\n })\n }\n\n public postPlans(plans: TreatmentPlansRequest): Promise<TreatmentPlansResponse> {\n return this.api.post<TreatmentPlansResponse>(`${this.baseURL}/v1/treatment-plans`, plans)\n }\n\n public updateTreatmentPlan(\n uuidPlan: string,\n uuidConsult: string,\n diagnosisRequest: DiagnosisRequest,\n plan: TreatmentAndDrugPrescriptionUpdateRequest,\n refill?: boolean\n ): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}`, <\n TreatmentPlanUpdateRequest\n >{\n uuidConsult,\n diagnosis: diagnosisRequest,\n plan,\n refill,\n })\n }\n\n public setAssociatedConsultsToTreatment(\n diagnosisUuid: string,\n treatmentUuid: string,\n arrAssociatedConsults: TreatmentAssociatedConsultData[]\n ): Promise<TreatmentAssociatedConsultData[]> {\n return this.api.post<TreatmentAssociatedConsultData[]>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`,\n arrAssociatedConsults\n )\n }\n\n public updateAssociatedConsultsToTreatment(\n diagnosisUuid: string,\n treatmentUuid: string,\n arrAssociatedConsults: TreatmentAssociatedConsultData[]\n ): Promise<TreatmentAssociatedConsultData[]> {\n return this.api.put<TreatmentAssociatedConsultData[]>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`,\n arrAssociatedConsults\n )\n }\n\n public acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}/accept`, { uuidConsult })\n }\n\n /**\n * retrieves all the drugs of the specified practice\n * @param uuidPractice\n */\n public async getAllDrugs(uuidPractice: string): Promise<Drug[] | undefined> {\n const res = await this.api.get<{ foundDrugs: Drug[] }>(`${this.baseURL}/v1/drugs/practice/${uuidPractice}`)\n if (res && res.foundDrugs) return res.foundDrugs\n return undefined\n }\n}\n","import { AxiosError } from 'axios'\nimport type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh'\nimport {\n AuthenticationBadRequest,\n AuthenticationFailed,\n AuthenticationServerError,\n AuthenticationUnconfirmedEmail,\n AuthRecoverRequest,\n AuthTokenRequest,\n AuthTokenResponse,\n Base64String,\n IdentityCreateRequest,\n IdentityCreationBadRequest,\n IdentityCreationConflict,\n IdentityCreationFailed,\n IdentityResendConfirmEmailRequest,\n IdentityResponse,\n IdentityUpdateRequest,\n M2MTokenRequest,\n QRCodeRequest,\n QRCodeResponse,\n Tokens,\n Uuid,\n WhoAmIResponse,\n} from '../models'\nimport { APIService } from './api'\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)) // This is the default behavior for User JWT tokens. If you want other kind of refresh you shall overwrite this call\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 a M2M token for a service\n *\n * @param req The credentials required to get an access token\n * @returns AuthTokenResponse\n */\n public async m2mToken(req: M2MTokenRequest): Promise<AuthTokenResponse> {\n let resp: AuthTokenResponse | undefined\n\n try {\n let config: AxiosAuthRefreshRequestConfig = {\n skipAuthRefresh: true,\n }\n\n resp = await this.api.post<AuthTokenResponse>(`${this.baseURL}/v1/m2m/token`, req, config)\n\n this.api.setTokens({\n accessToken: resp.accessToken,\n })\n } catch (e) {\n console.error('Error while posting m2m token:', e)\n\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 * 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 console.error('Error while posting auth token:', e)\n\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 424:\n throw new AuthenticationUnconfirmedEmail()\n case 500:\n throw new AuthenticationServerError()\n case 401:\n default:\n throw new AuthenticationFailed()\n }\n }\n throw new AuthenticationFailed()\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 * 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 * 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 * 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 * 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 * @param skipCache (default: false) will skip identity cache (not even update it)\n * @returns IdentityResponse\n */\n public async identityGet(identityID: Uuid, skipCache = false): Promise<IdentityResponse> {\n const tokens = this.api.getTokens()\n const cacheKey = (tokens.accessToken ?? '') + (tokens.refreshToken ?? '') + identityID\n\n if (skipCache || !tokens.accessToken || !this.identityCache[cacheKey]) {\n const identity = await this.api.get<IdentityResponse>(`${this.baseURL}/v1/identities/${identityID}`)\n\n if (skipCache) return identity\n\n this.identityCache[cacheKey] = identity\n }\n return this.identityCache[cacheKey]\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(identityID: Uuid, req: IdentityUpdateRequest): 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(identityID: Uuid, password: Base64String): Promise<QRCodeResponse> {\n const req: QRCodeRequest = { password }\n return this.api.post<QRCodeResponse>(`${this.baseURL}/v1/identities/${identityID}/mfa`, req, {\n headers: { Accept: 'application/json' },\n })\n }\n\n /**\n * Attempt to resend the email confirmation email\n *\n * @param req IdentityResendConfirmEmailRequest\n * @return void\n */\n public async identitySendConfirmEmail(req: IdentityResendConfirmEmailRequest): Promise<void> {\n return this.api.post<void>(`${this.baseURL}/v1/identity/confirm`, req)\n }\n\n /**\n * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)\n *\n * @param email the customer email\n * @returns IdentityResponse\n */\n public async identityGetByCustomerEmail(email: string): Promise<IdentityResponse> {\n return this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@')))\n }\n\n /**\n * Get an identity using a base64 hash\n *\n * @param b64Hash base64 hash of the identity\n * @returns IdentityResponse\n */\n public async identityGetByHash(b64Hash: string): Promise<IdentityResponse> {\n //TODO: Right now this maps directly to the IdentityGet call.\n //Eventually, with the mapping table method, this would lead to another\n //call (ie: /v1/mapping/[b64Hash]) which would return a blob to decrypt\n //which would contain the real identityID to call IdentityGet with.\n\n //The hash comes in base64 format but it isn't URL safe soe we have to convert\n //to base64URL (see https://en.wikipedia.org/wiki/Base64#The_URL_applications)\n return this.identityGet(b64Hash.replace(/\\+/g, '-').replace(/\\//g, '_'))\n }\n}\n","import {APIService} from \"./api\";\nimport {IndexRequest, SearchRequest, SearchResponse, Terms} from \"../models/search\";\n\nexport class SearchService {\n constructor(private api: APIService, private baseURL: string) {}\n\n /**\n * Creates search indexes for the terms passed in order to be able to search for it in the future\n * @param consultUUID\n * @param terms the search terms to be indexed\n */\n public index(\n consultUUID: string,\n terms: Terms\n ): Promise<any> {\n return this.api.post<IndexRequest>(\n `${this.baseURL}/v1/index`,\n <IndexRequest> {\n consultUUID,\n terms\n }\n )\n }\n\n /**\n * Searches for the consultations corresponding to the search terms entered in the query\n * @param terms array of search terms\n */\n public search(\n terms: Terms\n ): Promise<SearchResponse> {\n return this.api.post<SearchResponse>(\n `${this.baseURL}/v1/search`,\n <SearchRequest> {\n terms\n }\n )\n }\n}","import { hashToBase64String } from '../helpers'\nimport { PaymentStatus, PracticeAccount, Uuid } from '../models'\nimport {\n Assignment,\n AssignmentRequest,\n PaymentIntentRequestMetadata,\n PlanType,\n Practice,\n PracticeConfigKind,\n PracticeConfigs,\n PracticeInvoice,\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(private api: APIService, private baseURL: string) {}\n\n /**\n * This function will only work if the service is initialized with\n * an M2M with the scope `practice.practices.get`\n * @returns an array of practices\n */\n public practiceGetAll(): Promise<Practice[]> {\n return this.api.get<Practice[]>(`${this.baseURL}/v1/practices`)\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>(`${this.baseURL}/v1/practices`, {\n params: {\n url_practice: practiceURL,\n ...params,\n },\n })\n }\n\n public practiceGetFromUuid(practiceUuid: Uuid, locale?: string, withAccounts?: boolean): Promise<Practice> {\n return this.api.get<Practice>(`${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(practiceUuid: Uuid): Promise<PracticeConfigs[]> {\n return this.api.get<PracticeConfigs[]>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`)\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>(`${this.baseURL}/v1/practices/${practiceUuid}/configs/${kind}`)\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(practiceUuid: Uuid, config: PracticeConfigs): Promise<PracticeConfigs> {\n return this.api.post<PracticeConfigs>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`, config)\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(config: PracticeConfigs): 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[]>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts`)\n }\n\n public practiceGetAccount(practiceUuid: Uuid, accountUuid: Uuid): Promise<PracticeAccount> {\n return this.api.get<PracticeAccount>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts/${accountUuid}`)\n }\n\n /**\n * Get the PracticeWorkflows of a specific practice\n * @param practiceUuid the uuid of the practice\n * @param kind (optional) the kind of WorkflowType to filter in\n * @returns a list of PracticeWorkflow\n */\n public practiceGetWorkflows(practiceUuid: Uuid, kind?: WorkflowType): Promise<PracticeWorkflow[]> {\n return this.api.get<PracticeWorkflow[]>(`${this.baseURL}/v1/practices/${practiceUuid}/workflows`, {\n params: { kind },\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(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePlan[]> {\n return this.api.get<PracticePlan[]>(`${this.baseURL}/v1/practices/${practiceUuid}/plans`, {\n params: { kind: planType },\n })\n }\n\n public practiceGetPlan(practiceUuid: Uuid, planId: number): Promise<PracticePlan> {\n return this.api.get<PracticePlan>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}`)\n }\n\n public practiceGetPlanPrices(practiceUuid: Uuid, planId: number): Promise<PracticePlanPrices> {\n return this.api.get<PracticePlanPrices>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}/prices`)\n }\n\n // Payments\n public practiceGetPayments(\n practiceUuid: Uuid,\n statusPayment?: PaymentStatus,\n withConsultUUIDNULL?: boolean,\n perPage?: number,\n indexPage?: number\n ): Promise<PracticePayment[]> {\n return this.api.get<PracticePayment[]>(`${this.baseURL}/v1/practices/${practiceUuid}/payments`, {\n params: {\n status: statusPayment,\n withConsultUUIDNULL,\n perPage,\n indexPage,\n },\n })\n }\n\n public practiceGetPayment(practiceUuid: Uuid, idStripeInvoiceOrPaymentIntent: string): 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(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePaymentIntent[]> {\n return this.api.get<PracticePaymentIntent[]>(`${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 hashToBase64String(email.toLowerCase())\n }\n\n /**\n * Creates a PracticePaymentIntent\n * @param practiceUuid the uuid of the practice\n * @param planId the plan id to use\n * @param userEmail the email address of the user\n * @param isoLocality (optional) the desired locality\n * @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)\n * @param promotionCode (optional) promotion code to apply\n * @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).\n * @returns\n */\n public practiceCreatePaymentsIntent(\n practiceUuid: Uuid,\n planId: number,\n userEmail: string,\n isoLocality?: string,\n url_subdomain?: string,\n requestMetadata?: PaymentIntentRequestMetadata\n ): Promise<PracticePaymentIntent> {\n return this.api.post<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/`,\n {\n idPlan: planId,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n isoLocality,\n requestMetadata,\n },\n { params: { url_subdomain } }\n )\n }\n\n public practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent> {\n return this.api.get<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${paymentIntentId}`\n )\n }\n\n /**\n * Updates a PracticePaymentIntent\n * @param practiceUuid the practice uuid\n * @param idPraticePaymentIntent the id of the PracticePaymentIntent to update\n * @param practicePaymentIntent the desired PracticePaymentIntent\n * @param userEmail the email of the user\n * @param promotionCode (optional) promotional code to apply\n * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.\n * @returns the updated PracticePaymentIntent\n */\n public practiceUpdatePaymentsIntent(\n practiceUuid: string,\n idPraticePaymentIntent: number,\n practicePaymentIntent: PracticePaymentIntent,\n userEmail: string,\n promotionCode?: string,\n finalize?: boolean\n ) {\n return this.api.put<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${idPraticePaymentIntent}`,\n {\n ...practicePaymentIntent,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n },\n { params: { promotionCode, finalize } }\n )\n }\n\n /**\n * Invoice\n * @param practiceUuid UUID of the practice to get the invoice from\n * @param invoiceId ID of the invoice in stripe\n */\n public getInvoice(practiceUuid: Uuid, invoiceId: string): Promise<PracticeInvoice> {\n return this.api.get<PracticeInvoice>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/invoices/${invoiceId}`\n )\n }\n\n // Practitioner\n public practiceGetPractitioners(practiceUuid: Uuid): Promise<Practitioner[]> {\n return this.api.get<Practitioner[]>(`${this.baseURL}/v1/practices/${practiceUuid}/practitioners`)\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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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(practiceUuid: Uuid, practitionerUuid: Uuid): 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[]>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`)\n }\n\n public practiceCreateAssignment(practiceUuid: Uuid, requestBody: AssignmentRequest): Promise<Assignment> {\n return this.api.post<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`, requestBody)\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(practiceUuid: Uuid, assignmentId: number): Promise<Assignment> {\n return this.api.get<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`)\n }\n\n // Quotas\n public practiceGetQuotas(practiceUuid: Uuid): Promise<PractitionerQuota[]> {\n return this.api.get<PractitionerQuota[]>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas`)\n }\n\n public practiceGetQuota(practiceUuid: Uuid, quotaId: number): Promise<PractitionerQuota> {\n return this.api.get<PractitionerQuota>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas/${quotaId}`)\n }\n}\n","import { APIService } from './api'\nimport {\n ClosedReasonType,\n Consult,\n DataCreateResponse,\n LockboxDataRequest,\n MedicalStatus,\n ResumeConsultEmailRequest,\n Uuid,\n} 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 options: {\n updateMedicalStatus: boolean\n } = { updateMedicalStatus: true },\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`, req, {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n update_medical_status: options.updateMedicalStatus,\n },\n })\n }\n\n public updateConsultByUUID(\n patientUuid: Uuid,\n uuidConsult: Uuid,\n statusMedical: MedicalStatus,\n closedReasonType?: ClosedReasonType,\n closedReasonDescription?: string,\n neverExpires?: boolean\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, {\n patientUuid,\n statusMedical,\n closedReasonType,\n closedReasonDescription,\n neverExpires,\n })\n }\n\n /**\n * This function notifies teller that the fax sent for a specific consult did not get through\n * @todo - Make service only exposed route\n * @param practiceUuid the practice uuid linked to the consult\n * @param consultationUuid the consultation uuid\n * @param consultationShortId the consultation short id\n * @param fax the address where to send the fax\n * @returns void\n */\n public notifyFaxFailed(practiceUuid: Uuid, consultationUuid: Uuid, consultationShortId: string, fax: string) {\n return this.api.post<void>(\n `${this.baseURL}/v1/fax-failed`,\n {\n consultationUuid,\n consultationShortId,\n fax,\n },\n {\n params: { practice_uuid: practiceUuid },\n }\n )\n }\n\n /**\n * This function let's you reassign a practictioner to a consult and send a notification email\n * @todo - Make service only exposed route\n * @param uuidConsult the uuid of the consult to reassign\n * @param newPractitionerUuid the uuid of the practitioner that will get reassigned\n */\n public reassignmentEmail(uuidConsult: Uuid, newPractitionerUuid: Uuid) {\n return this.api.post<void>(`${this.baseURL}/v1/consult/${uuidConsult}/reassignment-email`, {\n newPractitionerUuid,\n })\n }\n\n /**\n * This function will send an email to the patientUuid, saying that the online practice has been sent a fax successfully\n * @todo - Make service only exposed route\n * @param consult\n * @param patientUuid\n * @returns void\n */\n public sendOnlineFaxSuccessfulEmail(consult: Consult, patientUuid: Uuid): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/online-fax-notify`, { consult, patientUuid })\n }\n\n /**\n * This function will send an email to patient to allow them to resume the consult.\n * @param req the body of the resume consult request\n * @returns void\n */\n public sendResumeConsultEmail(req: ResumeConsultEmailRequest): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/resume-consult-email`, req)\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 { ServiceCollection, ServiceCollectionRequest } from '../models'\nimport {\n APIService,\n ConsultService,\n DiagnosisService,\n GuardService,\n PracticeService,\n SearchService,\n TellerService,\n VaultService,\n WorkflowService,\n} from '../services'\n\n/**\n * This function is used to initialize services with a provided url\n * @param services an object containing the url of the services to init\n * @param authenticationCallback (optional) the authentification callback. Called when the token were not able to be refreshed.\n * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)\n * @returns an instance of each services with a provided url\n */\nexport const init = (\n services: ServiceCollectionRequest,\n authenticationCallback?: (err: Error, practiceUuid?: string) => void,\n useLocalStorage = true\n): ServiceCollection => {\n const {\n tellerBaseURL,\n practiceBaseURL,\n consultBaseURL,\n vaultBaseURL,\n guardBaseURL,\n searchBaseURL,\n workflowBaseURL,\n diagnosisBaseURL,\n } = services\n\n const apiService = new APIService(useLocalStorage, undefined, authenticationCallback)\n\n return {\n apiService,\n tellerService: tellerBaseURL ? new TellerService(apiService, tellerBaseURL) : undefined,\n practiceService: practiceBaseURL ? new PracticeService(apiService, practiceBaseURL) : undefined,\n consultService: consultBaseURL ? new ConsultService(apiService, consultBaseURL) : undefined,\n vaultService: vaultBaseURL ? new VaultService(apiService, vaultBaseURL) : undefined,\n guardService: guardBaseURL ? new GuardService(apiService, guardBaseURL) : undefined,\n searchService: searchBaseURL ? new SearchService(apiService, searchBaseURL) : undefined,\n workflowService: workflowBaseURL ? new WorkflowService(apiService, workflowBaseURL) : undefined,\n diagnosisService: diagnosisBaseURL ? new DiagnosisService(apiService, diagnosisBaseURL) : undefined,\n }\n}\n"],"names":["hashToBase64String","value","Buffer","from","sha256","update","digest","toString","AxiosService","config","axios","create","apiRequest","url","data","headers","then","res","apiRequestHeader","headerToRetrieve","toLowerCase","get","method","deleteRequest","post","put","patch","head","APIService","useLocalStorage","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","ApisPracticeManager","serviceCollReq","getAuthTokenCbk","Map","practiceUuid","cacheKey","practiceInstance","practiceInstances","newPracticeInstance","init","undefined","authTokenFunc","guardService","log","Error","apiService","set","AssistantType","TransmissionKind","TransmissionStatus","ConsultType","FeeStatus","MedicalStatus","TaskStatus","ClosedReasonType","VisibilityType","DrugType","PrescriptionStatus","PlanStatus","AuthenticationFailed","AuthenticationBadRequest","AuthenticationServerError","AuthenticationUnconfirmedEmail","IdentityCreationFailed","IdentityCreationBadRequest","IdentityCreationConflict","VaultDataMissing","WorkflowType","RateDimension","PlanType","PaymentStatus","PractitionerStatus","AssignmentStatus","PractitionnerRoleType","OtherRoleType","LicenseStatus","PeriodType","SyncStatus","PracticeEmailKind","PracticeConfigKind","StripePriceType","PaymentIntentRequestMetadataKind","IndexKey","DocumentType","InputApplyFunctions","MetadataCategory","IndexKind","ConsultService","api","baseURL","consultCreate","c","countConsults","uuidPractice","uuidRequester","statusesMedical","statusesExclude","shortId","columnToSortTo","orderToSortTo","perPage","indexPage","filterAssignedDoctor","filterCurrentPractitioner","filterIsoLocality","filterAssignee","typesConsult","uuidParent","params","page","sortColumns","orderColumns","resContentRange","parseInt","getConsults","getConsultByUUID","uuidConsult","getConsultByPracticePaymentID","idPracticePayment","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","getTreatmentByUuid","uuidTreatment","getTreatmentsFromDiagnosisUuid","diagnosisUuid","getTreatmentPlansFromConsultUuid","createTreatment","treatmentRequest","getTreatmentPlansPopulatedFromConsultUuid","populated","postPlans","plans","updateTreatmentPlan","uuidPlan","diagnosisRequest","plan","refill","setAssociatedConsultsToTreatment","treatmentUuid","arrAssociatedConsults","updateAssociatedConsultsToTreatment","acceptTreatmentPlan","getAllDrugs","foundDrugs","GuardService","authRefresh","bind","identityCache","whoAmICache","m2mToken","req","skipAuthRefresh","resp","isAxiosError","code","authToken","authLogout","authRecover","identityCreate","identityGet","identityID","skipCache","identity","whoAmI","refreshCache","identityUpdate","identityMFAQRCode","password","Accept","identitySendConfirmEmail","identityGetByCustomerEmail","email","identityGetByHash","substring","indexOf","b64Hash","replace","SearchService","index","consultUUID","terms","search","PracticeService","practiceGetAll","practiceGetFromURL","practiceURL","url_practice","practiceGetFromUuid","locale","withAccounts","accounts","practiceConfigGetFromPracticeUuid","practiceConfigGetByKindForPracticeUuid","practiceConfigCreateForPracticeUuid","practiceConfigUpdate","practiceGetAccounts","practiceGetAccount","accountUuid","practiceGetWorkflows","practiceGetWorkflow","workflowType","practiceGetPlans","planType","practiceGetPlan","planId","practiceGetPlanPrices","practiceGetPayments","statusPayment","withConsultUUIDNULL","practiceGetPayment","idStripeInvoiceOrPaymentIntent","practiceGetPaymentForStripePaymentIntentWithID","stripePaymentIntentId","practiceGetPaymentsIntents","getPaymentIntentHashedEmail","practiceCreatePaymentsIntent","userEmail","isoLocality","url_subdomain","requestMetadata","idPlan","hashUserEmail","practiceGetPaymentsIntent","paymentIntentId","practiceUpdatePaymentsIntent","idPraticePaymentIntent","practicePaymentIntent","promotionCode","finalize","getInvoice","invoiceId","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","options","updateMedicalStatus","lockbox_owner_uuid","data_uuid","update_medical_status","patientUuid","statusMedical","closedReasonType","closedReasonDescription","neverExpires","notifyFaxFailed","consultationUuid","consultationShortId","fax","practice_uuid","reassignmentEmail","newPractitionerUuid","sendOnlineFaxSuccessfulEmail","sendResumeConsultEmail","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","services","authenticationCallback","tellerBaseURL","practiceBaseURL","consultBaseURL","vaultBaseURL","guardBaseURL","searchBaseURL","workflowBaseURL","diagnosisBaseURL","tellerService","practiceService","consultService","vaultService","searchService","workflowService","diagnosisService"],"mappings":";;;;;AAGA;;;;;SAKgBA,kBAAkB,CAACC,KAAa;EAC5C,OAAOC,MAAM,CAACC,IAAI,CAACC,MAAM,EAAE,CAACC,MAAM,CA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