import { PlaceData } from '.' export enum WorkflowType { Onboard = 'Onboard', Followup = 'Followup', Renew = 'Renew', DataRetrieve = 'DataRetrieve', } export enum RateDimension { RatioOnTotal = 'RatioOnTotal', FixedOnTotal = 'FixedOnTotal', RatioPlatformFee = 'RatioPlatformFee', FixedPlatformFee = 'FixedPlatformFee', RatioOnPlatformFeeTotal = 'RatioOnPlatformFeeTotal', FixedOnPlatformFeeTotal = 'FixedOnPlatformFeeTotal', RatioOnItem = 'RatioOnItem', FixedOnItem = 'FixedOnItem', } export enum PlanType { Onboard = 'Onboard', Followup = 'Followup', Renew = 'Renew', DataRetrieve = 'DataRetrieve', } export enum PaymentStatus { Pending = 'Pending', Success = 'Success', Failure = 'Failure', Canceled = 'Canceled', SuccessAndDelivered = 'SuccessAndDelivered', } export enum PractitionerStatus { Practicing = 'Practicing', Retired = 'Retired', NotInvolvedAnymore = 'NotInvolvedAnymore', Deactivated = 'Deactivated', Flagged = 'Flagged', InConflict = 'InConflict', Delicensed = 'Delicensed', } export enum AssignmentStatus { Assigned = 'Assigned', Reassigned = 'Reassigned', Cancelled = 'Cancelled', } export enum PractitionnerRoleType { Doctor = 'Doctor', MedicalAssistant = 'MedicalAssistant', MedicalSecretary = 'MedicalSecretary', Nurse = 'Nurse', Specialist = 'Specialist', LabAssistant = 'LabAssistant', Administrative = 'Administrative', ManualDispatcher = 'ManualDispatcher', Other = 'Other', } export enum OtherRoleType { Patient = 'Patient', User = 'User', System = 'System', } export type AllRoleType = OtherRoleType | PractitionnerRoleType export enum LicenseStatus { Valid = 'Valid', Invalid = 'Invalid', Expired = 'Expired', NA = 'NA', Removed = 'Removed', } export enum PeriodType { PerYear = 'PerYear', PerQuarter = 'PerQuarter', PerMonth = 'PerMonth', PerWeek = 'PerWeek', PerBusinessDay = 'PerBusinessDay', PerNonBusinessDay = 'PerNonBusinessDay', PerDay = 'PerDay', PerHour = 'PerHour', } export enum SyncStatus { Requested = 'Requested', Started = 'Started', Succeeded = 'Succeeded', Failed = 'Failed', Cancelled = 'Cancelled', } export enum PracticeEmailKind { SignedUp = 'SignedUp', Onboarded = 'Onboarded', OnboardedPractitioner = 'OnboardedPractitioner', OnboardedPatient = 'OnboardedPatient', Answered = 'Answered', ToAnswer = 'ToAnswer', FollowedUp = 'FollowedUp', Renewed = 'Renewed', DataRetrieved = 'DataRetrieved', Closed = 'Closed', PasswordRecovery = 'PasswordRecovery', FaxFailed = 'FaxFailed', ExamResult = 'ExamResult', Reassigned = 'Reassigned', OnlinePharmacyFaxSent = 'OnlinePharmacyFaxSent', ResumeConsult = 'ResumeConsult', } export interface PracticeAccount { id?: number ///optional for insertion uuidPractice: string isoLocality?: string idStripeAccount?: string emailBillingContact: string urlSubdomain?: string } /** * Defines all the practice config kind. * * Please respect the following when defining a new practice config: * - be really specific on its role * - all configs needs to have default values in app * - the default behavior should always to be display the feature. * In other words, practice configs should either be used to hide a functionnality or overwrite a default behavior. * 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). * */ export enum PracticeConfigKind { PatientConsultCard = 'PatientConsultCard', PracticeChatSupport = 'PracticeChatSupport', PracticeCloseConsultationTypes = 'PracticeCloseConsultationTypes', PracticeConsultTabs = 'PracticeConsultTabs', PracticeConfigExample = 'PracticeConfigExample', PracticeCookieBanner = 'PracticeCookieBanner', PracticeCssVariables = 'PracticeCssVariables', PracticeFontsLinks = 'PracticeFontsLinks', PracticeLocaleSwitcher = 'PracticeLocaleSwitcher', PracticePharmacyPicker = 'PracticePharmacyPicker', PracticePrescriptionFields = 'PracticePrescriptionFields', PractitionerChatbox = 'PractitionerChatbox', PractitionerConsultList = 'PractitionerConsultList', PractitionerSearch = 'PractitionerSearch', PracticeRegisterWalkthrough = 'PracticeRegisterWalkthrough', PracticeExamsAndResults = 'PracticeExamsAndResults', PracticeLayout = 'PracticeLayout', PracticeAddressField = 'PracticeAddressField', PracticeDiagnosisAndTreatment = 'PracticeDiagnosisAndTreatment', PracticeInfoLetterDiscount = 'PracticeInfoLetterDiscount', } /** * Defines the close consultation types to hide in the close consultation modal of a practice */ export type PracticeConfigPracticeCloseConsultationTypes = PracticeConfig< PracticeConfigKind.PracticeCloseConsultationTypes, { /** * Should hide item with value "Completed" */ hideCompleted?: boolean /** * Should hide item with value "Requires-in-person" */ hideRequiresInPerson?: boolean /** * Should hide item with value "Other" */ hideOther?: boolean /** * Should hide item with value "Not-a-disease" */ hideNotADisease?: boolean /** * Should hide item with value "Appropriate-for-virtual" */ hideNotAppropriateForVirtual?: boolean } > /** * Generic interface of a practice config * * Practice configs needs to have a JSDoc for **all** interface and fields. * */ export interface PracticeConfig { /** * The uuid of the practice to apply the config */ uuidPractice: string /** * The kind of the practice config. Used as a discriminator to help auto-completion. */ kind: PracticeConfigKind /** * The actual interface of the config */ config: T } export type PracticeConfigPatientConsultCard = PracticeConfig< PracticeConfigKind.PatientConsultCard, { hideDiagnosis?: boolean } > export type PracticeConfigPracticeChatSupport = PracticeConfig< PracticeConfigKind.PracticeChatSupport, { enableChatSupport?: boolean } > export type PracticeConfigPracticeConsultTabs = PracticeConfig< PracticeConfigKind.PracticeConsultTabs, { hideDxTx?: boolean } > /** * This type is for test (do not remove without updating the integration tests) */ export type PracticeConfigPracticeConfigExample = PracticeConfig< PracticeConfigKind.PracticeConfigExample, { primaryColor?: string } > /** * Defines the practice cookie banner */ export type PracticeConfigPracticeCookieBanner = PracticeConfig< PracticeConfigKind.PracticeCookieBanner, { showCookieBanner?: boolean policyLink?: string useOfCookieLink?: string } > /** * This interface describes all practice css variables * The keys should reflect the exact css name */ export type PracticeConfigPracticeCssVariables = PracticeConfig< PracticeConfigKind.PracticeCssVariables, Record > /** * Defines the font of the practice css url */ export type PracticeConfigPracticeFontsLinks = PracticeConfig< PracticeConfigKind.PracticeFontsLinks, { /** * sans serif font family */ sansSerif?: string /** * serif font family */ serif?: string } > /** * Defines the locale switcher config */ export type PracticeConfigPracticeLocaleSwitcher = PracticeConfig< PracticeConfigKind.PracticeLocaleSwitcher, { /** * Should hide the locale switcher */ hideLocaleSwitcher?: boolean } > /** * Defines the online pharmacy address of the practice */ export type PracticeConfigPracticeOnlinePharmacy = PracticeConfig< PracticeConfigKind.PracticePharmacyPicker, { /** * The address of the online pharmacy */ onlinePharmacy?: PlaceData /** * Shows or hides the address input field in the treatment acceptance modal */ showTreatmentAcceptanceAddressInput: boolean } > /** * Defines the consultation chatbox configs */ export type PracticeConfigPractitionerChatbox = PracticeConfig< PracticeConfigKind.PractitionerChatbox, { /** * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been added. Indexed by locale. */ planAddedMessage?: { [languageISO639_3: string]: string } /** * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been updated. Indexed by locale. */ planUpdatedMessage?: { [languageISO639_3: string]: string } /** * If defined will replace the automatic chatbox comment notifiying the patient a new exam has been dispatched. Indexed by locale. */ examsUpdatedMessage?: { [languageISO639_3: string]: string } } > /** * This config is used to configure the layout of the consult list for practitioners */ export type PracticeConfigPractitionerConsultList = PracticeConfig< PracticeConfigKind.PractitionerConsultList, { /** * Hides the locality column */ hideLocality?: boolean /** * Hides the plan name column */ hidePlan?: boolean /** * Hides the fax column */ hideFax?: boolean /** * Hides the expires at column */ hideExpiresAt?: boolean } > /** * This config is used to configure the layout of the modular prescription fields */ export type PracticeConfigPracticePrescriptionFields = PracticeConfig< PracticeConfigKind.PracticePrescriptionFields, { /** * the y position in px of the first modular prescription */ yCoordinate?: number } > /** * This config is used to enable or disable the Search feature */ export type PracticeConfigPractitionerSearch = PracticeConfig< PracticeConfigKind.PractitionerSearch, { /** * Disable search indexing a consultation on its creation */ disableSearchIndexing?: boolean /** * Disable search for consultations from the ConsultList */ disableSearch?: boolean } > /** * This config is used to configure the register walkthrough */ export type PracticeConfigPracticeRegisterWalkthrough = PracticeConfig< PracticeConfigKind.PracticeRegisterWalkthrough, { /** * The workflow uuid containing the walkthrough to display. If not defined, the walkthrough slides screen is skipped. */ workflowUuid?: string } > /** * This config is used for all configs related to the Exams and Results module */ export type PracticeConfigPracticeExamsAndResults = PracticeConfig< PracticeConfigKind.PracticeExamsAndResults, { /** * If true, then show the deprecated URL prescription pad */ showUrlPrescriptionPad?: boolean } > /** * This config is used for all configs related to the Layout of the app (Navbar, Footer, etc) */ export type PracticeConfigPracticeLayout = PracticeConfig< PracticeConfigKind.PracticeLayout, { /** * If true, then show the FAQ link in the Navbar */ showFaqLink?: boolean } > /** * This config is used for all configs related to the Google Places address field */ export type PracticeConfigPracticeAddressField = PracticeConfig< PracticeConfigKind.PracticeAddressField, { /** * If true, then show the long version of the address, otherwise, show the short version */ longAddress?: boolean } > /** * This config is used for all configs related to the Diagnosis and Treatments module */ export type PracticeConfigPracticeDiagnosisAndTreatment = PracticeConfig< PracticeConfigKind.PracticeDiagnosisAndTreatment, { /** * If true, then sort alphabetically the diagnoses, treatments, and drugs shown in their respective select dropdown */ sortNames?: boolean /** * If true, it enables the Prescription Refill feature */ enableRefill?: boolean } > /** * This config is used to set a discount code in case the info letter is accepted by the patient */ export type PracticeConfigPracticeInfoLetterDiscount = PracticeConfig< PracticeConfigKind.PracticeInfoLetterDiscount, { /** * The discount code to be applied when the info letter is accepted */ discountCode?: string /** * The text to display for the discount code */ discountText?: string /** * Show the info letter subscription without a Discount code before the patient confirms his email, * if he confirms his email but still didn't check the subscription, then display a discount code for subscribing */ promptInfoLetterBeforeEmailConfirmed?: boolean } > export type PracticeConfigs = | PracticeConfigPractitionerSearch | PracticeConfigPractitionerConsultList | PracticeConfigPractitionerChatbox | PracticeConfigPracticeLocaleSwitcher | PracticeConfigPracticeCookieBanner | PracticeConfigPracticeOnlinePharmacy | PracticeConfigPracticeCssVariables | PracticeConfigPracticeFontsLinks | PracticeConfigPracticePrescriptionFields | PracticeConfigPracticeConfigExample // Here for integration tests only | PracticeConfigPracticeConsultTabs | PracticeConfigPatientConsultCard | PracticeConfigPracticeChatSupport | PracticeConfigPracticeExamsAndResults | PracticeConfigPracticeLayout | PracticeConfigPracticeAddressField | PracticeConfigPracticeDiagnosisAndTreatment | PracticeConfigPracticeInfoLetterDiscount export interface PracticeWorkflow { id?: number ///optional for insertion uuidPractice: string uuidWorkflow: string typeWorkflow: WorkflowType tagSpecialty?: string associatedWorkflowUuid?: string } export type PracticeWorkflowWithTagSpecialty = PracticeWorkflow & { tagSpecialty: string } export interface PracticePlan { id?: number ///optional for insertion uuidPractice: string isoLocality?: string nameDefault: string descDefault: string hoursExpiration: number active: boolean namePriceCurrency: string // DEPRECATED: left only for in-app receipt display and lower migration risks numPriceAmount: number // DEPRECATED: left only for in-app receipt display and lower migration risks numPriceExtDecimal?: number // DEPRECATED: left only for in-app receipt display and lower migration risks numPriceExtNegativeExponential?: number // DEPRECATED: left only for in-app receipt display and lower migration risks kind: PlanType idStripeProduct: string idStripePrice: string // DEPRECATED: left only for in-app receipt display and lower migration risks dateCreatedAt: Date dateUpdateAt: Date ratePerThousandOverride: number // DEPRECATED: left only to lower migration risks activateFollowUp: boolean } export enum StripePriceType { Default = 'Default', Discount = 'Discount', } // Subset of Stripe.Price export interface PracticePrice { /** * Unique identifier for the object in Stripe. */ idStripePrice: string /** * 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). */ currency: string /** * The unit amount in %s to be charged, represented as a whole integer if possible. */ unitAmount: number } export interface PracticePlanPrices { idPlan: number default: PracticePrice discount?: PracticePrice } export interface PracticeRate { id?: number uuidPractice: string idPlan: number isoLocality?: string dimension: RateDimension description: string uidTaxRate: string idStripeTaxRate: string } export interface PracticePlatformFee { uuidPractice: string idPlan: number isoLocality?: string numPlatformFinalFee: number } export interface PracticePayment { id?: number ///optional for insertion uuidPractice: string idPlan: number uuidConsult?: string hoursConsultExpiration: number idStripeInvoiceOrPaymentIntent: string status: PaymentStatus dateCreatedAt: Date dateUpdateAt: Date } export interface PracticePaymentIntent { id?: number ///optional for insertion uuidPractice: string idPlan: number idPayment: number hoursPlanExpiration: number isoLocality?: string textPaymentMethodOptions: string nameCurrency: string numTotalAmount: number numPlatformFeeAmount: number idStripeInvoice: string idStripePaymtIntent: string /** * This value is set only after the PracticePaymentIntent has been finalized and ready to be paid */ stripeClientSecret?: string dateCreatedAt?: Date dateUpdateAt?: Date } /** * All the PaymentIntentRequestMetadata Kind available */ export enum PaymentIntentRequestMetadataKind { ConsultRequestMetadata = 'ConsultRequestMetadata', RefillTreatmentRequestMetadata = 'RefillTreatmentRequestMetadata', } /** * This interface is used as metadata when creating Stripe Invoice. * It will be used to create the consult when stripe use our hook. */ export interface ConsultRequestMetadata { /** * Defines the kind of `PaymentIntentRequestMetadata` it is * * Note: it can be `undefined` to handle backward compatibility when this interface didn't had a `kind` */ kind: PaymentIntentRequestMetadataKind.ConsultRequestMetadata | undefined /** * The specialty required by the consultation */ tagSpecialtyRequired: string /** * The locality required for the consultation in iso. COUNTRY (ISO 3166) - PROVINCE - COUNTY - CITY */ isoLocalityRequired?: string /** * The language required for the consultation. Should respect ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes */ isoLanguageRequired: string } /** * This interface is used as metadata when creating Stripe Invoice. * It will be used to refill a treatment plan of a consult. */ export interface RefillTreatmentRequestMetadata { /** * Defines the kind of `PaymentIntentRequestMetadata` it is */ kind: PaymentIntentRequestMetadataKind.RefillTreatmentRequestMetadata /** * The consult uuid to refill */ consultUuid: string } /** * This interface is used as metadata when creating Stripe Invoice. * It will be used when stripe uses our hook. */ export type PaymentIntentRequestMetadata = ConsultRequestMetadata | RefillTreatmentRequestMetadata export interface AssignmentRequest { uuidAssignor: string //defaulting for insertion to the default practice admin uuidPractitioner?: string status?: AssignmentStatus uuidConsult?: string tagSpecialty?: string isoLocality?: string isoLanguage?: string } export type Assignment = { id: number ///optional for insertion uuidPractice: string uuidAssignor: string //defaulting for insertion to the default practice admin uuidPractitioner?: string status?: AssignmentStatus uuidConsult?: string tagSpecialty?: string timeAssigned?: string //defaulting for insertion } export interface PractitionerRole { id?: number //optional for insertion uuidPractice: string uuidPractitioner: string role: PractitionnerRoleType dateGiven?: Date //default during insertion } export interface PractitionerLicense { id?: number ///optional for insertion uuidPractitioner: string country: string tagSpecialty: string isoLocality: string txtLicenseNumber: string txtComplementary?: string dateProvidedAt?: Date dateObtainedAt?: Date dateRenewedAt?: Date status?: LicenseStatus } export interface PractitionerPreference { id?: number uuidPractitioner: string uuidPractice: string tagSpecialties: string isoLocalityConsult?: string periodQuotaConsult?: PeriodType quantityQuotaConsult?: number tagConsultLanguages?: string } export interface PractitionerQuota { id?: number ///optional for insertion uuidPractitioner: string uuidPractice: string tagSpecialty: string isoLocality: string quantityLeft?: number dateRenewal?: Date dateLastUpdate?: Date } export interface Practitioner { uuid: string uuidPractice: string txtFirstName: string txtLastName: string txtTitle: string emailAddress: string tagsSpecialties: string arrLanguages: string dateAddedAt?: Date //defaulting for insertion status?: PractitionerStatus //defaulting for insertion txtAddressTransmission?: string //the default non-fax address to send prescription to } export interface HydratedPracticeConfigs { [PracticeConfigKind.PatientConsultCard]?: PracticeConfigPatientConsultCard [PracticeConfigKind.PracticeChatSupport]?: PracticeConfigPracticeChatSupport [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes [PracticeConfigKind.PracticeConsultTabs]?: PracticeConfigPracticeConsultTabs [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy [PracticeConfigKind.PracticePrescriptionFields]?: PracticeConfigPracticePrescriptionFields [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList [PracticeConfigKind.PractitionerSearch]?: PracticeConfigPractitionerSearch [PracticeConfigKind.PracticeRegisterWalkthrough]?: PracticeConfigPracticeRegisterWalkthrough [PracticeConfigKind.PracticeExamsAndResults]?: PracticeConfigPracticeExamsAndResults [PracticeConfigKind.PracticeLayout]?: PracticeConfigPracticeLayout [PracticeConfigKind.PracticeAddressField]?: PracticeConfigPracticeAddressField [PracticeConfigKind.PracticeDiagnosisAndTreatment]?: PracticeConfigPracticeDiagnosisAndTreatment [PracticeConfigKind.PracticeInfoLetterDiscount]?: PracticeConfigPracticeInfoLetterDiscount } export interface Practice { uuid: string name: string shortName: string countryOperating: string urlPractice: string urlLinkedPage?: string urlTos?: string urlConfidentiality?: string uuidAdmin: string uuidDefaultAssigned: string uuidDefaultFallback: string prefDefaultLang: string keyGoogleTagNonProd: string keyGoogleTagProd: string txtAddress?: string emailBusiness?: string phoneBusiness?: string urlSupport?: string emailSupport?: string phoneSupport?: string phoneFax?: string txtTaxID?: string txtVATID?: string txtRegistrationID?: string txtLegalInfos?: string txtDefaultTransmissionDriver?: string txtDefaultTransmissionAddress?: string accounts?: PracticeAccount[] configs?: HydratedPracticeConfigs } export interface Sync { id?: number status?: SyncStatus descriptionStep: string dateStarted?: Date dateFinished?: Date } export interface PracticeEmail { id?: number uuidPractice: string kind: PracticeEmailKind idMailgunTemplate: string isoLanguage: string tags: string } export interface PracticeSubscription { id?: number uuidPractice: string idMailChimpAudience: string isoLanguage: string } export interface PracticeInvoice { id: string //Stripe invoice ID customerEmail: string total: number subtotal: number currency: string discount: number } /** * This interface represents a practice secret * It is used to generate a symetric key to encrypt * practice related data */ export interface PracticeSecret { practiceUuid: string /** * The payload is the actual base64 encoded bytes that can * be used as the practice secret. In the db, * this field is base64 encoded nonce+encrypted-payload. * It's decrypted on the fly when returned by the api. */ payload: string }