oro-sdk-apis 3.7.1 → 3.8.0-dev1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"oro-sdk-apis.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 New = 'New',\n ToAnswer = 'ToAnswer',\n Answered = 'Answered',\n Closed = 'Closed',\n Reopened = 'Reopened',\n Archived = 'Archived',\n Failed = 'Failed',\n}\n\nexport enum TaskStatus {\n None = 'None',\n ToDo = 'ToDo',\n InProgress = 'InProgress',\n Blocked = 'Blocked',\n Done = 'Done',\n}\n\nexport enum ClosedReasonType {\n /**\n * A completed consultation\n */\n Completed = 'Completed',\n /**\n * The conclusion was that what the patient submitted was not a disease\n */\n NotADisease = 'NotADisease',\n /**\n * The consultation was not appropriate for virtual\n */\n NotAppropriateForVirtual = 'NotAppropriateForVirtual',\n /**\n * Any other reason why the consultation was closed\n */\n Other = 'Other',\n /**\n * A consultation that is required to be done in person\n */\n RequiresInPerson = 'RequiresInPerson',\n}\n\nexport interface ClosedConsultReasonInsertFields {\n /**\n * The uuid of the consultation\n */\n consult_uuid: string\n /**\n * The reason why the consultation was closed\n */\n closed_reason_type: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closed_reason_description: string\n /**\n * When the consultation was closed\n */\n created_at: string\n}\n\nexport interface ConsultClosedReason {\n /**\n * The reason why the consultation was closed\n */\n closedReasonType: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closedReasonDescription?: string\n}\n\nexport interface ConsultRequest {\n uuidPractice: string\n consultType?: ConsultType\n tagSpecialtyRequired: string\n idStripeInvoiceOrPaymentIntent: string\n isoLocalityRequired?: string\n isoLanguageRequired: string\n uuidParent?: string\n}\nexport interface Consult {\n uuid: string\n uuidPracticeAdmin: string\n uuidPractice: string\n tagSpecialtyRequired: string\n isoLanguageRequired: string\n idPracticePayment: number\n statusFee?: FeeStatus\n isoLocalityRequired: string\n statusMedical?: MedicalStatus\n consultType: ConsultType\n uuidAssignedDoctor: string\n uuidCurrentAssigned: string\n uuidParent?: string\n statusTask?: TaskStatus\n hasTransmissions?: boolean\n assignedAssistant?: ConsultAssignedAssistant[]\n closeConsultReason?: ConsultClosedReason\n shortId?: string\n createdAt?: string\n expiresAt?: string\n}\n","export enum VisibilityType {\n Generic = 'Generic',\n Private = 'Private',\n Instance = 'Instance',\n}\n\nexport type DiagnosisType = VisibilityType\n\nexport type TreatmentType = VisibilityType\n\nexport interface DiagnosisRequest {\n uuid?: string\n name: string\n description: string\n type: DiagnosisType\n parentUuid?: string\n language: string\n tags?: string[]\n urlMultimedia?: string\n}\n\nexport interface Diagnosis extends DiagnosisRequest {\n uuid: string\n uuidPractice: string\n uuidPractitioner?: string\n createdAt: string\n}\n\nexport interface TreatmentRequest {\n uuid?: string\n uuidDiagnosis?: string\n uuidParentTreatment?: string\n name: string\n description: string\n refillable?: boolean\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}\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 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 notes?: string\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 notes?: string\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> { }","import type { AxiosRequestConfig } from 'axios'\nimport axios, { AxiosInstance } from 'axios'\n\n\nexport class AxiosService {\n protected axios: AxiosInstance\n\n constructor(\n config?: AxiosRequestConfig\n ) {\n if (!config) config = {}\n\n this.axios = axios.create(config)\n }\n\n protected async apiRequest(config: AxiosRequestConfig, url: string, data?: any) {\n if (!config.headers) config.headers = {}\n\n config.headers['Content-Type'] = 'application/json'\n\n return this.axios({\n ...config,\n url,\n data: data,\n }).then((res) => {\n return res.data\n })\n }\n\n protected async apiRequestHeader(config: AxiosRequestConfig, url: string, headerToRetrieve?: string, data?: any,) {\n if (!config.headers) config.headers = {}\n\n config.headers['Content-Type'] = 'application/json'\n\n return this.axios({\n ...config,\n url,\n data: data,\n }).then((res) => {\n if (headerToRetrieve) {\n return res.headers[headerToRetrieve] ?? res.headers[headerToRetrieve.toLowerCase()]\n }\n\n return res.headers\n })\n }\n\n public get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T> {\n return this.apiRequest({ ...config, method: 'get' }, url)\n }\n\n public deleteRequest<T = any>(\n url: string,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'delete' }, url)\n }\n\n public post<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'post' }, url, data)\n }\n\n public put<T = any>(\n url: string,\n data: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'put' }, url, data)\n }\n\n public patch<T = any>(\n url: string,\n data: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'patch' }, url, data)\n }\n\n public head<T = any>(\n url: string,\n config?: AxiosRequestConfig,\n headerToRetrieve?: string,\n data?: any\n ): Promise<T> {\n return this.apiRequestHeader({ ...config, method: 'head' }, url, headerToRetrieve, data)\n }\n}\n","import type { AxiosRequestConfig } from 'axios'\nimport createAuthRefreshInterceptor from 'axios-auth-refresh'\nimport { AuthRefreshFunc, Tokens } from '../models'\nimport { AxiosService } from './axios'\nimport { GuardRequestConfig } from './guard'\n\nexport class APIService extends AxiosService {\n private authRefreshFn?: AuthRefreshFunc\n private tokens: Tokens = {}\n\n /**\n * The API Service lets you use an axios API and handles oro backend services authentification via JWT tokens\n * @param useLocalStorage if set to true, tokens will be stored in localStorage\n * @param config (optional) an axios config\n * @param tokenRefreshFailureCallback (optional) callback to call when failing to refresh the auth token\n */\n constructor(\n private useLocalStorage: boolean,\n config?: AxiosRequestConfig,\n private tokenRefreshFailureCallback?: (err: Error) => void\n ) {\n super(config)\n const self = this\n\n this.axios.interceptors.request.use(\n (config) => {\n const token = (config as GuardRequestConfig).useRefreshToken\n ? self.getTokens().refreshToken\n : self.getTokens().accessToken\n\n config.headers = {\n ...config.headers,\n Authorization: `Bearer ${token}`,\n }\n return config\n },\n (error) => {\n Promise.reject(error)\n }\n )\n\n createAuthRefreshInterceptor(\n this.axios,\n async function (failedRequest) {\n if (self.authRefreshFn) {\n try {\n let tokenResp = await self.authRefreshFn(self.getTokens().refreshToken)\n self.setTokens({\n accessToken: tokenResp.accessToken,\n refreshToken: tokenResp.refreshToken,\n })\n failedRequest.response.config.headers['Authorization'] = `Bearer ${\n self.getTokens().accessToken\n }`\n return Promise.resolve()\n } catch (e) {\n console.error('an error occured while refreshing tokens (notifying callback)', e)\n if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest)\n return Promise.resolve() // We keep it like that. Otherwise, it seems to break the api service will it is not needed\n // return Promise.reject(e)\n }\n }\n console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest)\n return Promise.resolve() // We keep it like that. Otherwise, it seems to break the api service will it is not needed\n // return Promise.reject(failedRequest)\n },\n { statusCodes: [401, 403] }\n )\n }\n\n public setAuthRefreshFn(fn: AuthRefreshFunc) {\n this.authRefreshFn = fn\n }\n\n public setTokens(tokens: Tokens) {\n if (this.useLocalStorage) {\n localStorage.setItem('tokens', JSON.stringify(tokens))\n }\n this.tokens = tokens\n }\n\n public getTokens(): Tokens {\n if (this.useLocalStorage) {\n let tokens: Tokens = {}\n const item = localStorage.getItem('tokens')\n if (item) {\n tokens = JSON.parse(item)\n }\n return tokens\n } else {\n return this.tokens\n }\n }\n}\n","import { init } from '../helpers'\nimport { AuthTokenResponse, ServiceCollection, ServiceCollectionRequest } from '../models'\nimport { GuardService } from './guard'\n\n/**\n * This service enables you to handle one authentication token per practice\n */\nexport class ApisPracticeManager {\n private practiceInstances = new Map<string, ServiceCollection>()\n\n /**\n * The constructor\n * @param serviceCollReq the services to initialize. Only filled urls will get corresponding service to be initialized.\n * It will be used each time a new practices needs a `ServiceCollection`\n * @param getAuthTokenCbk the callback function used to get a new JWT token\n * @param useLocalStorage (default: false) if true store tokens into local storage (only for browsers)\n */\n constructor(\n private serviceCollReq: ServiceCollectionRequest,\n private getAuthTokenCbk: (guard: GuardService, practiceUuid?: string) => Promise<AuthTokenResponse>,\n private useLocalStorage = false\n ) {}\n\n /**\n * This function is used to get a `ServiceCollection` associated to a practice. If missing, it will initialize a new `ServiceCollection`.\n * @param practiceUuid the uuid of the practice\n * @returns a promise holding a `ServiceCollection`\n */\n public async get(practiceUuid?: string): Promise<ServiceCollection> {\n const cacheKey = practiceUuid ?? 'none'\n const practiceInstance = this.practiceInstances.get(cacheKey)\n if (practiceInstance) return practiceInstance\n\n const newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage)\n\n // Create one auth token callback per practice since the practice uuid needs to change\n const authTokenFunc = async () => {\n if (newPracticeInstance.guardService) {\n console.log(`\\x1b[36m[Auth] Refresh auth called (practiceUuid: ${practiceUuid})\\x1b[36m`)\n return await this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid)\n } else {\n throw Error('[Auth] Unable to refresh token guard service is undefined')\n }\n }\n\n // Initialize the M2M token\n await authTokenFunc()\n\n // Set the refresh tokens callback\n newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc)\n\n this.practiceInstances.set(cacheKey, newPracticeInstance)\n\n return newPracticeInstance\n }\n}\n","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}\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}\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\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\nexport interface PracticeWorkflow {\n id?: number ///optional for insertion\n uuidPractice: string\n uuidWorkflow: string\n typeWorkflow: WorkflowType\n tagSpecialty?: string\n}\n\nexport type PracticeWorkflowWithTagSpecialty = PracticeWorkflow & {\n tagSpecialty: string\n}\n\nexport interface PracticePlan {\n id?: number ///optional for insertion\n uuidPractice: string\n isoLocality?: string\n nameDefault: string\n descDefault: string\n hoursExpiration: number\n active: boolean\n namePriceCurrency: string // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceAmount: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceExtDecimal?: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceExtNegativeExponential?: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n kind: PlanType\n idStripeProduct: string\n idStripePrice: string // DEPRECATED: left only for in-app receipt display and lower migration risks\n dateCreatedAt: Date\n dateUpdateAt: Date\n ratePerThousandOverride: number // DEPRECATED: left only to lower migration risks\n}\n\nexport enum StripePriceType {\n Default = 'Default',\n Discount = 'Discount',\n}\n\n// Subset of Stripe.Price\nexport interface PracticePrice {\n /**\n * Unique identifier for the object in Stripe.\n */\n idStripePrice: string\n /**\n * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).\n */\n currency: string\n /**\n * The unit amount in %s to be charged, represented as a whole integer if possible.\n */\n unitAmount: number\n}\n\nexport interface PracticePlanPrices {\n idPlan: number\n default: PracticePrice\n discount?: PracticePrice\n}\n\nexport interface PracticeRate {\n id?: number\n uuidPractice: string\n idPlan: number\n isoLocality?: string\n dimension: RateDimension\n description: string\n uidTaxRate: string\n idStripeTaxRate: string\n}\n\nexport interface PracticePlatformFee {\n uuidPractice: string\n idPlan: number\n isoLocality?: string\n numPlatformFinalFee: number\n}\n\nexport interface PracticePayment {\n id?: number ///optional for insertion\n uuidPractice: string\n idPlan: number\n uuidConsult?: string\n hoursConsultExpiration: number\n idStripeInvoiceOrPaymentIntent: string\n status: PaymentStatus\n dateCreatedAt: Date\n dateUpdateAt: Date\n}\n\nexport interface PracticePaymentIntent {\n id?: number ///optional for insertion\n uuidPractice: string\n idPlan: number\n idPayment: number\n hoursPlanExpiration: number\n isoLocality?: string\n textPaymentMethodOptions: string\n nameCurrency: string\n numTotalAmount: number\n numPlatformFeeAmount: number\n idStripeInvoice: string\n idStripePaymtIntent: string\n /**\n * This value is set only after the PracticePaymentIntent has been finalized and ready to be paid\n */\n stripeClientSecret?: string\n dateCreatedAt?: Date\n dateUpdateAt?: Date\n}\n\n/**\n * All the PaymentIntentRequestMetadata Kind available\n */\nexport enum PaymentIntentRequestMetadataKind {\n ConsultRequestMetadata = 'ConsultRequestMetadata',\n RefillTreatmentRequestMetadata = 'RefillTreatmentRequestMetadata',\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to create the consult when stripe use our hook.\n */\nexport interface ConsultRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n *\n * Note: it can be `undefined` to handle backward compatibility when this interface didn't had a `kind`\n */\n kind: PaymentIntentRequestMetadataKind.ConsultRequestMetadata | undefined\n /**\n * The specialty required by the consultation\n */\n tagSpecialtyRequired: string\n /**\n * The locality required for the consultation in iso. COUNTRY (ISO 3166) - PROVINCE - COUNTY - CITY\n */\n isoLocalityRequired?: string\n /**\n * The language required for the consultation. Should respect ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes\n */\n isoLanguageRequired: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to refill a treatment plan of a consult.\n */\nexport interface RefillTreatmentRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n */\n kind: PaymentIntentRequestMetadataKind.RefillTreatmentRequestMetadata\n /**\n * The consult uuid to refill\n */\n consultUuid: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used when stripe uses our hook.\n */\nexport type PaymentIntentRequestMetadata = ConsultRequestMetadata | RefillTreatmentRequestMetadata\n\nexport interface AssignmentRequest {\n uuidAssignor: string //defaulting for insertion to the default practice admin\n uuidPractitioner?: string\n status?: AssignmentStatus\n uuidConsult?: string\n tagSpecialty?: string\n isoLocality?: string\n isoLanguage?: string\n}\n\nexport type Assignment = {\n id: number ///optional for insertion\n uuidPractice: string\n uuidAssignor: string //defaulting for insertion to the default practice admin\n uuidPractitioner?: string\n status?: AssignmentStatus\n uuidConsult?: string\n tagSpecialty?: string\n timeAssigned?: string //defaulting for insertion\n}\n\nexport interface PractitionerRole {\n id?: number //optional for insertion\n uuidPractice: string\n uuidPractitioner: string\n role: PractitionnerRoleType\n dateGiven?: Date //default during insertion\n}\n\nexport interface PractitionerLicense {\n id?: number ///optional for insertion\n uuidPractitioner: string\n country: string\n tagSpecialty: string\n isoLocality: string\n txtLicenseNumber: string\n txtComplementary?: string\n dateProvidedAt?: Date\n dateObtainedAt?: Date\n dateRenewedAt?: Date\n status?: LicenseStatus\n}\n\nexport interface PractitionerPreference {\n id?: number\n uuidPractitioner: string\n uuidPractice: string\n tagSpecialties: string\n isoLocalityConsult?: string\n periodQuotaConsult?: PeriodType\n quantityQuotaConsult?: number\n tagConsultLanguages?: string\n}\n\nexport interface PractitionerQuota {\n id?: number ///optional for insertion\n uuidPractitioner: string\n uuidPractice: string\n tagSpecialty: string\n isoLocality: string\n quantityLeft?: number\n dateRenewal?: Date\n dateLastUpdate?: Date\n}\n\nexport interface Practitioner {\n uuid: string\n uuidPractice: string\n txtFirstName: string\n txtLastName: string\n txtTitle: string\n emailAddress: string\n tagsSpecialties: string\n arrLanguages: string\n dateAddedAt?: Date //defaulting for insertion\n status?: PractitionerStatus //defaulting for insertion\n txtAddressTransmission?: string //the default non-fax address to send prescription to\n}\n\nexport interface HydratedPracticeConfigs {\n [PracticeConfigKind.PatientConsultCard]?: PracticeConfigPatientConsultCard\n [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes\n [PracticeConfigKind.PracticeConsultTabs]?: PracticeConfigPracticeConsultTabs\n [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample\n [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner\n [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables\n [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks\n [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher\n [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy\n [PracticeConfigKind.PracticePrescriptionFields]?: PracticeConfigPracticePrescriptionFields\n [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox\n [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList\n [PracticeConfigKind.PractitionerSearch]?: PracticeConfigPractitionerSearch\n [PracticeConfigKind.PracticeRegisterWalkthrough]?: PracticeConfigPracticeRegisterWalkthrough\n [PracticeConfigKind.PracticeExamsAndResults]?: PracticeConfigPracticeExamsAndResults\n [PracticeConfigKind.PracticeLayout]?: PracticeConfigPracticeLayout\n [PracticeConfigKind.PracticeAddressField]?: PracticeConfigPracticeAddressField\n [PracticeConfigKind.PracticeDiagnosisAndTreatment]?: PracticeConfigPracticeDiagnosisAndTreatment\n}\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 NoSpaces = 'NoSpaces',\n}\n\nexport interface EntryData {\n id?: number\n label?: string\n inputApply?: InputApplyFunctions | InputApplyFunctions[]\n hideLabel?: boolean\n minorLabel?: string\n summaryLabel?: string\n summaryHidden?: boolean\n className?: string\n /**\n * This field represents a list of `selectedAnswers` that must be set for this entry to be displayed using the followng logical combination of rules:\n *\n * #### Single string\n *\n * ```\n * // Required: rule1\n * rules: rule1\n * ```\n *\n * #### Array of strings (AND is applied between statements):\n *\n * ```\n * // Required: rule1 AND rule2\n * rules: [ rule1, rule2 ]\n * ```\n *\n * #### Array of arrays of strings (OR is applied between inner arrays. AND is applied between inner arrays statements)\n *\n * ```\n * // Required: rule1 OR rule2\n * rules: [\n * [ rule1 ],\n * [ rule2 ]\n * ]\n *\n * // Required: rule1 OR (rule2 AND rule3)\n * rules: [\n * [ rule1 ],\n * [ rule2, rule3 ]\n * ]\n *\n * // THIS IS FORBIDDEN\n * rules: [\n * rule1, // <-- THIS IS FORBIDDEN. Instead use [ rule1 ]\n * [ rule2, rule3 ]\n * ]\n * ```\n */\n triggers?: string[][] | string[] | string\n /**\n * This field represents a list of `StateTrigger` that must be fulfilled for this entry to be displayed.\n */\n stateTriggers?: StateTrigger[]\n // represents the modal that it will be rendered as\n componentKind?: string\n message?: string\n}\n\nexport interface SlideData {\n header: string\n body: string\n image?: {\n src: string\n alt: string\n }\n icon?: string\n}\n\nexport enum MetadataCategory { //these are generic metadata categories\n ChildPersonal = 'ChildPersonal',\n Consultation = 'Consultation',\n Refill = 'Refill',\n DataRetrieval = 'DataRetrieval',\n Followup = 'Followup',\n Recovery = 'Recovery',\n Medical = 'Medical',\n OtherPersonal = 'OtherPersonal',\n Personal = 'Personal',\n Preference = 'Preference',\n Prescription = 'Prescription',\n Raw = 'Raw',\n}\n\n/**\n * This interface describes all images-alias question kind options\n */\nexport interface ImagesAliasQuestionOptions {\n /**\n * Comma separated list of accepted formats. Will be given to the input html element.\n * Use same format as described [here](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#accept)\n */\n accept?: string\n /**\n * Should allow multiple uploads or not\n */\n multiple?: boolean\n /**\n * Should display photo guide instructions or not\n */\n photoGuide?: boolean\n}\n\nexport interface GenericQuestionData<T, A = IndexedData<ChoiceInputData>, O = undefined> extends EntryData {\n kind: T\n metaCategory: MetadataCategory\n answers?: A\n formValidation?: any[] // use yup-ast expressions\n placeholder?: string\n defaultValue?: any\n value?: string\n /**\n * Options to forward to the workflow component\n */\n options?: O\n messages?: string\n}\n\nexport interface GroupedGenericQuestionData<T, A = IndexedData<ChoiceInputData>> extends GenericQuestionData<T, A> {\n inline?: boolean\n inlineLabel?: boolean\n order?: number\n}\n\nexport declare type QuestionData =\n | GenericQuestionData<'title' | 'paragraph' | 'checkbox', void>\n | GenericQuestionData<\n | 'text'\n | 'text-area'\n | 'date'\n | 'number'\n | 'images'\n | 'body-parts'\n | 'pharmacy-picker'\n | 'online-pharmacy-picker'\n | 'place-address'\n >\n | GenericQuestionData<'images-alias', IndexedData<ChoiceInputData>, ImagesAliasQuestionOptions>\n | GenericQuestionData<\n 'checkbox-group' | 'hair-loss-frontal' | 'select' | 'multiple' | 'text-select-group',\n IndexedData<ChoiceInputData>\n >\n | GroupedGenericQuestionData<\n 'radio' | 'hair-selector-women' | 'hair-selector-men' | 'hair-loss-stage' | 'hair-loss-other',\n IndexedData<RadioInputData>\n >\n | GroupedGenericQuestionData<'radio-card' | 'profile-selector', IndexedData<RadioCardInputData>>\n | GroupedGenericQuestionData<'language-picker', IndexedData<LanguagePickerData>>\n | GroupedGenericQuestionData<'tile-radio', IndexedData<TileRadioData>>\n\nexport interface FieldData {\n type: 'field'\n className?: string\n id: string\n}\n\nexport interface FieldGroupData {\n type: 'field-group'\n className?: string\n fieldsAndGroups: (FieldData | FieldGroupData)[]\n name?: string\n inline?: boolean\n fullWidth?: boolean\n}\n\nexport interface WorkflowPageData {\n className?: string\n groups?: FieldGroupData[]\n highlightMsg?: string\n questions: IndexedData<QuestionData>\n title?: string\n triggers?: string[]\n /**\n * This field represents a list of `ids` which will be spliced from the workflow groups and inserted into a designated location\n */\n prioritizeIds?: string[]\n}\n\nexport interface WorkflowData {\n createdAt: string\n culDeSacs: EntryData[]\n id: string\n locale?: string\n pages: WorkflowPageData[]\n summaryImageFieldName?: string // this field is used to show the consult summary image\n summarySymptomsFieldName?: string // this field is used to show the consult summary symptoms\n selectedAnswers?: SelectedAnswersData\n walkthroughSlides?: SlideData[]\n /**\n * (optional) the service name this workflow provides\n */\n serviceName?: string\n /**\n * (optional) the description of the service this workflow provides\n */\n serviceDescription?: string\n /**\n * (optional) rules to hide certain payment plans depending on the workflow answers\n */\n hidePlanRules?: HidePlanRule[]\n}\n\nexport interface HidePlanRule {\n /**\n * the stripe plan id from the practice service\n */\n idPlan: string\n /**\n * Questions to apply yup rules on in, if rules are met then hide the plan\n */\n rules: QuestionHidePlanRule[] | QuestionHidePlanRule[][]\n}\n\nexport interface QuestionHidePlanRule {\n /**\n * the id of the question to check the rule on\n */\n questionId: string\n /**\n * a collection of yup validated rules (same exact syntax we used for the workflow formValidation field, please reuse same functions)\n */\n yupRuleValueToHide: any\n}\n\n/**\n * This interface describes an upload of an image (could be a picture, a pdf, a text file, etc.)\n */\nexport interface WorkflowUploadedImage {\n /**\n * Depending on the driver used by WorkflowInput:\n * - 'indexdb': will fetch the image in IndexDB with this id\n * - 'vault': will fetch the image in the vault with this id\n */\n idbId?: string\n /**\n * The name of the image\n */\n name: string\n /**\n * the image data (could be a picture, a pdf, a text file, etc.)\n */\n imageData?: string\n}\n\n/**\n * This interface describes a workflow prepared and ready to be sent to vault\n */\nexport interface PopulatedWorkflowField {\n answer: SelectedAnswerData | WorkflowUploadedImage[] // Actual answer from the workflow\n displayedAnswer?: any // This answer is to be used only when it's impossible to get data from workflow\n kind: string // If we don't store question. We will need that field to at least know the field type\n}\n\nexport interface PopulatedWorkflowData {\n workflowId: string // The workflow id to refer\n workflowCreatedAt: string // The workflow version\n locale?: string\n fields: Record<string, PopulatedWorkflowField> // key corresponds to the QuestionData key in the workflow\n}\n","export interface SearchRequest {\n terms: Terms\n}\n\nexport interface SearchResponse {\n results: SearchResult[]\n}\n\nexport interface SearchResult {\n consultUuid: string\n kind: string\n score: number\n}\n\nexport interface IndexRequest {\n consultUUID: string\n terms: Terms\n}\n\nexport type Terms = Term[]\nexport interface Term {\n kind?: string\n value: string\n}\n\n\nexport enum IndexKind {\n consultUuid,\n consultShortid,\n firstName,\n lastName,\n healthId,\n dob,\n}\n","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 updateConsultByUUID(\n uuidConsult: Uuid,\n consult: {\n statusMedical?: MedicalStatus\n closedReasonType?: ClosedReasonType\n closedReasonDescription?: string\n uuidAssignedDoctor?: Uuid\n neverExpires?: boolean\n },\n uuidPractice?: Uuid,\n uuidRequester?: Uuid\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, consult, {\n params: {\n uuidPractice,\n uuidRequester,\n },\n })\n }\n\n public getConsultFaxStatuses(uuidConsult: string): Promise<ConsultTransmission[]> {\n return this.api.get<ConsultTransmission[]>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, {\n params: {\n kind: TransmissionKind.Fax,\n },\n })\n }\n\n public postConsultTransmission(\n uuidConsult: string,\n nameDriver: string = 'Documo',\n addressOrPhoneToSendTo?: string,\n file?: File,\n nameReceiver?: string,\n txtTransmissionTitle?: string,\n txtTransmissionNotes?: string\n // numTry ?: number,\n // delay ?: number,\n ): Promise<ConsultTransmission> {\n let data = new FormData()\n\n data.append('nameDriverReceiver', nameDriver)\n if (addressOrPhoneToSendTo) {\n data.append('addressReceiver', addressOrPhoneToSendTo)\n }\n if (file) {\n data.append('file', file)\n }\n if (nameReceiver) {\n data.append('nameReceiver', nameReceiver)\n }\n if (txtTransmissionTitle) {\n data.append('txtTransmissionTitle', txtTransmissionTitle)\n }\n if (txtTransmissionNotes) {\n data.append('txtTransmissionNotes', txtTransmissionNotes)\n }\n\n return this.api.post<ConsultTransmission>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, data, {\n headers: { 'Content-Type': 'multipart/form-data;' },\n })\n }\n\n public postConsultFax(uuidConsult: string, addressReceiver: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file)\n }\n\n public postConsultEmail(uuidConsult: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file)\n }\n\n public retryConsultFax(uuidConsult: string, transmissionId: string): Promise<ConsultTransmission> {\n return this.api.put<ConsultTransmission>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions/${transmissionId}`,\n { status: TransmissionStatus.Retrying }\n )\n }\n\n public updateConsultTransmissionStatus(\n transmissionId: string,\n uuidConsult: string,\n newStatus: TransmissionStatus\n ): Promise<ConsultTransmission> {\n return this.api.put<ConsultTransmission>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions/${transmissionId}`,\n { status: newStatus }\n )\n }\n}\n","import {\n Drug,\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 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 acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}/accept`, { uuidConsult })\n }\n\n /**\n * retrieves all the drugs of the specified practice\n * @param uuidPractice\n */\n public async getAllDrugs(uuidPractice: string): Promise<Drug[] | undefined> {\n const res = await this.api.get<{ foundDrugs: Drug[] }>(`${this.baseURL}/v1/drugs/practice/${uuidPractice}`)\n if (res && res.foundDrugs) return res.foundDrugs\n return undefined\n }\n}\n","import { AxiosError } from 'axios'\nimport type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh'\nimport {\n AuthenticationBadRequest,\n AuthenticationFailed,\n AuthenticationServerError,\n AuthenticationUnconfirmedEmail,\n AuthRecoverRequest,\n AuthTokenRequest,\n AuthTokenResponse,\n Base64String,\n IdentityCreateRequest,\n IdentityCreationBadRequest,\n IdentityCreationConflict,\n IdentityCreationFailed,\n IdentityResendConfirmEmailRequest,\n IdentityResponse,\n IdentityUpdateRequest,\n M2MTokenRequest,\n QRCodeRequest,\n QRCodeResponse,\n Tokens,\n Uuid,\n WhoAmIResponse,\n} from '../models'\nimport { APIService } from './api'\n\nexport interface GuardRequestConfig extends AxiosAuthRefreshRequestConfig {\n useRefreshToken: boolean\n}\nexport class GuardService {\n private identityCache: Record<string, IdentityResponse>\n private whoAmICache: Record<string, WhoAmIResponse>\n\n constructor(private api: APIService, private baseURL: string) {\n this.api.setAuthRefreshFn(this.authRefresh.bind(this)) // This is the default behavior for User JWT tokens. If you want other kind of refresh you shall overwrite this call\n this.identityCache = {}\n this.whoAmICache = {}\n }\n\n /**\n * Will replace access and refresh tokens with `tokens`\n *\n * Note:\n * ```typescript\n * setTokens({accessToken: undefined, refreshToken: 'aTokenValue'}) // will erase accessToken and set refreshToken with 'aTokenValue'\n * setTokens({refreshToken: 'aTokenValue'}) // will keep actual value of accessToken and set refreshToken with 'aTokenValue'\n *\n * ```\n * @param tokens\n */\n public setTokens(tokens: Tokens) {\n this.api.setTokens({ ...this.api.getTokens(), ...tokens })\n }\n\n /**\n * Allow to retrieve a M2M token for a service\n *\n * @param req The credentials required to get an access token\n * @returns AuthTokenResponse\n */\n public async m2mToken(req: M2MTokenRequest): Promise<AuthTokenResponse> {\n let resp: AuthTokenResponse | undefined\n\n try {\n let config: AxiosAuthRefreshRequestConfig = {\n skipAuthRefresh: true,\n }\n\n resp = await this.api.post<AuthTokenResponse>(`${this.baseURL}/v1/m2m/token`, req, config)\n\n this.api.setTokens({\n accessToken: resp.accessToken,\n })\n } catch (e) {\n console.error('Error while posting m2m token:', e)\n\n if ((e as any).isAxiosError) {\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new AuthenticationBadRequest()\n case 500:\n throw new AuthenticationServerError()\n case 401:\n default:\n throw new AuthenticationFailed()\n }\n }\n throw new AuthenticationFailed()\n }\n\n return resp\n }\n\n /**\n * Allow to retrieve an access token and a refresh token in order\n * to do authenticated request afterward\n *\n * @param req The credentials required to get an access token\n * @returns AuthTokenResponse\n */\n public async authToken(req: AuthTokenRequest): Promise<AuthTokenResponse> {\n let resp: AuthTokenResponse\n\n try {\n let config: AxiosAuthRefreshRequestConfig = {\n skipAuthRefresh: true,\n }\n\n resp = await this.api.post<AuthTokenResponse>(`${this.baseURL}/v1/auth/token`, req, config)\n\n this.api.setTokens({\n accessToken: resp.accessToken,\n refreshToken: resp.refreshToken,\n })\n } catch (e) {\n console.error('Error while posting auth token:', e)\n\n if ((e as any).isAxiosError) {\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new AuthenticationBadRequest()\n case 424:\n throw new AuthenticationUnconfirmedEmail()\n case 500:\n throw new AuthenticationServerError()\n case 401:\n default:\n throw new AuthenticationFailed()\n }\n }\n throw new AuthenticationFailed()\n }\n return resp\n }\n\n /**\n * Get new access and refresh token\n *\n * @returns AuthTokenResponse\n */\n public async authRefresh(refreshToken?: string): Promise<AuthTokenResponse> {\n let config: GuardRequestConfig = {\n skipAuthRefresh: true,\n useRefreshToken: true,\n }\n return this.api.put<AuthTokenResponse>(`${this.baseURL}/v1/auth/token`, null, config)\n }\n\n /**\n * Call guard to overwrite existing refresh token cookie\n *\n * @returns void\n */\n public async authLogout(): Promise<void> {\n return this.api.get<void>(`${this.baseURL}/v1/auth/logout`)\n }\n\n /**\n * Call guard to attempt account recovery\n *\n * @param req The email address / practice of the account to recover\n * @returns void\n */\n public async authRecover(req: AuthRecoverRequest): Promise<void> {\n return this.api.post<void>(`${this.baseURL}/v1/auth/recover`, req)\n }\n\n /**\n * Allow to create a new identity. The identity will then need to be confirmed\n * via an email link\n *\n * @param req the information about the new identity to create\n * @returns IdentityResponse\n */\n public async identityCreate(req: IdentityCreateRequest): Promise<IdentityResponse> {\n let resp: IdentityResponse\n\n try {\n resp = await this.api.post<IdentityResponse>(`${this.baseURL}/v1/identities`, req)\n this.api.setTokens({\n refreshToken: resp.refreshToken,\n })\n } catch (e) {\n if ((e as any).isAxiosError) {\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new IdentityCreationBadRequest()\n case 409:\n throw new IdentityCreationConflict()\n case 500:\n default:\n throw new IdentityCreationFailed()\n }\n }\n throw new IdentityCreationFailed()\n }\n return resp\n }\n\n /**\n * Retrieve an identity. Will return public fields only when requested\n * without authentication\n *\n * @param identityID Unique id of the identity to retrieve\n * @param skipCache (default: false) will skip identity cache (not even update it)\n * @returns IdentityResponse\n */\n public async identityGet(identityID: Uuid, skipCache = false): Promise<IdentityResponse> {\n const tokens = this.api.getTokens()\n const cacheKey = (tokens.accessToken ?? '') + (tokens.refreshToken ?? '') + identityID\n\n if (skipCache || !tokens.accessToken || !this.identityCache[cacheKey]) {\n const identity = await this.api.get<IdentityResponse>(`${this.baseURL}/v1/identities/${identityID}`)\n\n if (skipCache) return identity\n\n this.identityCache[cacheKey] = identity\n }\n return this.identityCache[cacheKey]\n }\n\n /**\n * Get information about the current authenticated user\n *\n * @param refreshCache if true it will refresh the whoAmI cache (default: false)\n * @returns WhoAmIResponse\n */\n public async whoAmI(refreshCache: boolean = false): Promise<WhoAmIResponse> {\n const cacheKey = this.api.getTokens().accessToken ?? ''\n if (!this.whoAmICache[cacheKey] || refreshCache) {\n this.whoAmICache[cacheKey] = await this.api.get<WhoAmIResponse>(`${this.baseURL}/v1/auth/whoami`)\n }\n return this.whoAmICache[cacheKey]\n }\n\n /**\n * Update an existing identity\n *\n * @param identityID unique id of identity to update\n * @param req update request\n * @returns IdentityResponse\n */\n public async identityUpdate(identityID: Uuid, req: IdentityUpdateRequest): Promise<IdentityResponse> {\n return this.api.put<IdentityResponse>(`${this.baseURL}/v1/identities/${identityID}`, req)\n }\n\n /**\n * Return base64 data representing a QR code that the\n * current identity need in order to use MFA\n *\n * @param identityID unique id of the identity\n * @param password the identity password (already hashed and in base64)\n * @returns QRCodeResponse\n */\n public async identityMFAQRCode(identityID: Uuid, password: Base64String): Promise<QRCodeResponse> {\n const req: QRCodeRequest = { password }\n return this.api.post<QRCodeResponse>(`${this.baseURL}/v1/identities/${identityID}/mfa`, req, {\n headers: { Accept: 'application/json' },\n })\n }\n\n /**\n * Attempt to resend the email confirmation email\n *\n * @param req IdentityResendConfirmEmailRequest\n * @return void\n */\n public async identitySendConfirmEmail(req: IdentityResendConfirmEmailRequest): Promise<void> {\n return this.api.post<void>(`${this.baseURL}/v1/identity/confirm`, req)\n }\n\n /**\n * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)\n *\n * @param email the customer email\n * @returns IdentityResponse\n */\n public async identityGetByCustomerEmail(email: string): Promise<IdentityResponse> {\n return this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@')))\n }\n\n /**\n * Get an identity using a base64 hash\n *\n * @param b64Hash base64 hash of the identity\n * @returns IdentityResponse\n */\n public async identityGetByHash(b64Hash: string): Promise<IdentityResponse> {\n //TODO: Right now this maps directly to the IdentityGet call.\n //Eventually, with the mapping table method, this would lead to another\n //call (ie: /v1/mapping/[b64Hash]) which would return a blob to decrypt\n //which would contain the real identityID to call IdentityGet with.\n\n //The hash comes in base64 format but it isn't URL safe soe we have to convert\n //to base64URL (see https://en.wikipedia.org/wiki/Base64#The_URL_applications)\n return this.identityGet(b64Hash.replace(/\\+/g, '-').replace(/\\//g, '_'))\n }\n}\n","import {APIService} from \"./api\";\nimport {IndexRequest, SearchRequest, SearchResponse, Terms} from \"../models/search\";\n\nexport class SearchService {\n constructor(private api: APIService, private baseURL: string) {}\n\n /**\n * Creates search indexes for the terms passed in order to be able to search for it in the future\n * @param consultUUID\n * @param terms the search terms to be indexed\n */\n public index(\n consultUUID: string,\n terms: Terms\n ): Promise<any> {\n return this.api.post<IndexRequest>(\n `${this.baseURL}/v1/index`,\n <IndexRequest> {\n consultUUID,\n terms\n }\n )\n }\n\n /**\n * Searches for the consultations corresponding to the search terms entered in the query\n * @param terms array of search terms\n */\n public search(\n terms: Terms\n ): Promise<SearchResponse> {\n return this.api.post<SearchResponse>(\n `${this.baseURL}/v1/search`,\n <SearchRequest> {\n terms\n }\n )\n }\n}","import { hashToBase64String } from '../helpers'\nimport { PaymentStatus, PracticeAccount, Uuid } from '../models'\nimport {\n Assignment,\n AssignmentRequest,\n PaymentIntentRequestMetadata,\n PlanType,\n Practice,\n PracticeConfigKind,\n PracticeConfigs,\n PracticeInvoice,\n PracticePayment,\n PracticePaymentIntent,\n PracticePlan,\n PracticePlanPrices,\n PracticeWorkflow,\n PracticeWorkflowWithTagSpecialty,\n Practitioner,\n PractitionerLicense,\n PractitionerPreference,\n PractitionerQuota,\n PractitionerRole,\n WorkflowType,\n} from '../models/practice'\nimport { APIService } from './api'\n\nexport class PracticeService {\n constructor(private api: APIService, private baseURL: string) {}\n\n /**\n * This function will only work if the service is initialized with\n * an M2M with the scope `practice.practices.get`\n * @returns an array of practices\n */\n public practiceGetAll(): Promise<Practice[]> {\n return this.api.get<Practice[]>(`${this.baseURL}/v1/practices`)\n }\n\n /**\n * This function get the practice from the URL of a practice\n * It is the entry point of our web apps\n * @param practiceURL URL of the practice to search\n * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set\n * @param accounts (optional) if set true it the Practice field accounts will be set\n * @returns the found practice or undefined\n */\n public practiceGetFromURL(\n practiceURL: string,\n params?: {\n hydratePracticeConfigs?: boolean\n accounts?: boolean\n }\n ): Promise<Practice | undefined> {\n return this.api.get<Practice | undefined>(`${this.baseURL}/v1/practices`, {\n params: {\n url_practice: practiceURL,\n ...params,\n },\n })\n }\n\n public practiceGetFromUuid(practiceUuid: Uuid, locale?: string, withAccounts?: boolean): Promise<Practice> {\n return this.api.get<Practice>(`${this.baseURL}/v1/practices/${practiceUuid}`, {\n params: { locale, accounts: withAccounts },\n })\n }\n\n /// Practice Configs\n\n /**\n * This function retrieves all configs of a specific practice\n * @param practiceUuid uuid of the practice\n * @returns the practice configs\n */\n public practiceConfigGetFromPracticeUuid(practiceUuid: Uuid): Promise<PracticeConfigs[]> {\n return this.api.get<PracticeConfigs[]>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`)\n }\n\n /**\n * This function retrieves a specific config of a practice\n * @param practiceUuid uuid of the practice\n * @param kind of the config\n * @returns the practice config\n */\n public practiceConfigGetByKindForPracticeUuid(\n practiceUuid: Uuid,\n kind: PracticeConfigKind\n ): Promise<PracticeConfigs> {\n return this.api.get<PracticeConfigs>(`${this.baseURL}/v1/practices/${practiceUuid}/configs/${kind}`)\n }\n\n /**\n * This function creates a config for a specific practice\n * @param practiceUuid uuid of the practice\n * @param config the config to add to the practice\n * @returns the created practice config\n */\n public practiceConfigCreateForPracticeUuid(practiceUuid: Uuid, config: PracticeConfigs): Promise<PracticeConfigs> {\n return this.api.post<PracticeConfigs>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`, config)\n }\n\n /**\n * This function updates a specific config of a practice\n * @param practiceUuid uuid of the practice\n * @param config the config to update\n * @returns the practice config\n */\n public practiceConfigUpdate(config: PracticeConfigs): Promise<PracticeConfigs> {\n return this.api.put<PracticeConfigs>(\n `${this.baseURL}/v1/practices/${config.uuidPractice}/configs/${config.kind}`,\n config\n )\n }\n\n /// Accounts\n public practiceGetAccounts(practiceUuid: Uuid): Promise<PracticeAccount[]> {\n return this.api.get<PracticeAccount[]>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts`)\n }\n\n public practiceGetAccount(practiceUuid: Uuid, accountUuid: Uuid): Promise<PracticeAccount> {\n return this.api.get<PracticeAccount>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts/${accountUuid}`)\n }\n\n /**\n * Get the PracticeWorkflows of a specific practice\n * @param practiceUuid the uuid of the practice\n * @param kind (optional) the kind of WorkflowType to filter in\n * @returns a list of PracticeWorkflow\n */\n public practiceGetWorkflows(practiceUuid: Uuid, kind?: WorkflowType): Promise<PracticeWorkflow[]> {\n return this.api.get<PracticeWorkflow[]>(`${this.baseURL}/v1/practices/${practiceUuid}/workflows`, {\n params: { kind },\n })\n }\n\n public practiceGetWorkflow(\n practiceUuid: Uuid,\n workflowType: WorkflowType\n ): Promise<PracticeWorkflowWithTagSpecialty> {\n return this.api.get<PracticeWorkflowWithTagSpecialty>(\n `${this.baseURL}/v1/practices/${practiceUuid}/workflows/${workflowType}`\n )\n }\n\n /// Plans\n public practiceGetPlans(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePlan[]> {\n return this.api.get<PracticePlan[]>(`${this.baseURL}/v1/practices/${practiceUuid}/plans`, {\n params: { kind: planType },\n })\n }\n\n public practiceGetPlan(practiceUuid: Uuid, planId: number): Promise<PracticePlan> {\n return this.api.get<PracticePlan>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}`)\n }\n\n public practiceGetPlanPrices(practiceUuid: Uuid, planId: number): Promise<PracticePlanPrices> {\n return this.api.get<PracticePlanPrices>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}/prices`)\n }\n\n // Payments\n public practiceGetPayments(\n practiceUuid: Uuid,\n statusPayment?: PaymentStatus,\n withConsultUUIDNULL?: boolean,\n perPage?: number,\n indexPage?: number\n ): Promise<PracticePayment[]> {\n return this.api.get<PracticePayment[]>(`${this.baseURL}/v1/practices/${practiceUuid}/payments`, {\n params: {\n status: statusPayment,\n withConsultUUIDNULL,\n perPage,\n indexPage,\n },\n })\n }\n\n public practiceGetPayment(practiceUuid: Uuid, idStripeInvoiceOrPaymentIntent: string): Promise<PracticePayment> {\n return this.api.get<PracticePayment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/${idStripeInvoiceOrPaymentIntent}`\n )\n }\n\n public practiceGetPaymentForStripePaymentIntentWithID(\n practiceUuid: Uuid,\n stripePaymentIntentId: number\n ): Promise<PracticePayment> {\n return this.api.get<PracticePayment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/${stripePaymentIntentId}`\n )\n }\n\n // Payments Intent\n public practiceGetPaymentsIntents(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePaymentIntent[]> {\n return this.api.get<PracticePaymentIntent[]>(`${this.baseURL}/v1/practices/${practiceUuid}/payments/intents`, {\n params: { kind: planType },\n })\n }\n\n /**\n * This function return the user hased email to be use for creating payment intent\n * @param email the email to hash\n * @returns a hashed email\n */\n public getPaymentIntentHashedEmail(email: string): string {\n return hashToBase64String(email.toLowerCase())\n }\n\n /**\n * Creates a PracticePaymentIntent\n * @param practiceUuid the uuid of the practice\n * @param planId the plan id to use\n * @param userEmail the email address of the user\n * @param isoLocality (optional) the desired locality\n * @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)\n * @param promotionCode (optional) promotion code to apply\n * @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).\n * @returns\n */\n public practiceCreatePaymentsIntent(\n practiceUuid: Uuid,\n planId: number,\n userEmail: string,\n isoLocality?: string,\n url_subdomain?: string,\n requestMetadata?: PaymentIntentRequestMetadata\n ): Promise<PracticePaymentIntent> {\n return this.api.post<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/`,\n {\n idPlan: planId,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n isoLocality,\n requestMetadata,\n },\n { params: { url_subdomain } }\n )\n }\n\n public practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent> {\n return this.api.get<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${paymentIntentId}`\n )\n }\n\n /**\n * Updates a PracticePaymentIntent\n * @param practiceUuid the practice uuid\n * @param idPraticePaymentIntent the id of the PracticePaymentIntent to update\n * @param practicePaymentIntent the desired PracticePaymentIntent\n * @param userEmail the email of the user\n * @param promotionCode (optional) promotional code to apply\n * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.\n * @returns the updated PracticePaymentIntent\n */\n public practiceUpdatePaymentsIntent(\n practiceUuid: string,\n idPraticePaymentIntent: number,\n practicePaymentIntent: PracticePaymentIntent,\n userEmail: string,\n promotionCode?: string,\n finalize?: boolean\n ) {\n return this.api.put<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${idPraticePaymentIntent}`,\n {\n ...practicePaymentIntent,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n },\n { params: { promotionCode, finalize } }\n )\n }\n\n /**\n * Invoice\n * @param practiceUuid UUID of the practice to get the invoice from\n * @param invoiceId ID of the invoice in stripe\n */\n public getInvoice(practiceUuid: Uuid, invoiceId: string): Promise<PracticeInvoice> {\n return this.api.get<PracticeInvoice>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/invoices/${invoiceId}`\n )\n }\n\n // Practitioner\n public practiceGetPractitioners(practiceUuid: Uuid): Promise<Practitioner[]> {\n return this.api.get<Practitioner[]>(`${this.baseURL}/v1/practices/${practiceUuid}/practitioners`)\n }\n\n public practiceUpdatePractitioner(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: Practitioner\n ): Promise<Practitioner> {\n return this.api.put<Practitioner>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}`,\n requestBody\n )\n }\n\n public practiceGetPractitioner(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<Practitioner> {\n return this.api.get<Practitioner>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}`\n )\n }\n\n // Practitioner Licenses\n public practiceGetPractitionerLicenses(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerLicense[]> {\n return this.api.get<PractitionerLicense[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses`\n )\n }\n\n public practiceCreatePractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerLicense\n ): Promise<PractitionerLicense> {\n return this.api.post<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses`,\n requestBody\n )\n }\n\n public practiceUpdatePractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n licenseId: number,\n requestBody: PractitionerLicense\n ): Promise<PractitionerLicense> {\n return this.api.put<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses/${licenseId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n licenseId: number\n ): Promise<PractitionerLicense> {\n return this.api.get<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses/${licenseId}`\n )\n }\n\n // Practitioner Preferences\n public practiceGetPractitionerPreferences(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<PractitionerPreference[]> {\n return this.api.get<PractitionerPreference[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences`\n )\n }\n\n public practiceCreatePractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerPreference\n ): Promise<PractitionerPreference> {\n return this.api.post<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences`,\n requestBody\n )\n }\n\n public practiceUpdatePractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n preferenceId: number,\n requestBody: PractitionerPreference\n ): Promise<PractitionerPreference> {\n return this.api.put<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences/${preferenceId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n preferenceId: number\n ): Promise<PractitionerPreference> {\n return this.api.get<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences/${preferenceId}`\n )\n }\n\n // Practitioner Roles\n public practiceGetPractitionerRoles(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerRole[]> {\n return this.api.get<PractitionerRole[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`\n )\n }\n\n public practiceCreatePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerRole\n ): Promise<PractitionerRole> {\n return this.api.post<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`,\n requestBody\n )\n }\n\n public practiceDeletePractitionerRoles(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerRole> {\n return this.api.deleteRequest<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`\n )\n }\n\n public practiceUpdatePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number,\n requestBody: PractitionerRole\n ): Promise<PractitionerRole> {\n return this.api.put<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number\n ): Promise<PractitionerRole> {\n return this.api.get<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`\n )\n }\n\n public practiceDeletePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number\n ): Promise<PractitionerRole> {\n return this.api.deleteRequest<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`\n )\n }\n\n // Practitioner signature\n\n /**\n * This function returns the practitioner's signature as a Blob\n * @param practiceUuid the practice uuid of the practitioner\n * @param practitionerUuid the practitioner uuid\n * @returns a blob representing the signature\n */\n public practiceGetPractitionerSignature(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<Blob> {\n return this.api.get<Blob>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/signature`,\n { responseType: 'blob' }\n )\n }\n\n // Assignments\n public practiceGetAssignments(practiceUuid: Uuid): Promise<Assignment[]> {\n return this.api.get<Assignment[]>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`)\n }\n\n public practiceCreateAssignment(practiceUuid: Uuid, requestBody: AssignmentRequest): Promise<Assignment> {\n return this.api.post<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`, requestBody)\n }\n\n public practiceUpdateAssignment(\n practiceUuid: Uuid,\n assignmentId: number,\n requestBody: Assignment\n ): Promise<Assignment> {\n return this.api.put<Assignment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`,\n requestBody\n )\n }\n\n public practiceGetAssignment(practiceUuid: Uuid, assignmentId: number): Promise<Assignment> {\n return this.api.get<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`)\n }\n\n // Quotas\n public practiceGetQuotas(practiceUuid: Uuid): Promise<PractitionerQuota[]> {\n return this.api.get<PractitionerQuota[]>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas`)\n }\n\n public practiceGetQuota(practiceUuid: Uuid, quotaId: number): Promise<PractitionerQuota> {\n return this.api.get<PractitionerQuota>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas/${quotaId}`)\n }\n}\n","import { APIService } from './api'\nimport {\n ClosedReasonType,\n Consult,\n DataCreateResponse,\n LockboxDataRequest,\n MedicalStatus,\n ResumeConsultEmailRequest,\n Uuid,\n} from '../models'\nexport class TellerService {\n constructor(private api: APIService, private baseURL: string) { }\n\n public async lockboxDataStore(\n lockboxUuid: Uuid,\n req: LockboxDataRequest,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid,\n options: {\n updateMedicalStatus: boolean\n } = { updateMedicalStatus: true },\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`, req, {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n update_medical_status: options.updateMedicalStatus,\n },\n })\n }\n\n public updateConsultByUUID(\n patientUuid: Uuid,\n uuidConsult: Uuid,\n statusMedical: MedicalStatus,\n closedReasonType?: ClosedReasonType,\n closedReasonDescription?: string,\n neverExpires?: boolean\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, {\n patientUuid,\n statusMedical,\n closedReasonType,\n closedReasonDescription,\n neverExpires,\n })\n }\n\n /**\n * This function notifies teller that the fax sent for a specific consult did not get through\n * @todo - Make service only exposed route\n * @param practiceUuid the practice uuid linked to the consult\n * @param consultationUuid the consultation uuid\n * @param consultationShortId the consultation short id\n * @param fax the address where to send the fax\n * @returns void\n */\n public notifyFaxFailed(practiceUuid: Uuid, consultationUuid: Uuid, consultationShortId: string, fax: string) {\n return this.api.post<void>(\n `${this.baseURL}/v1/fax-failed`,\n {\n consultationUuid,\n consultationShortId,\n fax,\n },\n {\n params: { practice_uuid: practiceUuid },\n }\n )\n }\n\n /**\n * This function let's you reassign a practictioner to a consult and send a notification email\n * @todo - Make service only exposed route\n * @param uuidConsult the uuid of the consult to reassign\n * @param newPractitionerUuid the uuid of the practitioner that will get reassigned\n */\n public reassignmentEmail(uuidConsult: Uuid, newPractitionerUuid: Uuid) {\n return this.api.post<void>(`${this.baseURL}/v1/consult/${uuidConsult}/reassignment-email`, {\n newPractitionerUuid,\n })\n }\n\n /**\n * This function will send an email to the patientUuid, saying that the online practice has been sent a fax successfully\n * @todo - Make service only exposed route\n * @param consult\n * @param patientUuid\n * @returns void\n */\n public sendOnlineFaxSuccessfulEmail(consult: Consult, patientUuid: Uuid): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/online-fax-notify`, { consult, patientUuid })\n }\n\n /**\n * This function will send an email to patient to allow them to resume the consult.\n * @param req the body of the resume consult request\n * @returns void\n */\n public sendResumeConsultEmail(req: ResumeConsultEmailRequest): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/resume-consult-email`, req)\n }\n}\n","import { APIService } from './api'\nimport {\n DataCreateResponse,\n DataResponse,\n GrantedLockboxes,\n LockboxCreateResponse,\n LockboxDataRequest,\n LockboxGrantRequest,\n LockboxManifest,\n SharedSecretResponse,\n Uuid,\n EncryptedVaultIndex,\n IndexKey,\n EncryptedIndexEntry\n} from '../models'\n\nexport class VaultService {\n constructor(private api: APIService, private baseURL: string) { }\n\n public async lockboxCreate(lockboxMetadata?: Object): Promise<LockboxCreateResponse> {\n return this.api.post<LockboxCreateResponse>(\n `${this.baseURL}/v1/lockbox`,\n lockboxMetadata\n )\n }\n\n public async lockboxMetadataAdd(\n lockboxUuid: Uuid,\n lockboxMetadata: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<LockboxCreateResponse> {\n return this.api.put<LockboxCreateResponse>(\n `${this.baseURL}/v1/lockbox/${lockboxUuid}`,\n lockboxMetadata,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n public async lockboxSecretGet(\n lockboxUuid: Uuid,\n lockboxOwnerUuid?: Uuid\n ): Promise<SharedSecretResponse> {\n return this.api.get<SharedSecretResponse>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/secret`,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n public async lockboxGrant(\n lockboxUuid: Uuid,\n req: LockboxGrantRequest,\n lockboxOwnerUuid?: Uuid\n ): Promise<void> {\n return this.api.post<void>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/grant`,\n req,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n /**\n * Get all lockboxes granted to user\n * @param filter filter of lockbox metadata\n * @returns decrypted lockboxes granted to user\n */\n public async grantsGet(): Promise<GrantedLockboxes> {\n return this.api.get<GrantedLockboxes>(`${this.baseURL}/v1/grants`)\n }\n\n /**\n * This function create or update a data into the vault.\n * @note At creation it is necessary to have all `req` filled\n * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.\n * @param lockboxUuid The lockbox uuid the data will be stored in\n * @param req The request (please see notes)\n * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)\n * @param previousDataUuid The data uuid of the data you want to update\n * @returns \n */\n public async lockboxDataStore(\n lockboxUuid: Uuid,\n req: LockboxDataRequest,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`,\n req,\n {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n },\n }\n )\n }\n\n public async lockboxDataGet(\n lockboxUuid: Uuid,\n dataUuid: Uuid,\n lockboxOwnerUuid?: Uuid,\n stream: boolean = true\n ): Promise<DataResponse> {\n let data = await this.api.get(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data/${dataUuid}`,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid, stream } }\n )\n\n // returned as stream, we need to put inside a DataResponse object\n if (stream)\n return { data }\n\n return data\n }\n\n public async lockboxManifestGet(\n lockboxUuid: Uuid,\n filter?: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<LockboxManifest> {\n return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}`, {\n params: { lockbox_owner_uuid: lockboxOwnerUuid, filter },\n })\n }\n\n public async lockboxMetadataGet(\n lockboxUuid: Uuid,\n fields: string[],\n groupby: string[],\n filter?: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<any[]> {\n return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/metadata`, {\n params: { lockbox_owner_uuid: lockboxOwnerUuid, fields, groupby, filter },\n })\n }\n\n /**\n * inserts or updates encrypted index entries\n * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`\n * @note if a uuid for an entry is provided, the service will perform an update\n * @param entries the encrypted index data\n * @param indexOwnerUuid\n */\n public async vaultIndexPut(entries: EncryptedVaultIndex, indexOwnerUuid?: Uuid): Promise<void> {\n return this.api.put(`${this.baseURL}/v1/index`,\n entries,\n {\n params: {\n index_owner_uuid: indexOwnerUuid,\n },\n }\n )\n }\n\n /**\n * inserts or updates index snapshot for the provided index owner\n * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`\n * @param entry the encrypted index snapshot\n */\n public async vaultIndexSnapshotPut(entry: EncryptedIndexEntry): Promise<void> {\n return this.api.put(`${this.baseURL}/v1/index-snapshot`, entry)\n }\n\n /**\n * Retrieves the encrypted index from the vault for the requesting user\n * @note index keys can be specified to narrow the scope of index being requested\n * @param indexKeys accepted index fields determined by vault\n * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry\n * @param timestamp the minimum timestamp that index entries were created\n * @returns the encrypted index\n */\n public async vaultIndexGet(indexKeys: IndexKey[], identifiers?: string[], timestamp?: Date): Promise<EncryptedVaultIndex> {\n return this.api.get<EncryptedVaultIndex>(`${this.baseURL}/v1/index`, {\n params: { index_keys: indexKeys, identifiers, timestamp },\n })\n }\n}\n","import { WorkflowData } from '../models/workflow'\nimport { APIService } from './api'\n\nexport class WorkflowService {\n private v1Url: string\n\n constructor(private api: APIService, url: string) {\n this.v1Url = `${url}/v1`\n }\n\n /**\n * This function returns all workflows\n * @returns desired workflow\n */\n public getWorkflows(): Promise<WorkflowData[]> {\n return this.api.get<WorkflowData[]>(`${this.v1Url}/workflows`)\n }\n\n /**\n * This function retrieves a workflow. If `locale` is not found, it will try to find 'en' version of it.\n * By default, will return most recent workflow of a specific `id`. `createdAt` can be used to select older version.\n * @param id The uuid of the workflow\n * @param locale (optional) The desired locale of the workflow (default: 'en')\n * @param createdAt (optional) The creation date of the workflow (also used for versionning)\n * @returns desired workflow\n */\n public getWorkflow(\n id: string,\n locale?: string,\n createdAt?: string\n ): Promise<WorkflowData> {\n return this.api.get<WorkflowData>(`${this.v1Url}/workflows/${id}`, {\n params: { locale, createdAt },\n })\n }\n}\n","import { ServiceCollection, ServiceCollectionRequest } from '../models'\nimport {\n APIService,\n ConsultService,\n DiagnosisService,\n GuardService,\n PracticeService,\n SearchService,\n TellerService,\n VaultService,\n WorkflowService,\n} from '../services'\n\n/**\n * This function is used to initialize services with a provided url\n * @param services an object containing the url of the services to init\n * @param authenticationCallback (optional) the authentification callback. Called when the token were not able to be refreshed.\n * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)\n * @returns an instance of each services with a provided url\n */\nexport const init = (\n services: ServiceCollectionRequest,\n authenticationCallback?: (err: Error, practiceUuid?: string) => void,\n useLocalStorage = true\n): ServiceCollection => {\n const {\n tellerBaseURL,\n practiceBaseURL,\n consultBaseURL,\n vaultBaseURL,\n guardBaseURL,\n searchBaseURL,\n workflowBaseURL,\n diagnosisBaseURL,\n } = services\n\n const apiService = new APIService(useLocalStorage, undefined, authenticationCallback)\n\n return {\n apiService,\n tellerService: tellerBaseURL ? new TellerService(apiService, tellerBaseURL) : undefined,\n practiceService: practiceBaseURL ? new PracticeService(apiService, practiceBaseURL) : undefined,\n consultService: consultBaseURL ? new ConsultService(apiService, consultBaseURL) : undefined,\n vaultService: vaultBaseURL ? new VaultService(apiService, vaultBaseURL) : undefined,\n guardService: guardBaseURL ? new GuardService(apiService, guardBaseURL) : undefined,\n searchService: searchBaseURL ? new SearchService(apiService, searchBaseURL) : undefined,\n workflowService: workflowBaseURL ? new WorkflowService(apiService, workflowBaseURL) : undefined,\n diagnosisService: diagnosisBaseURL ? new DiagnosisService(apiService, diagnosisBaseURL) : undefined,\n }\n}\n"],"names":["hashToBase64String","value","Buffer","from","sha256","update","digest","toString","AssistantType","TransmissionKind","TransmissionStatus","ConsultType","FeeStatus","MedicalStatus","TaskStatus","ClosedReasonType","VisibilityType","DrugType","PrescriptionStatus","PlanStatus","AxiosService","config","this","axios","create","_proto","apiRequest","url","data","headers","then","res","apiRequestHeader","headerToRetrieve","toLowerCase","get","method","deleteRequest","post","put","patch","head","APIService","useLocalStorage","tokenRefreshFailureCallback","_this","self","interceptors","request","use","token","useRefreshToken","getTokens","refreshToken","accessToken","Authorization","error","Promise","reject","createAuthRefreshInterceptor","failedRequest","authRefreshFn","_context","setTokens","tokenResp","response","resolve","console","statusCodes","_inheritsLoose","setAuthRefreshFn","fn","tokens","localStorage","setItem","JSON","stringify","item","getItem","parse","ApisPracticeManager","serviceCollReq","getAuthTokenCbk","Map","practiceUuid","practiceInstance","practiceInstances","cacheKey","_context2","newPracticeInstance","init","undefined","authTokenFunc","guardService","log","Error","apiService","set","WorkflowType","RateDimension","PlanType","PaymentStatus","PractitionerStatus","AssignmentStatus","PractitionnerRoleType","OtherRoleType","LicenseStatus","PeriodType","SyncStatus","PracticeEmailKind","PracticeConfigKind","StripePriceType","PaymentIntentRequestMetadataKind","IndexKey","DocumentType","InputApplyFunctions","MetadataCategory","IndexKind","AuthenticationFailed","AuthenticationBadRequest","AuthenticationServerError","AuthenticationUnconfirmedEmail","IdentityCreationFailed","IdentityCreationBadRequest","IdentityCreationConflict","VaultDataMissing","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","updateConsultByUUID","consult","getConsultFaxStatuses","kind","Fax","postConsultTransmission","nameDriver","addressOrPhoneToSendTo","file","nameReceiver","txtTransmissionTitle","txtTransmissionNotes","FormData","append","Content-Type","postConsultFax","addressReceiver","postConsultEmail","retryConsultFax","transmissionId","status","Retrying","updateConsultTransmissionStatus","newStatus","DiagnosisService","getDiagnoses","getDiagnosisByUuid","uuidDiagnosis","createDiagnosis","diagnosis","updateDiagnosis","uuid","getTreatmentsFromDiagnosisUuid","diagnosisUuid","getTreatmentPlansFromConsultUuid","createTreatment","treatmentRequest","getTreatmentPlansPopulatedFromConsultUuid","populated","postPlans","plans","updateTreatmentPlan","uuidPlan","diagnosisRequest","plan","refill","acceptTreatmentPlan","getAllDrugs","foundDrugs","GuardService","authRefresh","bind","identityCache","whoAmICache","m2mToken","req","skipAuthRefresh","resp","isAxiosError","code","_e$response","authToken","_e$response2","authLogout","authRecover","identityCreate","_context6","_e$response3","identityGet","identityID","skipCache","_context7","identity","whoAmI","refreshCache","_context8","identityUpdate","identityMFAQRCode","password","Accept","identitySendConfirmEmail","identityGetByCustomerEmail","email","identityGetByHash","substring","indexOf","b64Hash","replace","SearchService","index","consultUUID","terms","search","PracticeService","practiceGetAll","practiceGetFromURL","practiceURL","url_practice","practiceGetFromUuid","locale","withAccounts","accounts","practiceConfigGetFromPracticeUuid","practiceConfigGetByKindForPracticeUuid","practiceConfigCreateForPracticeUuid","practiceConfigUpdate","practiceGetAccounts","practiceGetAccount","accountUuid","practiceGetWorkflows","practiceGetWorkflow","workflowType","practiceGetPlans","planType","practiceGetPlan","planId","practiceGetPlanPrices","practiceGetPayments","statusPayment","withConsultUUIDNULL","practiceGetPayment","idStripeInvoiceOrPaymentIntent","practiceGetPaymentForStripePaymentIntentWithID","stripePaymentIntentId","practiceGetPaymentsIntents","getPaymentIntentHashedEmail","practiceCreatePaymentsIntent","userEmail","isoLocality","url_subdomain","requestMetadata","idPlan","hashUserEmail","practiceGetPaymentsIntent","paymentIntentId","practiceUpdatePaymentsIntent","idPraticePaymentIntent","practicePaymentIntent","promotionCode","finalize","getInvoice","invoiceId","practiceGetPractitioners","practiceUpdatePractitioner","practitionerUuid","requestBody","practiceGetPractitioner","practiceGetPractitionerLicenses","practiceCreatePractitionerLicense","practiceUpdatePractitionerLicense","licenseId","practiceGetPractitionerLicense","practiceGetPractitionerPreferences","practiceCreatePractitionerPreference","practiceUpdatePractitionerPreference","preferenceId","practiceGetPractitionerPreference","practiceGetPractitionerRoles","practiceCreatePractitionerRole","practiceDeletePractitionerRoles","practiceUpdatePractitionerRole","roleId","practiceGetPractitionerRole","practiceDeletePractitionerRole","practiceGetPractitionerSignature","responseType","practiceGetAssignments","practiceCreateAssignment","practiceUpdateAssignment","assignmentId","practiceGetAssignment","practiceGetQuotas","practiceGetQuota","quotaId","TellerService","lockboxDataStore","lockboxUuid","lockboxOwnerUuid","previousDataUuid","options","updateMedicalStatus","lockbox_owner_uuid","data_uuid","update_medical_status","patientUuid","statusMedical","closedReasonType","closedReasonDescription","neverExpires","notifyFaxFailed","consultationUuid","consultationShortId","fax","practice_uuid","reassignmentEmail","newPractitionerUuid","sendOnlineFaxSuccessfulEmail","sendResumeConsultEmail","VaultService","lockboxCreate","lockboxMetadata","lockboxMetadataAdd","lockboxSecretGet","lockboxGrant","grantsGet","lockboxDataGet","dataUuid","stream","lockboxManifestGet","filter","lockboxMetadataGet","fields","groupby","vaultIndexPut","entries","indexOwnerUuid","index_owner_uuid","vaultIndexSnapshotPut","entry","vaultIndexGet","indexKeys","identifiers","timestamp","index_keys","WorkflowService","v1Url","getWorkflows","getWorkflow","id","createdAt","services","authenticationCallback","tellerBaseURL","practiceBaseURL","consultBaseURL","vaultBaseURL","guardBaseURL","searchBaseURL","workflowBaseURL","diagnosisBaseURL","tellerService","practiceService","consultService","vaultService","searchService","workflowService","diagnosisService"],"mappings":"0PAQgBA,EAAmBC,GAC/B,OAAOC,SAAOC,KAAKC,WAASC,OAAOJ,GAAOK,OAAO,OAAQ,OAAOC,SAAS,qvQCTjEC,EAiBAC,EAUAC,EA8BAC,EAKAC,EASAC,EAWAC,EAQAC,EC1FAC,EA8CAC,EA4BAC,EAqBAC,EC3FCC,aAGT,WACIC,GAEKA,IAAQA,EAAS,IAEtBC,KAAKC,MAAQA,EAAMC,OAAOH,GAC7B,kBA4EA,OA5EAI,EAEeC,sBAAU,kBAAhB,WAAiBL,EAA4BM,EAAaC,GAAU,6BAAA,OAAA,sBAAA,OAGvB,OAF9CP,EAAOQ,UAASR,EAAOQ,QAAU,IAEtCR,EAAOQ,QAAQ,gBAAkB,qCAE1BP,KAAKC,WACLF,GACHM,IAAAA,EACAC,KAAMA,KACPE,MAAK,SAACC,GACL,OAAOA,EAAIH,SACb,OAAA,UAAA,+BACL,OAAA,gBAAA,mCAAAH,EAEeO,4BAAgB,kBAAtB,WAAuBX,EAA4BM,EAAaM,EAA2BL,GAAU,6BAAA,OAAA,sBAAA,OAGxD,OAF9CP,EAAOQ,UAASR,EAAOQ,QAAU,IAEtCR,EAAOQ,QAAQ,gBAAkB,qCAE1BP,KAAKC,WACLF,GACHM,IAAAA,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,cACAC,EAEAR,EAFAQ,gBACAC,EACAT,EADAS,iBAGE3S,EAAa,IAAItD,EAAWC,OAAiBgD,EAAWwS,GAE9D,MAAO,CACHnS,WAAAA,EACA4S,cAAeR,EAAgB,IAAI1D,GAAc1O,EAAYoS,QAAiBzS,EAC9EkT,gBAAiBR,EAAkB,IAAI5I,GAAgBzJ,EAAYqS,QAAmB1S,EACtFmT,eAAgBR,EAAiB,IAAIxQ,GAAe9B,EAAYsS,QAAkB3S,EAClFoT,aAAcR,EAAe,IAAIrC,GAAalQ,EAAYuS,QAAgB5S,EAC1EE,aAAc2S,EAAe,IAAI3L,GAAa7G,EAAYwS,QAAgB7S,EAC1EqT,cAAeP,EAAgB,IAAIrJ,GAAcpJ,EAAYyS,QAAiB9S,EAC9EsT,gBAAiBP,EAAkB,IAAId,GAAgB5R,EAAY0S,QAAmB/S,EACtFuT,iBAAkBP,EAAmB,IAAIvN,GAAiBpF,EAAY2S,QAAoBhT"}
1
+ {"version":3,"file":"oro-sdk-apis.cjs.production.min.js","sources":["../src/helpers/hash.ts","../src/models/consult.ts","../src/models/diagnosis.ts","../node_modules/regenerator-runtime/runtime.js","../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 New = 'New',\n ToAnswer = 'ToAnswer',\n Answered = 'Answered',\n Closed = 'Closed',\n Reopened = 'Reopened',\n Archived = 'Archived',\n Failed = 'Failed',\n}\n\nexport enum TaskStatus {\n None = 'None',\n ToDo = 'ToDo',\n InProgress = 'InProgress',\n Blocked = 'Blocked',\n Done = 'Done',\n}\n\nexport enum ClosedReasonType {\n /**\n * A completed consultation\n */\n Completed = 'Completed',\n /**\n * The conclusion was that what the patient submitted was not a disease\n */\n NotADisease = 'NotADisease',\n /**\n * The consultation was not appropriate for virtual\n */\n NotAppropriateForVirtual = 'NotAppropriateForVirtual',\n /**\n * Any other reason why the consultation was closed\n */\n Other = 'Other',\n /**\n * A consultation that is required to be done in person\n */\n RequiresInPerson = 'RequiresInPerson',\n}\n\nexport interface ClosedConsultReasonInsertFields {\n /**\n * The uuid of the consultation\n */\n consult_uuid: string\n /**\n * The reason why the consultation was closed\n */\n closed_reason_type: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closed_reason_description: string\n /**\n * When the consultation was closed\n */\n created_at: string\n}\n\nexport interface ConsultClosedReason {\n /**\n * The reason why the consultation was closed\n */\n closedReasonType: ClosedReasonType\n /**\n * The description why the consultation was closed\n */\n closedReasonDescription?: string\n}\n\nexport interface ConsultRequest {\n uuidPractice: string\n consultType?: ConsultType\n tagSpecialtyRequired: string\n idStripeInvoiceOrPaymentIntent: string\n isoLocalityRequired?: string\n isoLanguageRequired: string\n uuidParent?: string\n}\nexport interface Consult {\n uuid: string\n uuidPracticeAdmin: string\n uuidPractice: string\n tagSpecialtyRequired: string\n isoLanguageRequired: string\n idPracticePayment: number\n statusFee?: FeeStatus\n isoLocalityRequired: string\n statusMedical?: MedicalStatus\n consultType: ConsultType\n uuidAssignedDoctor: string\n uuidCurrentAssigned: string\n uuidParent?: string\n statusTask?: TaskStatus\n hasTransmissions?: boolean\n assignedAssistant?: ConsultAssignedAssistant[]\n closeConsultReason?: ConsultClosedReason\n shortId?: string\n createdAt?: string\n expiresAt?: string\n}\n","export enum VisibilityType {\n Generic = 'Generic',\n Private = 'Private',\n Instance = 'Instance',\n}\n\nexport type DiagnosisType = VisibilityType\n\nexport type TreatmentType = VisibilityType\n\nexport interface DiagnosisRequest {\n uuid?: string\n name: string\n description: string\n type: DiagnosisType\n parentUuid?: string\n language: string\n tags?: string[]\n urlMultimedia?: string\n}\n\nexport interface Diagnosis extends DiagnosisRequest {\n uuid: string\n uuidPractice: string\n uuidPractitioner?: string\n createdAt: string\n}\n\nexport interface TreatmentRequest {\n uuid?: string\n uuidDiagnosis?: string\n uuidParentTreatment?: 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}\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 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 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 * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import type { AxiosRequestConfig } from 'axios'\nimport axios, { AxiosInstance } from 'axios'\n\n\nexport class AxiosService {\n protected axios: AxiosInstance\n\n constructor(\n config?: AxiosRequestConfig\n ) {\n if (!config) config = {}\n\n this.axios = axios.create(config)\n }\n\n protected async apiRequest(config: AxiosRequestConfig, url: string, data?: any) {\n if (!config.headers) config.headers = {}\n\n config.headers['Content-Type'] = 'application/json'\n\n return this.axios({\n ...config,\n url,\n data: data,\n }).then((res) => {\n return res.data\n })\n }\n\n protected async apiRequestHeader(config: AxiosRequestConfig, url: string, headerToRetrieve?: string, data?: any,) {\n if (!config.headers) config.headers = {}\n\n config.headers['Content-Type'] = 'application/json'\n\n return this.axios({\n ...config,\n url,\n data: data,\n }).then((res) => {\n if (headerToRetrieve) {\n return res.headers[headerToRetrieve] ?? res.headers[headerToRetrieve.toLowerCase()]\n }\n\n return res.headers\n })\n }\n\n public get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T> {\n return this.apiRequest({ ...config, method: 'get' }, url)\n }\n\n public deleteRequest<T = any>(\n url: string,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'delete' }, url)\n }\n\n public post<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'post' }, url, data)\n }\n\n public put<T = any>(\n url: string,\n data: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'put' }, url, data)\n }\n\n public patch<T = any>(\n url: string,\n data: any,\n config?: AxiosRequestConfig\n ): Promise<T> {\n return this.apiRequest({ ...config, method: 'patch' }, url, data)\n }\n\n public head<T = any>(\n url: string,\n config?: AxiosRequestConfig,\n headerToRetrieve?: string,\n data?: any\n ): Promise<T> {\n return this.apiRequestHeader({ ...config, method: 'head' }, url, headerToRetrieve, data)\n }\n}\n","import type { AxiosRequestConfig } from 'axios'\nimport createAuthRefreshInterceptor from 'axios-auth-refresh'\nimport { AuthRefreshFunc, Tokens } from '../models'\nimport { AxiosService } from './axios'\nimport { GuardRequestConfig } from './guard'\n\nexport class APIService extends AxiosService {\n private authRefreshFn?: AuthRefreshFunc\n private tokens: Tokens = {}\n\n /**\n * The API Service lets you use an axios API and handles oro backend services authentification via JWT tokens\n * @param useLocalStorage if set to true, tokens will be stored in localStorage\n * @param config (optional) an axios config\n * @param tokenRefreshFailureCallback (optional) callback to call when failing to refresh the auth token\n */\n constructor(\n private useLocalStorage: boolean,\n config?: AxiosRequestConfig,\n private tokenRefreshFailureCallback?: (err: Error) => void\n ) {\n super(config)\n const self = this\n\n this.axios.interceptors.request.use(\n (config) => {\n const token = (config as GuardRequestConfig).useRefreshToken\n ? self.getTokens().refreshToken\n : self.getTokens().accessToken\n\n config.headers = {\n ...config.headers,\n Authorization: `Bearer ${token}`,\n }\n return config\n },\n (error) => {\n Promise.reject(error)\n }\n )\n\n createAuthRefreshInterceptor(\n this.axios,\n async function (failedRequest) {\n if (self.authRefreshFn) {\n try {\n let tokenResp = await self.authRefreshFn(self.getTokens().refreshToken)\n self.setTokens({\n accessToken: tokenResp.accessToken,\n refreshToken: tokenResp.refreshToken,\n })\n failedRequest.response.config.headers['Authorization'] = `Bearer ${\n self.getTokens().accessToken\n }`\n return Promise.resolve()\n } catch (e) {\n console.error('an error occured while refreshing tokens (notifying callback)', e)\n if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest)\n return Promise.resolve() // We keep it like that. Otherwise, it seems to break the api service will it is not needed\n // return Promise.reject(e)\n }\n }\n console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest)\n return Promise.resolve() // We keep it like that. Otherwise, it seems to break the api service will it is not needed\n // return Promise.reject(failedRequest)\n },\n { statusCodes: [401, 403] }\n )\n }\n\n public setAuthRefreshFn(fn: AuthRefreshFunc) {\n this.authRefreshFn = fn\n }\n\n public setTokens(tokens: Tokens) {\n if (this.useLocalStorage) {\n localStorage.setItem('tokens', JSON.stringify(tokens))\n }\n this.tokens = tokens\n }\n\n public getTokens(): Tokens {\n if (this.useLocalStorage) {\n let tokens: Tokens = {}\n const item = localStorage.getItem('tokens')\n if (item) {\n tokens = JSON.parse(item)\n }\n return tokens\n } else {\n return this.tokens\n }\n }\n}\n","import { init } from '../helpers'\nimport { AuthTokenResponse, ServiceCollection, ServiceCollectionRequest } from '../models'\nimport { GuardService } from './guard'\n\n/**\n * This service enables you to handle one authentication token per practice\n */\nexport class ApisPracticeManager {\n private practiceInstances = new Map<string, ServiceCollection>()\n\n /**\n * The constructor\n * @param serviceCollReq the services to initialize. Only filled urls will get corresponding service to be initialized.\n * It will be used each time a new practices needs a `ServiceCollection`\n * @param getAuthTokenCbk the callback function used to get a new JWT token\n * @param useLocalStorage (default: false) if true store tokens into local storage (only for browsers)\n */\n constructor(\n private serviceCollReq: ServiceCollectionRequest,\n private getAuthTokenCbk: (guard: GuardService, practiceUuid?: string) => Promise<AuthTokenResponse>,\n private useLocalStorage = false\n ) {}\n\n /**\n * This function is used to get a `ServiceCollection` associated to a practice. If missing, it will initialize a new `ServiceCollection`.\n * @param practiceUuid the uuid of the practice\n * @returns a promise holding a `ServiceCollection`\n */\n public async get(practiceUuid?: string): Promise<ServiceCollection> {\n const cacheKey = practiceUuid ?? 'none'\n const practiceInstance = this.practiceInstances.get(cacheKey)\n if (practiceInstance) return practiceInstance\n\n const newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage)\n\n // Create one auth token callback per practice since the practice uuid needs to change\n const authTokenFunc = async () => {\n if (newPracticeInstance.guardService) {\n console.log(`\\x1b[36m[Auth] Refresh auth called (practiceUuid: ${practiceUuid})\\x1b[36m`)\n return await this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid)\n } else {\n throw Error('[Auth] Unable to refresh token guard service is undefined')\n }\n }\n\n // Initialize the M2M token\n await authTokenFunc()\n\n // Set the refresh tokens callback\n newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc)\n\n this.practiceInstances.set(cacheKey, newPracticeInstance)\n\n return newPracticeInstance\n }\n}\n","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}\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}\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\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\nexport interface PracticeWorkflow {\n id?: number ///optional for insertion\n uuidPractice: string\n uuidWorkflow: string\n typeWorkflow: WorkflowType\n tagSpecialty?: string\n}\n\nexport type PracticeWorkflowWithTagSpecialty = PracticeWorkflow & {\n tagSpecialty: string\n}\n\nexport interface PracticePlan {\n id?: number ///optional for insertion\n uuidPractice: string\n isoLocality?: string\n nameDefault: string\n descDefault: string\n hoursExpiration: number\n active: boolean\n namePriceCurrency: string // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceAmount: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceExtDecimal?: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n numPriceExtNegativeExponential?: number // DEPRECATED: left only for in-app receipt display and lower migration risks\n kind: PlanType\n idStripeProduct: string\n idStripePrice: string // DEPRECATED: left only for in-app receipt display and lower migration risks\n dateCreatedAt: Date\n dateUpdateAt: Date\n ratePerThousandOverride: number // DEPRECATED: left only to lower migration risks\n}\n\nexport enum StripePriceType {\n Default = 'Default',\n Discount = 'Discount',\n}\n\n// Subset of Stripe.Price\nexport interface PracticePrice {\n /**\n * Unique identifier for the object in Stripe.\n */\n idStripePrice: string\n /**\n * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).\n */\n currency: string\n /**\n * The unit amount in %s to be charged, represented as a whole integer if possible.\n */\n unitAmount: number\n}\n\nexport interface PracticePlanPrices {\n idPlan: number\n default: PracticePrice\n discount?: PracticePrice\n}\n\nexport interface PracticeRate {\n id?: number\n uuidPractice: string\n idPlan: number\n isoLocality?: string\n dimension: RateDimension\n description: string\n uidTaxRate: string\n idStripeTaxRate: string\n}\n\nexport interface PracticePlatformFee {\n uuidPractice: string\n idPlan: number\n isoLocality?: string\n numPlatformFinalFee: number\n}\n\nexport interface PracticePayment {\n id?: number ///optional for insertion\n uuidPractice: string\n idPlan: number\n uuidConsult?: string\n hoursConsultExpiration: number\n idStripeInvoiceOrPaymentIntent: string\n status: PaymentStatus\n dateCreatedAt: Date\n dateUpdateAt: Date\n}\n\nexport interface PracticePaymentIntent {\n id?: number ///optional for insertion\n uuidPractice: string\n idPlan: number\n idPayment: number\n hoursPlanExpiration: number\n isoLocality?: string\n textPaymentMethodOptions: string\n nameCurrency: string\n numTotalAmount: number\n numPlatformFeeAmount: number\n idStripeInvoice: string\n idStripePaymtIntent: string\n /**\n * This value is set only after the PracticePaymentIntent has been finalized and ready to be paid\n */\n stripeClientSecret?: string\n dateCreatedAt?: Date\n dateUpdateAt?: Date\n}\n\n/**\n * All the PaymentIntentRequestMetadata Kind available\n */\nexport enum PaymentIntentRequestMetadataKind {\n ConsultRequestMetadata = 'ConsultRequestMetadata',\n RefillTreatmentRequestMetadata = 'RefillTreatmentRequestMetadata',\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to create the consult when stripe use our hook.\n */\nexport interface ConsultRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n *\n * Note: it can be `undefined` to handle backward compatibility when this interface didn't had a `kind`\n */\n kind: PaymentIntentRequestMetadataKind.ConsultRequestMetadata | undefined\n /**\n * The specialty required by the consultation\n */\n tagSpecialtyRequired: string\n /**\n * The locality required for the consultation in iso. COUNTRY (ISO 3166) - PROVINCE - COUNTY - CITY\n */\n isoLocalityRequired?: string\n /**\n * The language required for the consultation. Should respect ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes\n */\n isoLanguageRequired: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used to refill a treatment plan of a consult.\n */\nexport interface RefillTreatmentRequestMetadata {\n /**\n * Defines the kind of `PaymentIntentRequestMetadata` it is\n */\n kind: PaymentIntentRequestMetadataKind.RefillTreatmentRequestMetadata\n /**\n * The consult uuid to refill\n */\n consultUuid: string\n}\n\n/**\n * This interface is used as metadata when creating Stripe Invoice.\n * It will be used when stripe uses our hook.\n */\nexport type PaymentIntentRequestMetadata = ConsultRequestMetadata | RefillTreatmentRequestMetadata\n\nexport interface AssignmentRequest {\n uuidAssignor: string //defaulting for insertion to the default practice admin\n uuidPractitioner?: string\n status?: AssignmentStatus\n uuidConsult?: string\n tagSpecialty?: string\n isoLocality?: string\n isoLanguage?: string\n}\n\nexport type Assignment = {\n id: number ///optional for insertion\n uuidPractice: string\n uuidAssignor: string //defaulting for insertion to the default practice admin\n uuidPractitioner?: string\n status?: AssignmentStatus\n uuidConsult?: string\n tagSpecialty?: string\n timeAssigned?: string //defaulting for insertion\n}\n\nexport interface PractitionerRole {\n id?: number //optional for insertion\n uuidPractice: string\n uuidPractitioner: string\n role: PractitionnerRoleType\n dateGiven?: Date //default during insertion\n}\n\nexport interface PractitionerLicense {\n id?: number ///optional for insertion\n uuidPractitioner: string\n country: string\n tagSpecialty: string\n isoLocality: string\n txtLicenseNumber: string\n txtComplementary?: string\n dateProvidedAt?: Date\n dateObtainedAt?: Date\n dateRenewedAt?: Date\n status?: LicenseStatus\n}\n\nexport interface PractitionerPreference {\n id?: number\n uuidPractitioner: string\n uuidPractice: string\n tagSpecialties: string\n isoLocalityConsult?: string\n periodQuotaConsult?: PeriodType\n quantityQuotaConsult?: number\n tagConsultLanguages?: string\n}\n\nexport interface PractitionerQuota {\n id?: number ///optional for insertion\n uuidPractitioner: string\n uuidPractice: string\n tagSpecialty: string\n isoLocality: string\n quantityLeft?: number\n dateRenewal?: Date\n dateLastUpdate?: Date\n}\n\nexport interface Practitioner {\n uuid: string\n uuidPractice: string\n txtFirstName: string\n txtLastName: string\n txtTitle: string\n emailAddress: string\n tagsSpecialties: string\n arrLanguages: string\n dateAddedAt?: Date //defaulting for insertion\n status?: PractitionerStatus //defaulting for insertion\n txtAddressTransmission?: string //the default non-fax address to send prescription to\n}\n\nexport interface HydratedPracticeConfigs {\n [PracticeConfigKind.PatientConsultCard]?: PracticeConfigPatientConsultCard\n [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes\n [PracticeConfigKind.PracticeConsultTabs]?: PracticeConfigPracticeConsultTabs\n [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample\n [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner\n [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables\n [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks\n [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher\n [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy\n [PracticeConfigKind.PracticePrescriptionFields]?: PracticeConfigPracticePrescriptionFields\n [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox\n [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList\n [PracticeConfigKind.PractitionerSearch]?: PracticeConfigPractitionerSearch\n [PracticeConfigKind.PracticeRegisterWalkthrough]?: PracticeConfigPracticeRegisterWalkthrough\n [PracticeConfigKind.PracticeExamsAndResults]?: PracticeConfigPracticeExamsAndResults\n [PracticeConfigKind.PracticeLayout]?: PracticeConfigPracticeLayout\n [PracticeConfigKind.PracticeAddressField]?: PracticeConfigPracticeAddressField\n [PracticeConfigKind.PracticeDiagnosisAndTreatment]?: PracticeConfigPracticeDiagnosisAndTreatment\n}\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 MakeUpperCase = 'MakeUpperCase',\n MakeLowerCase = 'MakeLowerCase',\n RemoveAllSpaces = 'RemoveAllSpaces',\n}\n\nexport interface EntryData {\n id?: number\n label?: string\n inputApply?: InputApplyFunctions | InputApplyFunctions[]\n hideLabel?: boolean\n minorLabel?: string\n summaryLabel?: string\n summaryHidden?: boolean\n className?: string\n /**\n * This field represents a list of `selectedAnswers` that must be set for this entry to be displayed using the followng logical combination of rules:\n *\n * #### Single string\n *\n * ```\n * // Required: rule1\n * rules: rule1\n * ```\n *\n * #### Array of strings (AND is applied between statements):\n *\n * ```\n * // Required: rule1 AND rule2\n * rules: [ rule1, rule2 ]\n * ```\n *\n * #### Array of arrays of strings (OR is applied between inner arrays. AND is applied between inner arrays statements)\n *\n * ```\n * // Required: rule1 OR rule2\n * rules: [\n * [ rule1 ],\n * [ rule2 ]\n * ]\n *\n * // Required: rule1 OR (rule2 AND rule3)\n * rules: [\n * [ rule1 ],\n * [ rule2, rule3 ]\n * ]\n *\n * // THIS IS FORBIDDEN\n * rules: [\n * rule1, // <-- THIS IS FORBIDDEN. Instead use [ rule1 ]\n * [ rule2, rule3 ]\n * ]\n * ```\n */\n triggers?: string[][] | string[] | string\n /**\n * This field represents a list of `StateTrigger` that must be fulfilled for this entry to be displayed.\n */\n stateTriggers?: StateTrigger[]\n // represents the modal that it will be rendered as\n componentKind?: string\n message?: string\n}\n\nexport interface SlideData {\n header: string\n body: string\n image?: {\n src: string\n alt: string\n }\n icon?: string\n}\n\nexport enum MetadataCategory { //these are generic metadata categories\n ChildPersonal = 'ChildPersonal',\n Consultation = 'Consultation',\n Refill = 'Refill',\n DataRetrieval = 'DataRetrieval',\n Followup = 'Followup',\n Recovery = 'Recovery',\n Medical = 'Medical',\n OtherPersonal = 'OtherPersonal',\n Personal = 'Personal',\n Preference = 'Preference',\n Prescription = 'Prescription',\n Raw = 'Raw',\n}\n\n/**\n * This interface describes all images-alias question kind options\n */\nexport interface ImagesAliasQuestionOptions {\n /**\n * Comma separated list of accepted formats. Will be given to the input html element.\n * Use same format as described [here](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#accept)\n */\n accept?: string\n /**\n * Should allow multiple uploads or not\n */\n multiple?: boolean\n /**\n * Should display photo guide instructions or not\n */\n photoGuide?: boolean\n}\n\nexport interface GenericQuestionData<T, A = IndexedData<ChoiceInputData>, O = undefined> extends EntryData {\n kind: T\n metaCategory: MetadataCategory\n answers?: A\n formValidation?: any[] // use yup-ast expressions\n placeholder?: string\n defaultValue?: any\n value?: string\n /**\n * Options to forward to the workflow component\n */\n options?: O\n messages?: string\n}\n\nexport interface GroupedGenericQuestionData<T, A = IndexedData<ChoiceInputData>> extends GenericQuestionData<T, A> {\n inline?: boolean\n inlineLabel?: boolean\n order?: number\n}\n\nexport declare type QuestionData =\n | GenericQuestionData<'title' | 'paragraph' | 'checkbox', void>\n | GenericQuestionData<\n | 'text'\n | 'text-area'\n | 'date'\n | 'number'\n | 'images'\n | 'body-parts'\n | 'pharmacy-picker'\n | 'online-pharmacy-picker'\n | 'place-address'\n >\n | GenericQuestionData<'images-alias', IndexedData<ChoiceInputData>, ImagesAliasQuestionOptions>\n | GenericQuestionData<\n 'checkbox-group' | 'hair-loss-frontal' | 'select' | 'multiple' | 'text-select-group',\n IndexedData<ChoiceInputData>\n >\n | GroupedGenericQuestionData<\n 'radio' | 'hair-selector-women' | 'hair-selector-men' | 'hair-loss-stage' | 'hair-loss-other',\n IndexedData<RadioInputData>\n >\n | GroupedGenericQuestionData<'radio-card' | 'profile-selector', IndexedData<RadioCardInputData>>\n | GroupedGenericQuestionData<'language-picker', IndexedData<LanguagePickerData>>\n | GroupedGenericQuestionData<'tile-radio', IndexedData<TileRadioData>>\n\nexport interface FieldData {\n type: 'field'\n className?: string\n id: string\n}\n\nexport interface FieldGroupData {\n type: 'field-group'\n className?: string\n fieldsAndGroups: (FieldData | FieldGroupData)[]\n name?: string\n inline?: boolean\n fullWidth?: boolean\n}\n\nexport interface WorkflowPageData {\n className?: string\n groups?: FieldGroupData[]\n highlightMsg?: string\n questions: IndexedData<QuestionData>\n title?: string\n triggers?: string[]\n /**\n * This field represents a list of `ids` which will be spliced from the workflow groups and inserted into a designated location\n */\n prioritizeIds?: string[]\n}\n\nexport interface WorkflowData {\n createdAt: string\n culDeSacs: EntryData[]\n id: string\n locale?: string\n pages: WorkflowPageData[]\n summaryImageFieldName?: string // this field is used to show the consult summary image\n summarySymptomsFieldName?: string // this field is used to show the consult summary symptoms\n selectedAnswers?: SelectedAnswersData\n walkthroughSlides?: SlideData[]\n /**\n * (optional) the service name this workflow provides\n */\n serviceName?: string\n /**\n * (optional) the description of the service this workflow provides\n */\n serviceDescription?: string\n /**\n * (optional) rules to hide certain payment plans depending on the workflow answers\n */\n hidePlanRules?: HidePlanRule[]\n}\n\nexport interface HidePlanRule {\n /**\n * the stripe plan id from the practice service\n */\n idPlan: string\n /**\n * Questions to apply yup rules on in, if rules are met then hide the plan\n */\n rules: QuestionHidePlanRule[] | QuestionHidePlanRule[][]\n}\n\nexport interface QuestionHidePlanRule {\n /**\n * the id of the question to check the rule on\n */\n questionId: string\n /**\n * a collection of yup validated rules (same exact syntax we used for the workflow formValidation field, please reuse same functions)\n */\n yupRuleValueToHide: any\n}\n\n/**\n * This interface describes an upload of an image (could be a picture, a pdf, a text file, etc.)\n */\nexport interface WorkflowUploadedImage {\n /**\n * Depending on the driver used by WorkflowInput:\n * - 'indexdb': will fetch the image in IndexDB with this id\n * - 'vault': will fetch the image in the vault with this id\n */\n idbId?: string\n /**\n * The name of the image\n */\n name: string\n /**\n * the image data (could be a picture, a pdf, a text file, etc.)\n */\n imageData?: string\n}\n\n/**\n * This interface describes a workflow prepared and ready to be sent to vault\n */\nexport interface PopulatedWorkflowField {\n answer: SelectedAnswerData | WorkflowUploadedImage[] // Actual answer from the workflow\n displayedAnswer?: any // This answer is to be used only when it's impossible to get data from workflow\n kind: string // If we don't store question. We will need that field to at least know the field type\n}\n\nexport interface PopulatedWorkflowData {\n workflowId: string // The workflow id to refer\n workflowCreatedAt: string // The workflow version\n locale?: string\n fields: Record<string, PopulatedWorkflowField> // key corresponds to the QuestionData key in the workflow\n}\n","export interface SearchRequest {\n terms: Terms\n}\n\nexport interface SearchResponse {\n results: SearchResult[]\n}\n\nexport interface SearchResult {\n consultUuid: string\n kind: string\n score: number\n}\n\nexport interface IndexRequest {\n consultUUID: string\n terms: Terms\n}\n\nexport type Terms = Term[]\nexport interface Term {\n kind?: string\n value: string\n}\n\n\nexport enum IndexKind {\n consultUuid,\n consultShortid,\n firstName,\n lastName,\n healthId,\n dob,\n}\n","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 updateConsultByUUID(\n uuidConsult: Uuid,\n consult: {\n statusMedical?: MedicalStatus\n closedReasonType?: ClosedReasonType\n closedReasonDescription?: string\n uuidAssignedDoctor?: Uuid\n neverExpires?: boolean\n },\n uuidPractice?: Uuid,\n uuidRequester?: Uuid\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, consult, {\n params: {\n uuidPractice,\n uuidRequester,\n },\n })\n }\n\n public getConsultFaxStatuses(uuidConsult: string): Promise<ConsultTransmission[]> {\n return this.api.get<ConsultTransmission[]>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, {\n params: {\n kind: TransmissionKind.Fax,\n },\n })\n }\n\n public postConsultTransmission(\n uuidConsult: string,\n nameDriver: string = 'Documo',\n addressOrPhoneToSendTo?: string,\n file?: File,\n nameReceiver?: string,\n txtTransmissionTitle?: string,\n txtTransmissionNotes?: string\n // numTry ?: number,\n // delay ?: number,\n ): Promise<ConsultTransmission> {\n let data = new FormData()\n\n data.append('nameDriverReceiver', nameDriver)\n if (addressOrPhoneToSendTo) {\n data.append('addressReceiver', addressOrPhoneToSendTo)\n }\n if (file) {\n data.append('file', file)\n }\n if (nameReceiver) {\n data.append('nameReceiver', nameReceiver)\n }\n if (txtTransmissionTitle) {\n data.append('txtTransmissionTitle', txtTransmissionTitle)\n }\n if (txtTransmissionNotes) {\n data.append('txtTransmissionNotes', txtTransmissionNotes)\n }\n\n return this.api.post<ConsultTransmission>(`${this.baseURL}/v1/consults/${uuidConsult}/transmissions`, data, {\n headers: { 'Content-Type': 'multipart/form-data;' },\n })\n }\n\n public postConsultFax(uuidConsult: string, addressReceiver: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file)\n }\n\n public postConsultEmail(uuidConsult: string, file: File): Promise<ConsultTransmission> {\n return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file)\n }\n\n public retryConsultFax(uuidConsult: string, transmissionId: string): Promise<ConsultTransmission> {\n return this.api.put<ConsultTransmission>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions/${transmissionId}`,\n { status: TransmissionStatus.Retrying }\n )\n }\n\n public updateConsultTransmissionStatus(\n transmissionId: string,\n uuidConsult: string,\n newStatus: TransmissionStatus\n ): Promise<ConsultTransmission> {\n return this.api.put<ConsultTransmission>(\n `${this.baseURL}/v1/consults/${uuidConsult}/transmissions/${transmissionId}`,\n { status: newStatus }\n )\n }\n}\n","import {\n Drug,\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 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 acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan> {\n return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}/accept`, { uuidConsult })\n }\n\n /**\n * retrieves all the drugs of the specified practice\n * @param uuidPractice\n */\n public async getAllDrugs(uuidPractice: string): Promise<Drug[] | undefined> {\n const res = await this.api.get<{ foundDrugs: Drug[] }>(`${this.baseURL}/v1/drugs/practice/${uuidPractice}`)\n if (res && res.foundDrugs) return res.foundDrugs\n return undefined\n }\n}\n","import { AxiosError } from 'axios'\nimport type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh'\nimport {\n AuthenticationBadRequest,\n AuthenticationFailed,\n AuthenticationServerError,\n AuthenticationUnconfirmedEmail,\n AuthRecoverRequest,\n AuthTokenRequest,\n AuthTokenResponse,\n Base64String,\n IdentityCreateRequest,\n IdentityCreationBadRequest,\n IdentityCreationConflict,\n IdentityCreationFailed,\n IdentityResendConfirmEmailRequest,\n IdentityResponse,\n IdentityUpdateRequest,\n M2MTokenRequest,\n QRCodeRequest,\n QRCodeResponse,\n Tokens,\n Uuid,\n WhoAmIResponse,\n} from '../models'\nimport { APIService } from './api'\n\nexport interface GuardRequestConfig extends AxiosAuthRefreshRequestConfig {\n useRefreshToken: boolean\n}\nexport class GuardService {\n private identityCache: Record<string, IdentityResponse>\n private whoAmICache: Record<string, WhoAmIResponse>\n\n constructor(private api: APIService, private baseURL: string) {\n this.api.setAuthRefreshFn(this.authRefresh.bind(this)) // This is the default behavior for User JWT tokens. If you want other kind of refresh you shall overwrite this call\n this.identityCache = {}\n this.whoAmICache = {}\n }\n\n /**\n * Will replace access and refresh tokens with `tokens`\n *\n * Note:\n * ```typescript\n * setTokens({accessToken: undefined, refreshToken: 'aTokenValue'}) // will erase accessToken and set refreshToken with 'aTokenValue'\n * setTokens({refreshToken: 'aTokenValue'}) // will keep actual value of accessToken and set refreshToken with 'aTokenValue'\n *\n * ```\n * @param tokens\n */\n public setTokens(tokens: Tokens) {\n this.api.setTokens({ ...this.api.getTokens(), ...tokens })\n }\n\n /**\n * Allow to retrieve a M2M token for a service\n *\n * @param req The credentials required to get an access token\n * @returns AuthTokenResponse\n */\n public async m2mToken(req: M2MTokenRequest): Promise<AuthTokenResponse> {\n let resp: AuthTokenResponse | undefined\n\n try {\n let config: AxiosAuthRefreshRequestConfig = {\n skipAuthRefresh: true,\n }\n\n resp = await this.api.post<AuthTokenResponse>(`${this.baseURL}/v1/m2m/token`, req, config)\n\n this.api.setTokens({\n accessToken: resp.accessToken,\n })\n } catch (e) {\n console.error('Error while posting m2m token:', e)\n\n if ((e as any).isAxiosError) {\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new AuthenticationBadRequest()\n case 500:\n throw new AuthenticationServerError()\n case 401:\n default:\n throw new AuthenticationFailed()\n }\n }\n throw new AuthenticationFailed()\n }\n\n return resp\n }\n\n /**\n * Allow to retrieve an access token and a refresh token in order\n * to do authenticated request afterward\n *\n * @param req The credentials required to get an access token\n * @returns AuthTokenResponse\n */\n public async authToken(req: AuthTokenRequest): Promise<AuthTokenResponse> {\n let resp: AuthTokenResponse\n\n try {\n let config: AxiosAuthRefreshRequestConfig = {\n skipAuthRefresh: true,\n }\n\n resp = await this.api.post<AuthTokenResponse>(`${this.baseURL}/v1/auth/token`, req, config)\n\n this.api.setTokens({\n accessToken: resp.accessToken,\n refreshToken: resp.refreshToken,\n })\n } catch (e) {\n console.error('Error while posting auth token:', e)\n\n if ((e as any).isAxiosError) {\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new AuthenticationBadRequest()\n case 424:\n throw new AuthenticationUnconfirmedEmail()\n case 500:\n throw new AuthenticationServerError()\n case 401:\n default:\n throw new AuthenticationFailed()\n }\n }\n throw new AuthenticationFailed()\n }\n return resp\n }\n\n /**\n * Get new access and refresh token\n *\n * @returns AuthTokenResponse\n */\n public async authRefresh(refreshToken?: string): Promise<AuthTokenResponse> {\n let config: GuardRequestConfig = {\n skipAuthRefresh: true,\n useRefreshToken: true,\n }\n return this.api.put<AuthTokenResponse>(`${this.baseURL}/v1/auth/token`, null, config)\n }\n\n /**\n * Call guard to overwrite existing refresh token cookie\n *\n * @returns void\n */\n public async authLogout(): Promise<void> {\n return this.api.get<void>(`${this.baseURL}/v1/auth/logout`)\n }\n\n /**\n * Call guard to attempt account recovery\n *\n * @param req The email address / practice of the account to recover\n * @returns void\n */\n public async authRecover(req: AuthRecoverRequest): Promise<void> {\n return this.api.post<void>(`${this.baseURL}/v1/auth/recover`, req)\n }\n\n /**\n * Allow to create a new identity. The identity will then need to be confirmed\n * via an email link\n *\n * @param req the information about the new identity to create\n * @returns IdentityResponse\n */\n public async identityCreate(req: IdentityCreateRequest): Promise<IdentityResponse> {\n let resp: IdentityResponse\n\n try {\n resp = await this.api.post<IdentityResponse>(`${this.baseURL}/v1/identities`, req)\n this.api.setTokens({\n refreshToken: resp.refreshToken,\n })\n } catch (e) {\n if ((e as any).isAxiosError) {\n const code = (e as AxiosError).response?.status\n switch (code) {\n case 400:\n throw new IdentityCreationBadRequest()\n case 409:\n throw new IdentityCreationConflict()\n case 500:\n default:\n throw new IdentityCreationFailed()\n }\n }\n throw new IdentityCreationFailed()\n }\n return resp\n }\n\n /**\n * Retrieve an identity. Will return public fields only when requested\n * without authentication\n *\n * @param identityID Unique id of the identity to retrieve\n * @param skipCache (default: false) will skip identity cache (not even update it)\n * @returns IdentityResponse\n */\n public async identityGet(identityID: Uuid, skipCache = false): Promise<IdentityResponse> {\n const tokens = this.api.getTokens()\n const cacheKey = (tokens.accessToken ?? '') + (tokens.refreshToken ?? '') + identityID\n\n if (skipCache || !tokens.accessToken || !this.identityCache[cacheKey]) {\n const identity = await this.api.get<IdentityResponse>(`${this.baseURL}/v1/identities/${identityID}`)\n\n if (skipCache) return identity\n\n this.identityCache[cacheKey] = identity\n }\n return this.identityCache[cacheKey]\n }\n\n /**\n * Get information about the current authenticated user\n *\n * @param refreshCache if true it will refresh the whoAmI cache (default: false)\n * @returns WhoAmIResponse\n */\n public async whoAmI(refreshCache: boolean = false): Promise<WhoAmIResponse> {\n const cacheKey = this.api.getTokens().accessToken ?? ''\n if (!this.whoAmICache[cacheKey] || refreshCache) {\n this.whoAmICache[cacheKey] = await this.api.get<WhoAmIResponse>(`${this.baseURL}/v1/auth/whoami`)\n }\n return this.whoAmICache[cacheKey]\n }\n\n /**\n * Update an existing identity\n *\n * @param identityID unique id of identity to update\n * @param req update request\n * @returns IdentityResponse\n */\n public async identityUpdate(identityID: Uuid, req: IdentityUpdateRequest): Promise<IdentityResponse> {\n return this.api.put<IdentityResponse>(`${this.baseURL}/v1/identities/${identityID}`, req)\n }\n\n /**\n * Return base64 data representing a QR code that the\n * current identity need in order to use MFA\n *\n * @param identityID unique id of the identity\n * @param password the identity password (already hashed and in base64)\n * @returns QRCodeResponse\n */\n public async identityMFAQRCode(identityID: Uuid, password: Base64String): Promise<QRCodeResponse> {\n const req: QRCodeRequest = { password }\n return this.api.post<QRCodeResponse>(`${this.baseURL}/v1/identities/${identityID}/mfa`, req, {\n headers: { Accept: 'application/json' },\n })\n }\n\n /**\n * Attempt to resend the email confirmation email\n *\n * @param req IdentityResendConfirmEmailRequest\n * @return void\n */\n public async identitySendConfirmEmail(req: IdentityResendConfirmEmailRequest): Promise<void> {\n return this.api.post<void>(`${this.baseURL}/v1/identity/confirm`, req)\n }\n\n /**\n * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)\n *\n * @param email the customer email\n * @returns IdentityResponse\n */\n public async identityGetByCustomerEmail(email: string): Promise<IdentityResponse> {\n return this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@')))\n }\n\n /**\n * Get an identity using a base64 hash\n *\n * @param b64Hash base64 hash of the identity\n * @returns IdentityResponse\n */\n public async identityGetByHash(b64Hash: string): Promise<IdentityResponse> {\n //TODO: Right now this maps directly to the IdentityGet call.\n //Eventually, with the mapping table method, this would lead to another\n //call (ie: /v1/mapping/[b64Hash]) which would return a blob to decrypt\n //which would contain the real identityID to call IdentityGet with.\n\n //The hash comes in base64 format but it isn't URL safe soe we have to convert\n //to base64URL (see https://en.wikipedia.org/wiki/Base64#The_URL_applications)\n return this.identityGet(b64Hash.replace(/\\+/g, '-').replace(/\\//g, '_'))\n }\n}\n","import {APIService} from \"./api\";\nimport {IndexRequest, SearchRequest, SearchResponse, Terms} from \"../models/search\";\n\nexport class SearchService {\n constructor(private api: APIService, private baseURL: string) {}\n\n /**\n * Creates search indexes for the terms passed in order to be able to search for it in the future\n * @param consultUUID\n * @param terms the search terms to be indexed\n */\n public index(\n consultUUID: string,\n terms: Terms\n ): Promise<any> {\n return this.api.post<IndexRequest>(\n `${this.baseURL}/v1/index`,\n <IndexRequest> {\n consultUUID,\n terms\n }\n )\n }\n\n /**\n * Searches for the consultations corresponding to the search terms entered in the query\n * @param terms array of search terms\n */\n public search(\n terms: Terms\n ): Promise<SearchResponse> {\n return this.api.post<SearchResponse>(\n `${this.baseURL}/v1/search`,\n <SearchRequest> {\n terms\n }\n )\n }\n}","import { hashToBase64String } from '../helpers'\nimport { PaymentStatus, PracticeAccount, Uuid } from '../models'\nimport {\n Assignment,\n AssignmentRequest,\n PaymentIntentRequestMetadata,\n PlanType,\n Practice,\n PracticeConfigKind,\n PracticeConfigs,\n PracticeInvoice,\n PracticePayment,\n PracticePaymentIntent,\n PracticePlan,\n PracticePlanPrices,\n PracticeWorkflow,\n PracticeWorkflowWithTagSpecialty,\n Practitioner,\n PractitionerLicense,\n PractitionerPreference,\n PractitionerQuota,\n PractitionerRole,\n WorkflowType,\n} from '../models/practice'\nimport { APIService } from './api'\n\nexport class PracticeService {\n constructor(private api: APIService, private baseURL: string) {}\n\n /**\n * This function will only work if the service is initialized with\n * an M2M with the scope `practice.practices.get`\n * @returns an array of practices\n */\n public practiceGetAll(): Promise<Practice[]> {\n return this.api.get<Practice[]>(`${this.baseURL}/v1/practices`)\n }\n\n /**\n * This function get the practice from the URL of a practice\n * It is the entry point of our web apps\n * @param practiceURL URL of the practice to search\n * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set\n * @param accounts (optional) if set true it the Practice field accounts will be set\n * @returns the found practice or undefined\n */\n public practiceGetFromURL(\n practiceURL: string,\n params?: {\n hydratePracticeConfigs?: boolean\n accounts?: boolean\n }\n ): Promise<Practice | undefined> {\n return this.api.get<Practice | undefined>(`${this.baseURL}/v1/practices`, {\n params: {\n url_practice: practiceURL,\n ...params,\n },\n })\n }\n\n public practiceGetFromUuid(practiceUuid: Uuid, locale?: string, withAccounts?: boolean): Promise<Practice> {\n return this.api.get<Practice>(`${this.baseURL}/v1/practices/${practiceUuid}`, {\n params: { locale, accounts: withAccounts },\n })\n }\n\n /// Practice Configs\n\n /**\n * This function retrieves all configs of a specific practice\n * @param practiceUuid uuid of the practice\n * @returns the practice configs\n */\n public practiceConfigGetFromPracticeUuid(practiceUuid: Uuid): Promise<PracticeConfigs[]> {\n return this.api.get<PracticeConfigs[]>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`)\n }\n\n /**\n * This function retrieves a specific config of a practice\n * @param practiceUuid uuid of the practice\n * @param kind of the config\n * @returns the practice config\n */\n public practiceConfigGetByKindForPracticeUuid(\n practiceUuid: Uuid,\n kind: PracticeConfigKind\n ): Promise<PracticeConfigs> {\n return this.api.get<PracticeConfigs>(`${this.baseURL}/v1/practices/${practiceUuid}/configs/${kind}`)\n }\n\n /**\n * This function creates a config for a specific practice\n * @param practiceUuid uuid of the practice\n * @param config the config to add to the practice\n * @returns the created practice config\n */\n public practiceConfigCreateForPracticeUuid(practiceUuid: Uuid, config: PracticeConfigs): Promise<PracticeConfigs> {\n return this.api.post<PracticeConfigs>(`${this.baseURL}/v1/practices/${practiceUuid}/configs`, config)\n }\n\n /**\n * This function updates a specific config of a practice\n * @param practiceUuid uuid of the practice\n * @param config the config to update\n * @returns the practice config\n */\n public practiceConfigUpdate(config: PracticeConfigs): Promise<PracticeConfigs> {\n return this.api.put<PracticeConfigs>(\n `${this.baseURL}/v1/practices/${config.uuidPractice}/configs/${config.kind}`,\n config\n )\n }\n\n /// Accounts\n public practiceGetAccounts(practiceUuid: Uuid): Promise<PracticeAccount[]> {\n return this.api.get<PracticeAccount[]>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts`)\n }\n\n public practiceGetAccount(practiceUuid: Uuid, accountUuid: Uuid): Promise<PracticeAccount> {\n return this.api.get<PracticeAccount>(`${this.baseURL}/v1/practices/${practiceUuid}/accounts/${accountUuid}`)\n }\n\n /**\n * Get the PracticeWorkflows of a specific practice\n * @param practiceUuid the uuid of the practice\n * @param kind (optional) the kind of WorkflowType to filter in\n * @returns a list of PracticeWorkflow\n */\n public practiceGetWorkflows(practiceUuid: Uuid, kind?: WorkflowType): Promise<PracticeWorkflow[]> {\n return this.api.get<PracticeWorkflow[]>(`${this.baseURL}/v1/practices/${practiceUuid}/workflows`, {\n params: { kind },\n })\n }\n\n public practiceGetWorkflow(\n practiceUuid: Uuid,\n workflowType: WorkflowType\n ): Promise<PracticeWorkflowWithTagSpecialty> {\n return this.api.get<PracticeWorkflowWithTagSpecialty>(\n `${this.baseURL}/v1/practices/${practiceUuid}/workflows/${workflowType}`\n )\n }\n\n /// Plans\n public practiceGetPlans(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePlan[]> {\n return this.api.get<PracticePlan[]>(`${this.baseURL}/v1/practices/${practiceUuid}/plans`, {\n params: { kind: planType },\n })\n }\n\n public practiceGetPlan(practiceUuid: Uuid, planId: number): Promise<PracticePlan> {\n return this.api.get<PracticePlan>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}`)\n }\n\n public practiceGetPlanPrices(practiceUuid: Uuid, planId: number): Promise<PracticePlanPrices> {\n return this.api.get<PracticePlanPrices>(`${this.baseURL}/v1/practices/${practiceUuid}/plans/${planId}/prices`)\n }\n\n // Payments\n public practiceGetPayments(\n practiceUuid: Uuid,\n statusPayment?: PaymentStatus,\n withConsultUUIDNULL?: boolean,\n perPage?: number,\n indexPage?: number\n ): Promise<PracticePayment[]> {\n return this.api.get<PracticePayment[]>(`${this.baseURL}/v1/practices/${practiceUuid}/payments`, {\n params: {\n status: statusPayment,\n withConsultUUIDNULL,\n perPage,\n indexPage,\n },\n })\n }\n\n public practiceGetPayment(practiceUuid: Uuid, idStripeInvoiceOrPaymentIntent: string): Promise<PracticePayment> {\n return this.api.get<PracticePayment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/${idStripeInvoiceOrPaymentIntent}`\n )\n }\n\n public practiceGetPaymentForStripePaymentIntentWithID(\n practiceUuid: Uuid,\n stripePaymentIntentId: number\n ): Promise<PracticePayment> {\n return this.api.get<PracticePayment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/${stripePaymentIntentId}`\n )\n }\n\n // Payments Intent\n public practiceGetPaymentsIntents(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePaymentIntent[]> {\n return this.api.get<PracticePaymentIntent[]>(`${this.baseURL}/v1/practices/${practiceUuid}/payments/intents`, {\n params: { kind: planType },\n })\n }\n\n /**\n * This function return the user hased email to be use for creating payment intent\n * @param email the email to hash\n * @returns a hashed email\n */\n public getPaymentIntentHashedEmail(email: string): string {\n return hashToBase64String(email.toLowerCase())\n }\n\n /**\n * Creates a PracticePaymentIntent\n * @param practiceUuid the uuid of the practice\n * @param planId the plan id to use\n * @param userEmail the email address of the user\n * @param isoLocality (optional) the desired locality\n * @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)\n * @param promotionCode (optional) promotion code to apply\n * @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).\n * @returns\n */\n public practiceCreatePaymentsIntent(\n practiceUuid: Uuid,\n planId: number,\n userEmail: string,\n isoLocality?: string,\n url_subdomain?: string,\n requestMetadata?: PaymentIntentRequestMetadata\n ): Promise<PracticePaymentIntent> {\n return this.api.post<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/`,\n {\n idPlan: planId,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n isoLocality,\n requestMetadata,\n },\n { params: { url_subdomain } }\n )\n }\n\n public practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent> {\n return this.api.get<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${paymentIntentId}`\n )\n }\n\n /**\n * Updates a PracticePaymentIntent\n * @param practiceUuid the practice uuid\n * @param idPraticePaymentIntent the id of the PracticePaymentIntent to update\n * @param practicePaymentIntent the desired PracticePaymentIntent\n * @param userEmail the email of the user\n * @param promotionCode (optional) promotional code to apply\n * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.\n * @returns the updated PracticePaymentIntent\n */\n public practiceUpdatePaymentsIntent(\n practiceUuid: string,\n idPraticePaymentIntent: number,\n practicePaymentIntent: PracticePaymentIntent,\n userEmail: string,\n promotionCode?: string,\n finalize?: boolean\n ) {\n return this.api.put<PracticePaymentIntent>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${idPraticePaymentIntent}`,\n {\n ...practicePaymentIntent,\n hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,\n },\n { params: { promotionCode, finalize } }\n )\n }\n\n /**\n * Invoice\n * @param practiceUuid UUID of the practice to get the invoice from\n * @param invoiceId ID of the invoice in stripe\n */\n public getInvoice(practiceUuid: Uuid, invoiceId: string): Promise<PracticeInvoice> {\n return this.api.get<PracticeInvoice>(\n `${this.baseURL}/v1/practices/${practiceUuid}/payments/invoices/${invoiceId}`\n )\n }\n\n // Practitioner\n public practiceGetPractitioners(practiceUuid: Uuid): Promise<Practitioner[]> {\n return this.api.get<Practitioner[]>(`${this.baseURL}/v1/practices/${practiceUuid}/practitioners`)\n }\n\n public practiceUpdatePractitioner(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: Practitioner\n ): Promise<Practitioner> {\n return this.api.put<Practitioner>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}`,\n requestBody\n )\n }\n\n public practiceGetPractitioner(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<Practitioner> {\n return this.api.get<Practitioner>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}`\n )\n }\n\n // Practitioner Licenses\n public practiceGetPractitionerLicenses(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerLicense[]> {\n return this.api.get<PractitionerLicense[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses`\n )\n }\n\n public practiceCreatePractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerLicense\n ): Promise<PractitionerLicense> {\n return this.api.post<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses`,\n requestBody\n )\n }\n\n public practiceUpdatePractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n licenseId: number,\n requestBody: PractitionerLicense\n ): Promise<PractitionerLicense> {\n return this.api.put<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses/${licenseId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerLicense(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n licenseId: number\n ): Promise<PractitionerLicense> {\n return this.api.get<PractitionerLicense>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/licenses/${licenseId}`\n )\n }\n\n // Practitioner Preferences\n public practiceGetPractitionerPreferences(\n practiceUuid: Uuid,\n practitionerUuid: Uuid\n ): Promise<PractitionerPreference[]> {\n return this.api.get<PractitionerPreference[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences`\n )\n }\n\n public practiceCreatePractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerPreference\n ): Promise<PractitionerPreference> {\n return this.api.post<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences`,\n requestBody\n )\n }\n\n public practiceUpdatePractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n preferenceId: number,\n requestBody: PractitionerPreference\n ): Promise<PractitionerPreference> {\n return this.api.put<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences/${preferenceId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerPreference(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n preferenceId: number\n ): Promise<PractitionerPreference> {\n return this.api.get<PractitionerPreference>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/preferences/${preferenceId}`\n )\n }\n\n // Practitioner Roles\n public practiceGetPractitionerRoles(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerRole[]> {\n return this.api.get<PractitionerRole[]>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`\n )\n }\n\n public practiceCreatePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n requestBody: PractitionerRole\n ): Promise<PractitionerRole> {\n return this.api.post<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`,\n requestBody\n )\n }\n\n public practiceDeletePractitionerRoles(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerRole> {\n return this.api.deleteRequest<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles`\n )\n }\n\n public practiceUpdatePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number,\n requestBody: PractitionerRole\n ): Promise<PractitionerRole> {\n return this.api.put<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`,\n requestBody\n )\n }\n\n public practiceGetPractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number\n ): Promise<PractitionerRole> {\n return this.api.get<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`\n )\n }\n\n public practiceDeletePractitionerRole(\n practiceUuid: Uuid,\n practitionerUuid: Uuid,\n roleId: number\n ): Promise<PractitionerRole> {\n return this.api.deleteRequest<PractitionerRole>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/roles/${roleId}`\n )\n }\n\n // Practitioner signature\n\n /**\n * This function returns the practitioner's signature as a Blob\n * @param practiceUuid the practice uuid of the practitioner\n * @param practitionerUuid the practitioner uuid\n * @returns a blob representing the signature\n */\n public practiceGetPractitionerSignature(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<Blob> {\n return this.api.get<Blob>(\n `${this.baseURL}/v1/practices/${practiceUuid}/practitioners/${practitionerUuid}/signature`,\n { responseType: 'blob' }\n )\n }\n\n // Assignments\n public practiceGetAssignments(practiceUuid: Uuid): Promise<Assignment[]> {\n return this.api.get<Assignment[]>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`)\n }\n\n public practiceCreateAssignment(practiceUuid: Uuid, requestBody: AssignmentRequest): Promise<Assignment> {\n return this.api.post<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments`, requestBody)\n }\n\n public practiceUpdateAssignment(\n practiceUuid: Uuid,\n assignmentId: number,\n requestBody: Assignment\n ): Promise<Assignment> {\n return this.api.put<Assignment>(\n `${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`,\n requestBody\n )\n }\n\n public practiceGetAssignment(practiceUuid: Uuid, assignmentId: number): Promise<Assignment> {\n return this.api.get<Assignment>(`${this.baseURL}/v1/practices/${practiceUuid}/assignments/${assignmentId}`)\n }\n\n // Quotas\n public practiceGetQuotas(practiceUuid: Uuid): Promise<PractitionerQuota[]> {\n return this.api.get<PractitionerQuota[]>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas`)\n }\n\n public practiceGetQuota(practiceUuid: Uuid, quotaId: number): Promise<PractitionerQuota> {\n return this.api.get<PractitionerQuota>(`${this.baseURL}/v1/practices/${practiceUuid}/quotas/${quotaId}`)\n }\n}\n","import { APIService } from './api'\nimport {\n ClosedReasonType,\n Consult,\n DataCreateResponse,\n LockboxDataRequest,\n MedicalStatus,\n ResumeConsultEmailRequest,\n Uuid,\n} from '../models'\nexport class TellerService {\n constructor(private api: APIService, private baseURL: string) { }\n\n public async lockboxDataStore(\n lockboxUuid: Uuid,\n req: LockboxDataRequest,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid,\n options: {\n updateMedicalStatus: boolean\n } = { updateMedicalStatus: true },\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`, req, {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n update_medical_status: options.updateMedicalStatus,\n },\n })\n }\n\n public updateConsultByUUID(\n patientUuid: Uuid,\n uuidConsult: Uuid,\n statusMedical: MedicalStatus,\n closedReasonType?: ClosedReasonType,\n closedReasonDescription?: string,\n neverExpires?: boolean\n ): Promise<Consult> {\n return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, {\n patientUuid,\n statusMedical,\n closedReasonType,\n closedReasonDescription,\n neverExpires,\n })\n }\n\n /**\n * This function notifies teller that the fax sent for a specific consult did not get through\n * @todo - Make service only exposed route\n * @param practiceUuid the practice uuid linked to the consult\n * @param consultationUuid the consultation uuid\n * @param consultationShortId the consultation short id\n * @param fax the address where to send the fax\n * @returns void\n */\n public notifyFaxFailed(practiceUuid: Uuid, consultationUuid: Uuid, consultationShortId: string, fax: string) {\n return this.api.post<void>(\n `${this.baseURL}/v1/fax-failed`,\n {\n consultationUuid,\n consultationShortId,\n fax,\n },\n {\n params: { practice_uuid: practiceUuid },\n }\n )\n }\n\n /**\n * This function let's you reassign a practictioner to a consult and send a notification email\n * @todo - Make service only exposed route\n * @param uuidConsult the uuid of the consult to reassign\n * @param newPractitionerUuid the uuid of the practitioner that will get reassigned\n */\n public reassignmentEmail(uuidConsult: Uuid, newPractitionerUuid: Uuid) {\n return this.api.post<void>(`${this.baseURL}/v1/consult/${uuidConsult}/reassignment-email`, {\n newPractitionerUuid,\n })\n }\n\n /**\n * This function will send an email to the patientUuid, saying that the online practice has been sent a fax successfully\n * @todo - Make service only exposed route\n * @param consult\n * @param patientUuid\n * @returns void\n */\n public sendOnlineFaxSuccessfulEmail(consult: Consult, patientUuid: Uuid): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/online-fax-notify`, { consult, patientUuid })\n }\n\n /**\n * This function will send an email to patient to allow them to resume the consult.\n * @param req the body of the resume consult request\n * @returns void\n */\n public sendResumeConsultEmail(req: ResumeConsultEmailRequest): Promise<void> {\n return this.api.post(`${this.baseURL}/v1/resume-consult-email`, req)\n }\n}\n","import { APIService } from './api'\nimport {\n DataCreateResponse,\n DataResponse,\n GrantedLockboxes,\n LockboxCreateResponse,\n LockboxDataRequest,\n LockboxGrantRequest,\n LockboxManifest,\n SharedSecretResponse,\n Uuid,\n EncryptedVaultIndex,\n IndexKey,\n EncryptedIndexEntry\n} from '../models'\n\nexport class VaultService {\n constructor(private api: APIService, private baseURL: string) { }\n\n public async lockboxCreate(lockboxMetadata?: Object): Promise<LockboxCreateResponse> {\n return this.api.post<LockboxCreateResponse>(\n `${this.baseURL}/v1/lockbox`,\n lockboxMetadata\n )\n }\n\n public async lockboxMetadataAdd(\n lockboxUuid: Uuid,\n lockboxMetadata: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<LockboxCreateResponse> {\n return this.api.put<LockboxCreateResponse>(\n `${this.baseURL}/v1/lockbox/${lockboxUuid}`,\n lockboxMetadata,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n public async lockboxSecretGet(\n lockboxUuid: Uuid,\n lockboxOwnerUuid?: Uuid\n ): Promise<SharedSecretResponse> {\n return this.api.get<SharedSecretResponse>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/secret`,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n public async lockboxGrant(\n lockboxUuid: Uuid,\n req: LockboxGrantRequest,\n lockboxOwnerUuid?: Uuid\n ): Promise<void> {\n return this.api.post<void>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/grant`,\n req,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid } }\n )\n }\n\n /**\n * Get all lockboxes granted to user\n * @param filter filter of lockbox metadata\n * @returns decrypted lockboxes granted to user\n */\n public async grantsGet(): Promise<GrantedLockboxes> {\n return this.api.get<GrantedLockboxes>(`${this.baseURL}/v1/grants`)\n }\n\n /**\n * This function create or update a data into the vault.\n * @note At creation it is necessary to have all `req` filled\n * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.\n * @param lockboxUuid The lockbox uuid the data will be stored in\n * @param req The request (please see notes)\n * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)\n * @param previousDataUuid The data uuid of the data you want to update\n * @returns \n */\n public async lockboxDataStore(\n lockboxUuid: Uuid,\n req: LockboxDataRequest,\n lockboxOwnerUuid?: Uuid,\n previousDataUuid?: Uuid\n ): Promise<DataCreateResponse> {\n return this.api.post<DataCreateResponse>(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`,\n req,\n {\n params: {\n lockbox_owner_uuid: lockboxOwnerUuid,\n data_uuid: previousDataUuid,\n },\n }\n )\n }\n\n public async lockboxDataGet(\n lockboxUuid: Uuid,\n dataUuid: Uuid,\n lockboxOwnerUuid?: Uuid,\n stream: boolean = true\n ): Promise<DataResponse> {\n let data = await this.api.get(\n `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data/${dataUuid}`,\n { params: { lockbox_owner_uuid: lockboxOwnerUuid, stream } }\n )\n\n // returned as stream, we need to put inside a DataResponse object\n if (stream)\n return { data }\n\n return data\n }\n\n public async lockboxManifestGet(\n lockboxUuid: Uuid,\n filter?: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<LockboxManifest> {\n return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}`, {\n params: { lockbox_owner_uuid: lockboxOwnerUuid, filter },\n })\n }\n\n public async lockboxMetadataGet(\n lockboxUuid: Uuid,\n fields: string[],\n groupby: string[],\n filter?: Object,\n lockboxOwnerUuid?: Uuid\n ): Promise<any[]> {\n return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/metadata`, {\n params: { lockbox_owner_uuid: lockboxOwnerUuid, fields, groupby, filter },\n })\n }\n\n /**\n * inserts or updates encrypted index entries\n * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`\n * @note if a uuid for an entry is provided, the service will perform an update\n * @param entries the encrypted index data\n * @param indexOwnerUuid\n */\n public async vaultIndexPut(entries: EncryptedVaultIndex, indexOwnerUuid?: Uuid): Promise<void> {\n return this.api.put(`${this.baseURL}/v1/index`,\n entries,\n {\n params: {\n index_owner_uuid: indexOwnerUuid,\n },\n }\n )\n }\n\n /**\n * inserts or updates index snapshot for the provided index owner\n * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`\n * @param entry the encrypted index snapshot\n */\n public async vaultIndexSnapshotPut(entry: EncryptedIndexEntry): Promise<void> {\n return this.api.put(`${this.baseURL}/v1/index-snapshot`, entry)\n }\n\n /**\n * Retrieves the encrypted index from the vault for the requesting user\n * @note index keys can be specified to narrow the scope of index being requested\n * @param indexKeys accepted index fields determined by vault\n * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry\n * @param timestamp the minimum timestamp that index entries were created\n * @returns the encrypted index\n */\n public async vaultIndexGet(indexKeys: IndexKey[], identifiers?: string[], timestamp?: Date): Promise<EncryptedVaultIndex> {\n return this.api.get<EncryptedVaultIndex>(`${this.baseURL}/v1/index`, {\n params: { index_keys: indexKeys, identifiers, timestamp },\n })\n }\n}\n","import { WorkflowData } from '../models/workflow'\nimport { APIService } from './api'\n\nexport class WorkflowService {\n private v1Url: string\n\n constructor(private api: APIService, url: string) {\n this.v1Url = `${url}/v1`\n }\n\n /**\n * This function returns all workflows\n * @returns desired workflow\n */\n public getWorkflows(): Promise<WorkflowData[]> {\n return this.api.get<WorkflowData[]>(`${this.v1Url}/workflows`)\n }\n\n /**\n * This function retrieves a workflow. If `locale` is not found, it will try to find 'en' version of it.\n * By default, will return most recent workflow of a specific `id`. `createdAt` can be used to select older version.\n * @param id The uuid of the workflow\n * @param locale (optional) The desired locale of the workflow (default: 'en')\n * @param createdAt (optional) The creation date of the workflow (also used for versionning)\n * @returns desired workflow\n */\n public getWorkflow(\n id: string,\n locale?: string,\n createdAt?: string\n ): Promise<WorkflowData> {\n return this.api.get<WorkflowData>(`${this.v1Url}/workflows/${id}`, {\n params: { locale, createdAt },\n })\n }\n}\n","import { ServiceCollection, ServiceCollectionRequest } from '../models'\nimport {\n APIService,\n ConsultService,\n DiagnosisService,\n GuardService,\n PracticeService,\n SearchService,\n TellerService,\n VaultService,\n WorkflowService,\n} from '../services'\n\n/**\n * This function is used to initialize services with a provided url\n * @param services an object containing the url of the services to init\n * @param authenticationCallback (optional) the authentification callback. Called when the token were not able to be refreshed.\n * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)\n * @returns an instance of each services with a provided url\n */\nexport const init = (\n services: ServiceCollectionRequest,\n authenticationCallback?: (err: Error, practiceUuid?: string) => void,\n useLocalStorage = true\n): ServiceCollection => {\n const {\n tellerBaseURL,\n practiceBaseURL,\n consultBaseURL,\n vaultBaseURL,\n guardBaseURL,\n searchBaseURL,\n workflowBaseURL,\n diagnosisBaseURL,\n } = services\n\n const apiService = new APIService(useLocalStorage, undefined, authenticationCallback)\n\n return {\n apiService,\n tellerService: tellerBaseURL ? new TellerService(apiService, tellerBaseURL) : undefined,\n practiceService: practiceBaseURL ? new PracticeService(apiService, practiceBaseURL) : undefined,\n consultService: consultBaseURL ? new ConsultService(apiService, consultBaseURL) : undefined,\n vaultService: vaultBaseURL ? new VaultService(apiService, vaultBaseURL) : undefined,\n guardService: guardBaseURL ? new GuardService(apiService, guardBaseURL) : undefined,\n searchService: searchBaseURL ? new SearchService(apiService, searchBaseURL) : undefined,\n workflowService: workflowBaseURL ? new WorkflowService(apiService, workflowBaseURL) : undefined,\n diagnosisService: diagnosisBaseURL ? new DiagnosisService(apiService, diagnosisBaseURL) : undefined,\n }\n}\n"],"names":["hashToBase64String","value","Buffer","from","sha256","update","digest","toString","AssistantType","TransmissionKind","TransmissionStatus","ConsultType","FeeStatus","MedicalStatus","TaskStatus","ClosedReasonType","VisibilityType","DrugType","PrescriptionStatus","PlanStatus","runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","AxiosService","config","axios","apiRequest","url","data","headers","res","apiRequestHeader","headerToRetrieve","toLowerCase","get","deleteRequest","post","put","patch","head","APIService","useLocalStorage","tokenRefreshFailureCallback","interceptors","request","use","token","useRefreshToken","getTokens","refreshToken","accessToken","Authorization","createAuthRefreshInterceptor","_this","failedRequest","authRefreshFn","setTokens","tokenResp","response","console","statusCodes","setAuthRefreshFn","tokens","localStorage","setItem","JSON","stringify","item","getItem","parse","ApisPracticeManager","serviceCollReq","getAuthTokenCbk","Map","practiceUuid","practiceInstance","practiceInstances","cacheKey","newPracticeInstance","init","authTokenFunc","guardService","log","apiService","set","WorkflowType","RateDimension","PlanType","PaymentStatus","PractitionerStatus","AssignmentStatus","PractitionnerRoleType","OtherRoleType","LicenseStatus","PeriodType","SyncStatus","PracticeEmailKind","PracticeConfigKind","StripePriceType","PaymentIntentRequestMetadataKind","IndexKey","DocumentType","InputApplyFunctions","MetadataCategory","IndexKind","AuthenticationFailed","AuthenticationBadRequest","AuthenticationServerError","AuthenticationUnconfirmedEmail","IdentityCreationFailed","IdentityCreationBadRequest","IdentityCreationConflict","VaultDataMissing","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","updateConsultByUUID","consult","getConsultFaxStatuses","kind","Fax","postConsultTransmission","nameDriver","addressOrPhoneToSendTo","file","nameReceiver","txtTransmissionTitle","txtTransmissionNotes","FormData","append","postConsultFax","addressReceiver","postConsultEmail","retryConsultFax","transmissionId","status","Retrying","updateConsultTransmissionStatus","newStatus","DiagnosisService","getDiagnoses","getDiagnosisByUuid","uuidDiagnosis","createDiagnosis","diagnosis","updateDiagnosis","uuid","getTreatmentsFromDiagnosisUuid","diagnosisUuid","getTreatmentPlansFromConsultUuid","createTreatment","treatmentRequest","getTreatmentPlansPopulatedFromConsultUuid","populated","postPlans","plans","updateTreatmentPlan","uuidPlan","diagnosisRequest","plan","refill","acceptTreatmentPlan","getAllDrugs","foundDrugs","GuardService","authRefresh","bind","identityCache","whoAmICache","m2mToken","req","skipAuthRefresh","resp","_context","isAxiosError","code","_e$response","authToken","_context2","_e$response2","authLogout","authRecover","identityCreate","_context6","_e$response3","identityGet","identityID","skipCache","identity","whoAmI","refreshCache","identityUpdate","identityMFAQRCode","password","Accept","identitySendConfirmEmail","identityGetByCustomerEmail","email","identityGetByHash","substring","indexOf","b64Hash","replace","SearchService","index","consultUUID","terms","search","PracticeService","practiceGetAll","practiceGetFromURL","practiceURL","url_practice","practiceGetFromUuid","locale","withAccounts","accounts","practiceConfigGetFromPracticeUuid","practiceConfigGetByKindForPracticeUuid","practiceConfigCreateForPracticeUuid","practiceConfigUpdate","practiceGetAccounts","practiceGetAccount","accountUuid","practiceGetWorkflows","practiceGetWorkflow","workflowType","practiceGetPlans","planType","practiceGetPlan","planId","practiceGetPlanPrices","practiceGetPayments","statusPayment","withConsultUUIDNULL","practiceGetPayment","idStripeInvoiceOrPaymentIntent","practiceGetPaymentForStripePaymentIntentWithID","stripePaymentIntentId","practiceGetPaymentsIntents","getPaymentIntentHashedEmail","practiceCreatePaymentsIntent","userEmail","isoLocality","url_subdomain","requestMetadata","idPlan","hashUserEmail","practiceGetPaymentsIntent","paymentIntentId","practiceUpdatePaymentsIntent","idPraticePaymentIntent","practicePaymentIntent","promotionCode","finalize","getInvoice","invoiceId","practiceGetPractitioners","practiceUpdatePractitioner","practitionerUuid","requestBody","practiceGetPractitioner","practiceGetPractitionerLicenses","practiceCreatePractitionerLicense","practiceUpdatePractitionerLicense","licenseId","practiceGetPractitionerLicense","practiceGetPractitionerPreferences","practiceCreatePractitionerPreference","practiceUpdatePractitionerPreference","preferenceId","practiceGetPractitionerPreference","practiceGetPractitionerRoles","practiceCreatePractitionerRole","practiceDeletePractitionerRoles","practiceUpdatePractitionerRole","roleId","practiceGetPractitionerRole","practiceDeletePractitionerRole","practiceGetPractitionerSignature","responseType","practiceGetAssignments","practiceCreateAssignment","practiceUpdateAssignment","assignmentId","practiceGetAssignment","practiceGetQuotas","practiceGetQuota","quotaId","TellerService","lockboxDataStore","lockboxUuid","lockboxOwnerUuid","previousDataUuid","options","updateMedicalStatus","lockbox_owner_uuid","data_uuid","update_medical_status","patientUuid","statusMedical","closedReasonType","closedReasonDescription","neverExpires","notifyFaxFailed","consultationUuid","consultationShortId","fax","practice_uuid","reassignmentEmail","newPractitionerUuid","sendOnlineFaxSuccessfulEmail","sendResumeConsultEmail","VaultService","lockboxCreate","lockboxMetadata","lockboxMetadataAdd","lockboxSecretGet","lockboxGrant","grantsGet","lockboxDataGet","dataUuid","stream","lockboxManifestGet","filter","lockboxMetadataGet","fields","groupby","vaultIndexPut","entries","indexOwnerUuid","index_owner_uuid","vaultIndexSnapshotPut","vaultIndexGet","indexKeys","identifiers","timestamp","index_keys","WorkflowService","v1Url","getWorkflows","getWorkflow","id","createdAt","services","authenticationCallback","tellerBaseURL","practiceBaseURL","consultBaseURL","vaultBaseURL","guardBaseURL","searchBaseURL","workflowBaseURL","diagnosisBaseURL","tellerService","practiceService","consultService","vaultService","searchService","workflowService","diagnosisService"],"mappings":"0PAQgBA,EAAmBC,UACxBC,SAAOC,KAAKC,WAASC,OAAOJ,GAAOK,OAAO,OAAQ,OAAOC,SAAS,8uDCTjEC,EAiBAC,EAUAC,EA8BAC,EAKAC,EASAC,EAWAC,EAQAC,EC1FAC,EA+CAC,EA4BAC,EAqBAC,mBCzFZ,IAAIC,EAAW,SAAUC,GAGvB,IAAIC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,gBAE/C,SAASC,EAAOC,EAAKC,EAAKpC,GAOxB,OANAsB,OAAOe,eAAeF,EAAKC,EAAK,CAC9BpC,MAAOA,EACPsC,YAAY,EACZC,cAAc,EACdC,UAAU,IAELL,EAAIC,GAEb,IAEEF,EAAO,GAAI,IACX,MAAOO,GACPP,EAAS,SAASC,EAAKC,EAAKpC,GAC1B,OAAOmC,EAAIC,GAAOpC,GAIt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