oro-sdk-apis 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"oro-sdk-apis.cjs.production.min.js","sources":["../src/helpers/hash.ts","../src/models/consult.ts","../src/models/diagnosis.ts","../src/services/axios.ts","../src/services/api.ts","../src/services/apisPracticeManager.ts","../src/models/practice.ts","../src/models/vault.ts","../src/models/workflow.ts","../src/models/search.ts","../src/models/error.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","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 Closing = 'Closing',\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","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'\nimport { v4 as uuidv4 } from 'uuid'\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 const sessionId = uuidv4()\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 'X-Session-Id': sessionId,\n 'X-Request-Id': uuidv4(),\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 // The refreshInstance will be a single instance that is used to refresh the tokens of others this way it will not interfere with requests made by other services \n const newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage)\n this.practiceInstances.set('refreshInstance', newPracticeInstance)\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 newPracticeInstance.apiService.setAuthRefreshFn(() => this.authTokenFunc(practiceUuid))\n this.practiceInstances.set(cacheKey, newPracticeInstance)\n\n return newPracticeInstance\n }\n\n /**\n * Uses the refresh intance to fetch a new auth token for the given practice\n * @param practiceUuid the uuid of the practice or key of a specific instance\n * @returns a new authentication token\n */\n public async authTokenFunc(practiceUuidOrInstanceName?: string): Promise<AuthTokenResponse> {\n // fetch the refresh intance and refresh the token for another practice\n const newPracticeInstance = await this.get('refreshInstance');\n if (newPracticeInstance.guardService) {\n console.log(`\\x1b[36m[Auth] Refresh auth called (practiceUuid: ${practiceUuidOrInstanceName})\\x1b[36m`)\n return await this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuidOrInstanceName)\n } else {\n throw Error('[Auth] Unable to refresh token guard service is undefined')\n }\n }\n}\n","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 * The text to display for the discount code\n */\n discountText?: 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 associatedWorkflowUuid?: 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 activateFollowUp: boolean\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 * Overrides the read only ability of the question's answer\n * populated by extended workflow feature\n */\n readOnly?: boolean\n /**\n * Overrides the fillable default of the question's answer\n * populated by extended workflow feature\n */\n defaultEmpty?: boolean\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 /**\n * (optional) extension of another workflow referenced by uuid\n */\n extendingWorkflow?: string\n\n /**\n * (optional) rules for the extension of another workflow \n */\n extendingRules?: IndexedData<WorkflowExtendingRules>\n}\n\nexport interface WorkflowExtendingRules {\n /**\n * Whether the field becomes read only in the extended workflow\n */\n readOnly?: boolean,\n /**\n * Whether the field becomes deselected/empty by default in the extended workflow\n */\n defaultEmpty?: boolean,\n /**\n * Whether the field should be removed altogether in the extended workflow\n */\n remove?: boolean,\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","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 { 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 uuidPatient?: string\n // numTry ?: number,\n // delay ?: number,\n ): Promise<ConsultTransmission> {\n let data = new FormData()\n\n data.append('nameDriverReceiver', nameDriver)\n if (uuidPatient) {\n data.append('uuidPatient', uuidPatient)\n }\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(\n uuidConsult: string,\n addressReceiver: string,\n file: File,\n uuidPatient?: string\n ): Promise<ConsultTransmission> {\n return this.postConsultTransmission(\n uuidConsult,\n 'Documo',\n addressReceiver,\n file,\n undefined,\n undefined,\n undefined,\n uuidPatient\n )\n }\n\n public postConsultEmail(uuidConsult: string, file: File, uuidPatient?: string): Promise<ConsultTransmission> {\n return this.postConsultTransmission(\n uuidConsult,\n 'Pharmacierge',\n undefined,\n file,\n undefined,\n undefined,\n undefined,\n uuidPatient\n )\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 getAssociatedConsultsOfTreatment(\n diagnosisUuid: string,\n treatmentUuid: string\n ): Promise<TreatmentAssociatedConsultData[]> {\n return this.api.get<TreatmentAssociatedConsultData[]>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`\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 the patientUuid, saying that the refill has been completed successfully\n * @todo - Make service only exposed route\n * @param consult\n * @param patientUuid\n * @returns void\n */\n public sendRefillFaxSucceededEmail(consult: Consult, patientUuid: Uuid): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/refill-confirm-email`, { 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","AssistantType","TransmissionKind","TransmissionStatus","ConsultType","FeeStatus","MedicalStatus","TaskStatus","ClosedReasonType","VisibilityType","DrugType","PrescriptionStatus","PlanStatus","AxiosService","config","this","axios","create","_proto","prototype","apiRequest","_apiRequest","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","data","wrap","_context","prev","next","headers","abrupt","_extends","then","res","stop","_x","_x2","_x3","apply","arguments","apiRequestHeader","_apiRequestHeader","_callee2","headerToRetrieve","_context2","_res$headers$headerTo","toLowerCase","_x4","_x5","_x6","_x7","get","method","deleteRequest","post","put","patch","head","APIService","_AxiosService","useLocalStorage","tokenRefreshFailureCallback","_this","call","self","_assertThisInitialized","sessionId","uuidv4","interceptors","request","use","token","useRefreshToken","getTokens","refreshToken","accessToken","Authorization","X-Session-Id","X-Request-Id","error","Promise","reject","createAuthRefreshInterceptor","_ref","failedRequest","tokenResp","authRefreshFn","setTokens","sent","response","resolve","t0","console","statusCodes","_inheritsLoose","setAuthRefreshFn","fn","tokens","localStorage","setItem","JSON","stringify","item","getItem","parse","ApisPracticeManager","serviceCollReq","getAuthTokenCbk","Map","newPracticeInstance","init","undefined","practiceInstances","set","_get","practiceUuid","cacheKey","practiceInstance","apiService","authTokenFunc","_authTokenFunc","practiceUuidOrInstanceName","guardService","log","Error","WorkflowType","RateDimension","PlanType","PaymentStatus","PractitionerStatus","AssignmentStatus","PractitionnerRoleType","OtherRoleType","LicenseStatus","PeriodType","SyncStatus","PracticeEmailKind","PracticeConfigKind","StripePriceType","PaymentIntentRequestMetadataKind","IndexKey","DocumentType","InputApplyFunctions","MetadataCategory","IndexKind","AuthenticationFailed","_Error","_wrapNativeSuper","AuthenticationBadRequest","_Error2","AuthenticationServerError","_Error3","AuthenticationUnconfirmedEmail","_Error4","IdentityCreationFailed","_Error5","IdentityCreationBadRequest","_Error6","IdentityCreationConflict","_Error7","VaultDataMissing","_Error8","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","uuidPatient","FormData","append","Content-Type","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","getAssociatedConsultsOfTreatment","acceptTreatmentPlan","getAllDrugs","_getAllDrugs","foundDrugs","GuardService","authRefresh","bind","identityCache","whoAmICache","m2mToken","_m2mToken","req","resp","_e$response","code","skipAuthRefresh","isAxiosError","t1","authToken","_authToken","_e$response2","_authRefresh","_callee3","_context3","authLogout","_authLogout","_callee4","_context4","authRecover","_authRecover","_callee5","_context5","identityCreate","_identityCreate","_callee6","_e$response3","_context6","identityGet","_identityGet","_callee7","identityID","skipCache","_tokens$accessToken","_tokens$refreshToken","identity","_context7","whoAmI","_whoAmI","_callee8","refreshCache","_this$api$getTokens$a","_context8","_x8","identityUpdate","_identityUpdate","_callee9","_context9","_x9","_x10","identityMFAQRCode","_identityMFAQRCode","_callee10","password","_context10","Accept","_x11","_x12","identitySendConfirmEmail","_identitySendConfirmEmail","_callee11","_context11","_x13","identityGetByCustomerEmail","_identityGetByCustomerEmail","_callee12","email","_context12","identityGetByHash","substring","indexOf","_x14","_identityGetByHash","_callee13","b64Hash","_context13","replace","_x15","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","_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","sendRefillFaxSucceededEmail","sendResumeConsultEmail","VaultService","lockboxCreate","_lockboxCreate","lockboxMetadata","lockboxMetadataAdd","_lockboxMetadataAdd","lockboxSecretGet","_lockboxSecretGet","lockboxGrant","_lockboxGrant","grantsGet","_grantsGet","lockboxDataGet","_lockboxDataGet","dataUuid","stream","_x16","_x17","lockboxManifestGet","_lockboxManifestGet","filter","_x18","_x19","_x20","lockboxMetadataGet","_lockboxMetadataGet","fields","groupby","_x21","_x22","_x23","_x24","_x25","vaultIndexPut","_vaultIndexPut","entries","indexOwnerUuid","index_owner_uuid","_x26","_x27","vaultIndexSnapshotPut","_vaultIndexSnapshotPut","entry","_x28","vaultIndexGet","_vaultIndexGet","indexKeys","identifiers","timestamp","index_keys","_x29","_x30","_x31","WorkflowService","v1Url","getWorkflows","getWorkflow","id","createdAt","services","authenticationCallback","tellerBaseURL","practiceBaseURL","consultBaseURL","vaultBaseURL","guardBaseURL","searchBaseURL","workflowBaseURL","diagnosisBaseURL","tellerService","practiceService","consultService","vaultService","searchService","workflowService","diagnosisService"],"mappings":"4QAQgBA,EAAmBC,GAC/B,OAAOC,SAAOC,KAAKC,WAASC,OAAOJ,GAAOK,OAAO,OAAQ,OAAOC,SAAS,mvQCTjEC,EAiBAC,EAUAC,EA8BAC,EAKAC,EASAC,EAcAC,EAQAC,EC7FAC,EAuDAC,EA4BAC,EAqBAC,ECpGCC,aAGT,SAAAA,EACIC,GAEKA,IAAQA,EAAS,IAEtBC,KAAKC,MAAQA,EAAMC,OAAOH,GAC7B,IAAAI,EAAAL,EAAAM,UA4EA,OA5EAD,EAEeE,sBAAU,IAAAC,EAAAC,EAAAC,IAAAC,MAAhB,SAAAC,EAAiBX,EAA4BY,EAAaC,GAAU,OAAAJ,IAAAK,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S,GAAiBrG,EAAY6Y,QAAoBpZ"}
1
+ {"version":3,"file":"oro-sdk-apis.cjs.production.min.js","sources":["../src/helpers/hash.ts","../src/models/consult.ts","../src/models/diagnosis.ts","../src/services/axios.ts","../src/services/api.ts","../src/services/apisPracticeManager.ts","../src/models/practice.ts","../src/models/vault.ts","../src/models/workflow.ts","../src/models/search.ts","../src/models/error.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","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 Closing = 'Closing',\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","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'\nimport { v4 as uuidv4 } from 'uuid'\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 const sessionId = uuidv4()\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 'X-Session-Id': sessionId,\n 'X-Request-Id': uuidv4(),\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 // The refreshInstance will be a single instance that is used to refresh the tokens of others this way it will not interfere with requests made by other services \n const newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage)\n this.practiceInstances.set('refreshInstance', newPracticeInstance)\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 newPracticeInstance.apiService.setAuthRefreshFn(() => this.authTokenFunc(practiceUuid))\n this.practiceInstances.set(cacheKey, newPracticeInstance)\n\n return newPracticeInstance\n }\n\n /**\n * Uses the refresh intance to fetch a new auth token for the given practice\n * @param practiceUuid the uuid of the practice or key of a specific instance\n * @returns a new authentication token\n */\n public async authTokenFunc(practiceUuidOrInstanceName?: string): Promise<AuthTokenResponse> {\n // fetch the refresh intance and refresh the token for another practice\n const newPracticeInstance = await this.get('refreshInstance');\n if (newPracticeInstance.guardService) {\n console.log(`\\x1b[36m[Auth] Refresh auth called (practiceUuid: ${practiceUuidOrInstanceName})\\x1b[36m`)\n return await this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuidOrInstanceName)\n } else {\n throw Error('[Auth] Unable to refresh token guard service is undefined')\n }\n }\n}\n","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 * The text to display for the discount code\n */\n discountText?: 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 associatedWorkflowUuid?: 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 activateFollowUp: boolean\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 * Overrides the read only ability of the question's answer\n * populated by extended workflow feature\n */\n readOnly?: boolean\n /**\n * Overrides the fillable default of the question's answer\n * populated by extended workflow feature\n */\n defaultEmpty?: boolean\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 /**\n * (optional) extension of another workflow referenced by uuid\n */\n extendingWorkflow?: string\n\n /**\n * (optional) rules for the extension of another workflow \n */\n extendingRules?: IndexedData<WorkflowExtendingRules>\n}\n\nexport interface WorkflowExtendingRules {\n /**\n * Whether the field becomes read only in the extended workflow\n */\n readOnly?: boolean,\n /**\n * Whether the field becomes deselected/empty by default in the extended workflow\n */\n defaultEmpty?: boolean,\n /**\n * Whether the field should be removed altogether in the extended workflow\n */\n remove?: boolean,\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","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 { 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 uuidPatient?: string\n // numTry ?: number,\n // delay ?: number,\n ): Promise<ConsultTransmission> {\n let data = new FormData()\n\n data.append('nameDriverReceiver', nameDriver)\n if (uuidPatient) {\n data.append('uuidPatient', uuidPatient)\n }\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(\n uuidConsult: string,\n addressReceiver: string,\n file: File,\n uuidPatient?: string\n ): Promise<ConsultTransmission> {\n return this.postConsultTransmission(\n uuidConsult,\n 'Documo',\n addressReceiver,\n file,\n undefined,\n undefined,\n undefined,\n uuidPatient\n )\n }\n\n public postConsultEmail(uuidConsult: string, file: File, uuidPatient?: string): Promise<ConsultTransmission> {\n return this.postConsultTransmission(\n uuidConsult,\n 'Pharmacierge',\n undefined,\n file,\n undefined,\n undefined,\n undefined,\n uuidPatient\n )\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 getAssociatedConsultsOfTreatment(\n diagnosisUuid: string,\n treatmentUuid: string\n ): Promise<TreatmentAssociatedConsultData[]> {\n return this.api.get<TreatmentAssociatedConsultData[]>(\n `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`\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 * Notifies the guard and confirms the phishing attempt\n * @param attemptUuid the guard logged attempt id\n * @returns void\n */\n public async authConfirmPhishingAttempts(attemptUuid: Uuid): Promise<void> {\n return this.api.put<void>(`${this.baseURL}/v1/auth/attempts/${attemptUuid}`, {})\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 the patientUuid, saying that the refill has been completed successfully\n * @todo - Make service only exposed route\n * @param consult\n * @param patientUuid\n * @returns void\n */\n public sendRefillFaxSucceededEmail(consult: Consult, patientUuid: Uuid): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/refill-confirm-email`, { 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","AssistantType","TransmissionKind","TransmissionStatus","ConsultType","FeeStatus","MedicalStatus","TaskStatus","ClosedReasonType","VisibilityType","DrugType","PrescriptionStatus","PlanStatus","AxiosService","config","this","axios","create","_proto","prototype","apiRequest","_apiRequest","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","data","wrap","_context","prev","next","headers","abrupt","_extends","then","res","stop","_x","_x2","_x3","apply","arguments","apiRequestHeader","_apiRequestHeader","_callee2","headerToRetrieve","_context2","_res$headers$headerTo","toLowerCase","_x4","_x5","_x6","_x7","get","method","deleteRequest","post","put","patch","head","APIService","_AxiosService","useLocalStorage","tokenRefreshFailureCallback","_this","call","self","_assertThisInitialized","sessionId","uuidv4","interceptors","request","use","token","useRefreshToken","getTokens","refreshToken","accessToken","Authorization","X-Session-Id","X-Request-Id","error","Promise","reject","createAuthRefreshInterceptor","_ref","failedRequest","tokenResp","authRefreshFn","setTokens","sent","response","resolve","t0","console","statusCodes","_inheritsLoose","setAuthRefreshFn","fn","tokens","localStorage","setItem","JSON","stringify","item","getItem","parse","ApisPracticeManager","serviceCollReq","getAuthTokenCbk","Map","newPracticeInstance","init","undefined","practiceInstances","set","_get","practiceUuid","cacheKey","practiceInstance","apiService","authTokenFunc","_authTokenFunc","practiceUuidOrInstanceName","guardService","log","Error","WorkflowType","RateDimension","PlanType","PaymentStatus","PractitionerStatus","AssignmentStatus","PractitionnerRoleType","OtherRoleType","LicenseStatus","PeriodType","SyncStatus","PracticeEmailKind","PracticeConfigKind","StripePriceType","PaymentIntentRequestMetadataKind","IndexKey","DocumentType","InputApplyFunctions","MetadataCategory","IndexKind","AuthenticationFailed","_Error","_wrapNativeSuper","AuthenticationBadRequest","_Error2","AuthenticationServerError","_Error3","AuthenticationUnconfirmedEmail","_Error4","IdentityCreationFailed","_Error5","IdentityCreationBadRequest","_Error6","IdentityCreationConflict","_Error7","VaultDataMissing","_Error8","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","uuidPatient","FormData","append","Content-Type","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","getAssociatedConsultsOfTreatment","acceptTreatmentPlan","getAllDrugs","_getAllDrugs","foundDrugs","GuardService","authRefresh","bind","identityCache","whoAmICache","m2mToken","_m2mToken","req","resp","_e$response","code","skipAuthRefresh","isAxiosError","t1","authToken","_authToken","_e$response2","_authRefresh","_callee3","_context3","authLogout","_authLogout","_callee4","_context4","authRecover","_authRecover","_callee5","_context5","identityCreate","_identityCreate","_callee6","_e$response3","_context6","identityGet","_identityGet","_callee7","identityID","skipCache","_tokens$accessToken","_tokens$refreshToken","identity","_context7","whoAmI","_whoAmI","_callee8","refreshCache","_this$api$getTokens$a","_context8","_x8","identityUpdate","_identityUpdate","_callee9","_context9","_x9","_x10","identityMFAQRCode","_identityMFAQRCode","_callee10","password","_context10","Accept","_x11","_x12","identitySendConfirmEmail","_identitySendConfirmEmail","_callee11","_context11","_x13","authConfirmPhishingAttempts","_authConfirmPhishingAttempts","_callee12","attemptUuid","_context12","_x14","identityGetByCustomerEmail","_identityGetByCustomerEmail","_callee13","email","_context13","identityGetByHash","substring","indexOf","_x15","_identityGetByHash","_callee14","b64Hash","_context14","replace","_x16","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","_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","sendRefillFaxSucceededEmail","sendResumeConsultEmail","VaultService","lockboxCreate","_lockboxCreate","lockboxMetadata","lockboxMetadataAdd","_lockboxMetadataAdd","lockboxSecretGet","_lockboxSecretGet","lockboxGrant","_lockboxGrant","grantsGet","_grantsGet","lockboxDataGet","_lockboxDataGet","dataUuid","stream","_x17","lockboxManifestGet","_lockboxManifestGet","filter","_x18","_x19","_x20","lockboxMetadataGet","_lockboxMetadataGet","fields","groupby","_x21","_x22","_x23","_x24","_x25","vaultIndexPut","_vaultIndexPut","entries","indexOwnerUuid","index_owner_uuid","_x26","_x27","vaultIndexSnapshotPut","_vaultIndexSnapshotPut","entry","_x28","vaultIndexGet","_vaultIndexGet","indexKeys","identifiers","timestamp","index_keys","_x29","_x30","_x31","WorkflowService","v1Url","getWorkflows","getWorkflow","id","createdAt","services","authenticationCallback","tellerBaseURL","practiceBaseURL","consultBaseURL","vaultBaseURL","guardBaseURL","searchBaseURL","workflowBaseURL","diagnosisBaseURL","tellerService","practiceService","consultService","vaultService","searchService","workflowService","diagnosisService"],"mappings":"4QAQgBA,EAAmBC,GAC/B,OAAOC,SAAOC,KAAKC,WAASC,OAAOJ,GAAOK,OAAO,OAAQ,OAAOC,SAAS,mvQCTjEC,EAiBAC,EAUAC,EA8BAC,EAKAC,EASAC,EAcAC,EAQAC,EC7FAC,EAuDAC,EA4BAC,EAqBAC,ECpGCC,aAGT,SAAAA,EACIC,GAEKA,IAAQA,EAAS,IAEtBC,KAAKC,MAAQA,EAAMC,OAAOH,GAC7B,IAAAI,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