oro-sdk 2.1.4-dev1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/dist/client.d.ts +464 -0
  4. package/dist/helpers/client.d.ts +23 -0
  5. package/dist/helpers/index.d.ts +4 -0
  6. package/dist/helpers/patient-registration.d.ts +16 -0
  7. package/dist/helpers/vault-grants.d.ts +20 -0
  8. package/dist/helpers/workflow.d.ts +23 -0
  9. package/dist/index.d.ts +11 -0
  10. package/dist/index.js +8 -0
  11. package/dist/models/client.d.ts +28 -0
  12. package/dist/models/consult.d.ts +102 -0
  13. package/dist/models/diagnosis.d.ts +122 -0
  14. package/dist/models/error.d.ts +26 -0
  15. package/dist/models/guard.d.ts +119 -0
  16. package/dist/models/index.d.ts +9 -0
  17. package/dist/models/practice.d.ts +353 -0
  18. package/dist/models/shared.d.ts +8 -0
  19. package/dist/models/vault.d.ts +124 -0
  20. package/dist/models/workflow.d.ts +106 -0
  21. package/dist/oro-sdk.cjs.development.js +7685 -0
  22. package/dist/oro-sdk.cjs.development.js.map +1 -0
  23. package/dist/oro-sdk.cjs.production.min.js +2 -0
  24. package/dist/oro-sdk.cjs.production.min.js.map +1 -0
  25. package/dist/oro-sdk.esm.js +7692 -0
  26. package/dist/oro-sdk.esm.js.map +1 -0
  27. package/dist/sdk-revision/client.d.ts +21 -0
  28. package/dist/sdk-revision/index.d.ts +1 -0
  29. package/dist/services/api.d.ts +11 -0
  30. package/dist/services/axios.d.ts +14 -0
  31. package/dist/services/consult.d.ts +54 -0
  32. package/dist/services/diagnosis.d.ts +44 -0
  33. package/dist/services/external/clinia.d.ts +82 -0
  34. package/dist/services/external/index.d.ts +1 -0
  35. package/dist/services/guard.d.ts +92 -0
  36. package/dist/services/index.d.ts +10 -0
  37. package/dist/services/practice.d.ts +100 -0
  38. package/dist/services/teller.d.ts +9 -0
  39. package/dist/services/vault.d.ts +54 -0
  40. package/dist/services/workflow.d.ts +21 -0
  41. package/package.json +63 -0
  42. package/src/client.ts +1843 -0
  43. package/src/helpers/client.ts +199 -0
  44. package/src/helpers/index.ts +4 -0
  45. package/src/helpers/patient-registration.ts +490 -0
  46. package/src/helpers/vault-grants.ts +51 -0
  47. package/src/helpers/workflow.ts +261 -0
  48. package/src/index.ts +61 -0
  49. package/src/models/client.ts +33 -0
  50. package/src/models/consult.ts +110 -0
  51. package/src/models/diagnosis.ts +141 -0
  52. package/src/models/error.ts +13 -0
  53. package/src/models/guard.ts +136 -0
  54. package/src/models/index.ts +9 -0
  55. package/src/models/practice.ts +411 -0
  56. package/src/models/shared.ts +6 -0
  57. package/src/models/vault.ts +158 -0
  58. package/src/models/workflow.ts +142 -0
  59. package/src/sdk-revision/client.ts +62 -0
  60. package/src/sdk-revision/index.ts +1 -0
  61. package/src/services/api.ts +77 -0
  62. package/src/services/axios.ts +91 -0
  63. package/src/services/consult.ts +265 -0
  64. package/src/services/diagnosis.ts +144 -0
  65. package/src/services/external/clinia.ts +133 -0
  66. package/src/services/external/index.ts +1 -0
  67. package/src/services/guard.ts +228 -0
  68. package/src/services/index.ts +10 -0
  69. package/src/services/practice.ts +537 -0
  70. package/src/services/teller.ts +39 -0
  71. package/src/services/vault.ts +178 -0
  72. package/src/services/workflow.ts +36 -0
@@ -0,0 +1,21 @@
1
+ import { OroClient, Uuid, VaultIndex } from "..";
2
+ import { Grant } from "../models";
3
+ /**
4
+ * @name filterGrantsWithLockboxMetadata
5
+ * @description searches for the applied filters in the vault index
6
+ * @param oroClient
7
+ * @param filter: the metadata filter applied to each the lockboxes
8
+ * @param vaultIndex: the index to which the filter will be applied
9
+ * @param forceRefresh
10
+ * @returns the filtered grants
11
+ */
12
+ export declare function filterGrantsWithLockboxMetadata(oroClient: OroClient, filter?: {
13
+ consultationId: Uuid;
14
+ }, vaultIndex?: VaultIndex, forceRefresh?: boolean): Promise<Grant[]>;
15
+ /** Finds all grants for the logged user
16
+ * requests a list of unique consultation ids for each lockbox the user has access to
17
+ * builds and sets the index of consultations
18
+ * @param oroClient
19
+ * @returns the constructed vaultIndex
20
+ */
21
+ export declare function buildLegacyVaultIndex(oroClient: OroClient): Promise<VaultIndex>;
@@ -0,0 +1 @@
1
+ export * from './client';
@@ -0,0 +1,11 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ import { AuthRefreshFunc, Tokens } from '../models';
3
+ import { AxiosService } from './axios';
4
+ export declare class APIService extends AxiosService {
5
+ private tokenRefreshFailureCallback?;
6
+ private authRefreshFn?;
7
+ constructor(config?: AxiosRequestConfig, tokenRefreshFailureCallback?: ((err: Error) => void) | undefined);
8
+ setAuthRefreshFn(fn: AuthRefreshFunc): void;
9
+ setTokens(tokens: Tokens): void;
10
+ getTokens(): Tokens;
11
+ }
@@ -0,0 +1,14 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ import { AxiosInstance } from 'axios';
3
+ export declare class AxiosService {
4
+ protected axios: AxiosInstance;
5
+ constructor(config?: AxiosRequestConfig);
6
+ protected apiRequest(config: AxiosRequestConfig, url: string, data?: any): Promise<any>;
7
+ protected apiRequestHeader(config: AxiosRequestConfig, url: string, headerToRetrieve?: string, data?: any): Promise<any>;
8
+ get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
9
+ deleteRequest<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
10
+ post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
11
+ put<T = any>(url: string, data: any, config?: AxiosRequestConfig): Promise<T>;
12
+ patch<T = any>(url: string, data: any, config?: AxiosRequestConfig): Promise<T>;
13
+ head<T = any>(url: string, config?: AxiosRequestConfig, headerToRetrieve?: string, data?: any): Promise<T>;
14
+ }
@@ -0,0 +1,54 @@
1
+ import { APIService } from './api';
2
+ import { Uuid, Consult, ConsultRequest, MedicalStatus, ConsultTransmission, TransmissionStatus } from '../models';
3
+ export declare class ConsultService {
4
+ private api;
5
+ private baseURL;
6
+ constructor(api: APIService, baseURL: string);
7
+ consultCreate(c: ConsultRequest): Promise<Consult>;
8
+ /**
9
+ * This function returns the number of consults using parameters
10
+ * @param uuidPractice the practice uuid
11
+ * @param uuidRequester the requester uuid
12
+ * @param statusesMedical an array containing MedicalStatus to include
13
+ * @param statusesExclude an array containing MedicalStatus to exclude
14
+ * @param shortId a shortId matcher (will match all consult with a shortId starting with this `shortId`)
15
+ * @param columnToSortTo the list of columns separated by commas, to sort to (in order of sorting)
16
+ * @param orderToSortTo the type of sorting to do ('asc' for ascending or 'desc' for descending)
17
+ * @param perPage the number of item to retrieve per "page"
18
+ * @param indexPage the actual index of the page to retrieve (0 based: 0 is the first items)
19
+ * @param filterAssignedDoctor the uuid of the doctor for which to filter with
20
+ * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
21
+ * @param filterIsoLocality the of isoLocality to filter with
22
+ * @returns a number of consult
23
+ */
24
+ countConsults(uuidPractice?: Uuid, uuidRequester?: Uuid, statusesMedical?: MedicalStatus[], statusesExclude?: MedicalStatus[], shortId?: string, columnToSortTo?: string[], orderToSortTo?: string[], perPage?: number, indexPage?: number, filterAssignedDoctor?: string, filterCurrentPractitioner?: string, filterIsoLocality?: string[]): Promise<number>;
25
+ /**
26
+ * This function get consults using parameters
27
+ * @param uuidPractice the practice uuid
28
+ * @param uuidRequester the requester uuid
29
+ * @param statusesMedical an array containing MedicalStatus to include
30
+ * @param statusesExclude an array containing MedicalStatus to exclude
31
+ * @param shortId a shortId matcher (will match all consult with a shortId starting with this `shortId`)
32
+ * @param columnToSortTo the list of columns separated by commas, to sort to (in order of sorting)
33
+ * @param orderToSortTo the type of sorting to do ('asc' for ascending or 'desc' for descending)
34
+ * @param perPage the number of item to retrieve per "page"
35
+ * @param indexPage the actual index of the page to retrieve (0 based: 0 is the first items)
36
+ * @param filterAssignedDoctor the uuid of the doctor for which to filter with
37
+ * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
38
+ * @param filterIsoLocality the of isoLocality to filter with
39
+ * @returns a list of consult
40
+ */
41
+ getConsults(uuidPractice?: Uuid, uuidRequester?: Uuid, statusesMedical?: MedicalStatus[], statusesExclude?: MedicalStatus[], shortId?: string, columnToSortTo?: string[], orderToSortTo?: string[], perPage?: number, indexPage?: number, filterAssignedDoctor?: string, filterCurrentPractitioner?: string, filterIsoLocality?: string[]): Promise<Consult[]>;
42
+ getConsultByUUID(uuidConsult: Uuid, uuidPractice?: Uuid): Promise<Consult>;
43
+ updateConsultByUUID(uuidConsult: Uuid, consult: {
44
+ statusMedical?: MedicalStatus;
45
+ uuidAssignedDoctor?: Uuid;
46
+ neverExpires?: boolean;
47
+ }, uuidPractice?: Uuid, uuidRequester?: Uuid): Promise<Consult>;
48
+ getConsultFaxStatuses(uuidConsult: string): Promise<ConsultTransmission[]>;
49
+ postConsultTransmission(uuidConsult: string, nameDriver?: string, addressOrPhoneToSendTo?: string, file?: File, nameReceiver?: string, txtTransmissionTitle?: string, txtTransmissionNotes?: string): Promise<ConsultTransmission>;
50
+ postConsultFax(uuidConsult: string, addressReceiver: string, file: File): Promise<ConsultTransmission>;
51
+ postConsultEmail(uuidConsult: string, file: File): Promise<ConsultTransmission>;
52
+ retryConsultFax(uuidConsult: string, transmissionId: string): Promise<ConsultTransmission>;
53
+ updateConsultTransmissionStatus(transmissionId: string, uuidConsult: string, newStatus: TransmissionStatus): Promise<ConsultTransmission>;
54
+ }
@@ -0,0 +1,44 @@
1
+ import { Drug, TreatmentPlan, TreatmentPlans, TreatmentPlansRequest, TreatmentPlansResponse, Uuid } from '..';
2
+ import { Diagnosis, Treatment, DiagnosisRequest, TreatmentRequest, TreatmentAndDrugPrescriptionUpdateRequest } from '../models/diagnosis';
3
+ import { APIService } from './api';
4
+ export declare class DiagnosisService {
5
+ private api;
6
+ private baseURL;
7
+ constructor(api: APIService, baseURL: string);
8
+ getDiagnoses(): Promise<Diagnosis[]>;
9
+ /**
10
+ * Get a diagnosis by uuid that belongs to your practice
11
+ * @param uuidDiagnosis the uuid of the diagnosis
12
+ * @returns a diagnosis
13
+ */
14
+ getDiagnosisByUuid(uuidDiagnosis: Uuid): Promise<Diagnosis>;
15
+ createDiagnosis(diagnosis: DiagnosisRequest): Promise<Diagnosis>;
16
+ updateDiagnosis(uuid: string, diagnosis: DiagnosisRequest): Promise<Diagnosis>;
17
+ getTreatmentsFromDiagnosisUuid(diagnosisUuid: Uuid): Promise<Treatment[]>;
18
+ /**
19
+ * This function returns treatment plans associated to a consult
20
+ * @param uuidConsult the consult uuid to fetch
21
+ * @returns an array of TreatmentPlan
22
+ */
23
+ getTreatmentPlansFromConsultUuid(uuidConsult: Uuid): Promise<TreatmentPlan[]>;
24
+ /**
25
+ * creates a new treatment for the diagnosis specified
26
+ * @param diagnosisUuid uuid of the diagnosis that is linked to the treatment
27
+ * @param treatmentRequest the treatment to be inserted
28
+ */
29
+ createTreatment(diagnosisUuid: string, treatmentRequest: TreatmentRequest): Promise<Treatment>;
30
+ /**
31
+ * This function returns populated treatment plans associated to a consult
32
+ * @param uuidConsult the consult uuid to fetch
33
+ * @returns a TreatmentPlans object
34
+ */
35
+ getTreatmentPlansPopulatedFromConsultUuid(uuidConsult: Uuid): Promise<TreatmentPlans>;
36
+ postPlans(plans: TreatmentPlansRequest): Promise<TreatmentPlansResponse>;
37
+ updateTreatmentPlan(uuidPlan: string, uuidConsult: string, diagnosisRequest: DiagnosisRequest, plan: TreatmentAndDrugPrescriptionUpdateRequest): Promise<TreatmentPlan>;
38
+ acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan>;
39
+ /**
40
+ * retrieves all the drugs of the specified practice
41
+ * @param uuidPractice
42
+ */
43
+ getAllDrugs(uuidPractice: string): Promise<Drug[] | undefined>;
44
+ }
@@ -0,0 +1,82 @@
1
+ export declare type FacetFilter = 'type:PHARMACY' | 'type:CLINIC';
2
+ export interface CliniaResponse<T> {
3
+ facets: any;
4
+ meta: {
5
+ query: string;
6
+ page: number;
7
+ numPages: number;
8
+ perPage: number;
9
+ total: number;
10
+ };
11
+ records: T[];
12
+ }
13
+ export interface PlaceData {
14
+ id: string;
15
+ documentType: string;
16
+ type: string;
17
+ name: string;
18
+ address: AddressData;
19
+ geoPoint: GeoPointData;
20
+ distance: number;
21
+ onlineBookingUrl: string;
22
+ openingHours: Map<string, Array<IntervalData>>;
23
+ phones: Array<PhoneData>;
24
+ socials: Array<SocialData>;
25
+ note: string;
26
+ services: Array<string>;
27
+ owner: string;
28
+ }
29
+ export interface AddressData {
30
+ streetAddress: string;
31
+ suiteNumber: string;
32
+ postalCode: string;
33
+ neighborhood: string;
34
+ locality: string;
35
+ place: string;
36
+ region: string;
37
+ regionCode: string;
38
+ country: string;
39
+ countryCode: string;
40
+ }
41
+ export interface PhoneData {
42
+ number: string;
43
+ extension: string;
44
+ countryCode: string;
45
+ type: 'MAIN' | 'ALTERNATE' | 'RECEPTION' | 'FAX' | 'TEXT_TELEPHONE_TTY' | 'INFO' | 'OTHER';
46
+ isTollFree: boolean;
47
+ }
48
+ export interface IntervalData {
49
+ start: string;
50
+ end: string;
51
+ }
52
+ export interface GeoPointData {
53
+ lat: number;
54
+ lng: number;
55
+ }
56
+ export interface SocialData {
57
+ url: string;
58
+ type: string;
59
+ }
60
+ export declare class CliniaService {
61
+ private url;
62
+ private locale?;
63
+ private api;
64
+ constructor(url: string, apiKey: string, locale?: string | undefined);
65
+ placeSearch(searchOptions: {
66
+ locale?: string;
67
+ query?: string;
68
+ facetFilters?: FacetFilter[];
69
+ location?: string;
70
+ aroundLatLng?: string;
71
+ page?: number;
72
+ }): Promise<CliniaResponse<PlaceData>>;
73
+ placeMatch(searchOptions: {
74
+ locale?: string;
75
+ name?: string;
76
+ address?: string;
77
+ postalCode?: string;
78
+ place?: string;
79
+ region?: string;
80
+ country?: string;
81
+ }, type?: string): Promise<PlaceData[]>;
82
+ }
@@ -0,0 +1 @@
1
+ export * from './clinia';
@@ -0,0 +1,92 @@
1
+ import { APIService } from './api';
2
+ import type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh';
3
+ import { AuthTokenRequest, AuthTokenResponse, AuthRecoverRequest, IdentityCreateRequest, IdentityUpdateRequest, IdentityResponse, QRCodeResponse, Uuid, WhoAmIResponse, Base64String, Tokens } from '../models';
4
+ export interface GuardRequestConfig extends AxiosAuthRefreshRequestConfig {
5
+ useRefreshToken: boolean;
6
+ }
7
+ export declare class GuardService {
8
+ private api;
9
+ private baseURL;
10
+ private identityCache;
11
+ private whoAmICache;
12
+ constructor(api: APIService, baseURL: string);
13
+ /**
14
+ * Will replace access and refresh tokens with `tokens`
15
+ *
16
+ * Note:
17
+ * ```typescript
18
+ * setTokens({accessToken: undefined, refreshToken: 'aTokenValue'}) // will erase accessToken and set refreshToken with 'aTokenValue'
19
+ * setTokens({refreshToken: 'aTokenValue'}) // will keep actual value of accessToken and set refreshToken with 'aTokenValue'
20
+ *
21
+ * ```
22
+ * @param tokens
23
+ */
24
+ setTokens(tokens: Tokens): void;
25
+ /**
26
+ * Allow to retrieve an access token and a refresh token in order
27
+ * to do authenticated request afterward
28
+ *
29
+ * @param req The credentials required to get an access token
30
+ * @returns AuthTokenResponse
31
+ */
32
+ authToken(req: AuthTokenRequest): Promise<AuthTokenResponse>;
33
+ /**
34
+ * Get new access and refresh token
35
+ *
36
+ * @returns AuthTokenResponse
37
+ */
38
+ authRefresh(refreshToken?: string): Promise<AuthTokenResponse>;
39
+ /**
40
+ * Call guard to overwrite existing refresh token cookie
41
+ *
42
+ * @returns void
43
+ */
44
+ authLogout(): Promise<void>;
45
+ /**
46
+ * Call guard to attempt account recovery
47
+ *
48
+ * @param req The email address / practice of the account to recover
49
+ * @returns void
50
+ */
51
+ authRecover(req: AuthRecoverRequest): Promise<void>;
52
+ /**
53
+ * Allow to create a new identity. The identity will then need to be confirmed
54
+ * via an email link
55
+ *
56
+ * @param req the information about the new identity to create
57
+ * @returns IdentityResponse
58
+ */
59
+ identityCreate(req: IdentityCreateRequest): Promise<IdentityResponse>;
60
+ /**
61
+ * Retrieve an identity. Will return public fields only when requested
62
+ * without authentication
63
+ *
64
+ * @param identityID Unique id of the identity to retrieve
65
+ * @returns IdentityResponse
66
+ */
67
+ identityGet(identityID: Uuid): Promise<IdentityResponse>;
68
+ /**
69
+ * Get information about the current authenticated user
70
+ *
71
+ * @param refreshCache if true it will refresh the whoAmI cache (default: false)
72
+ * @returns WhoAmIResponse
73
+ */
74
+ whoAmI(refreshCache?: boolean): Promise<WhoAmIResponse>;
75
+ /**
76
+ * Update an existing identity
77
+ *
78
+ * @param identityID unique id of identity to update
79
+ * @param req update request
80
+ * @returns IdentityResponse
81
+ */
82
+ identityUpdate(identityID: Uuid, req: IdentityUpdateRequest): Promise<IdentityResponse>;
83
+ /**
84
+ * Return base64 data representing a QR code that the
85
+ * current identity need in order to use MFA
86
+ *
87
+ * @param identityID unique id of the identity
88
+ * @param password the identity password (already hashed and in base64)
89
+ * @returns QRCodeResponse
90
+ */
91
+ identityMFAQRCode(identityID: Uuid, password: Base64String): Promise<QRCodeResponse>;
92
+ }
@@ -0,0 +1,10 @@
1
+ export * from './axios';
2
+ export * from './api';
3
+ export * from './consult';
4
+ export * from './diagnosis';
5
+ export * from './guard';
6
+ export * from './practice';
7
+ export * from './teller';
8
+ export * from './vault';
9
+ export * from './workflow';
10
+ export * from './external';
@@ -0,0 +1,100 @@
1
+ import * as OroToolbox from 'oro-toolbox';
2
+ import { PracticeAccount, Uuid } from '../models';
3
+ import { Assignment, PlanType, Practice, PracticeConfigs, PracticeConfigKind, PracticePayment, PracticePaymentIntent, PracticePlan, PracticePlanPrices, PracticeWorkflow, PracticeWorkflowWithTagSpecialty, Practitioner, PractitionerLicense, PractitionerPreference, PractitionerQuota, PractitionerRole, WorkflowType } from '../models/practice';
4
+ import { APIService } from './api';
5
+ export declare class PracticeService {
6
+ private toolbox;
7
+ private api;
8
+ private baseURL;
9
+ constructor(toolbox: typeof OroToolbox, api: APIService, baseURL: string);
10
+ /**
11
+ * This function get the practice from the URL of a practice
12
+ * It is the entry point of our web apps
13
+ * @param practiceURL URL of the practice to search
14
+ * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set
15
+ * @param accounts (optional) if set true it the Practice field accounts will be set
16
+ * @returns the found practice or undefined
17
+ */
18
+ practiceGetFromURL(practiceURL: string, params?: {
19
+ hydratePracticeConfigs?: boolean;
20
+ accounts?: boolean;
21
+ }): Promise<Practice | undefined>;
22
+ practiceGetFromUuid(practiceUuid: Uuid, locale?: string, withAccounts?: boolean): Promise<Practice>;
23
+ /**
24
+ * This function retrieves all configs of a specific practice
25
+ * @param practiceUuid uuid of the practice
26
+ * @returns the practice configs
27
+ */
28
+ practiceConfigGetFromPracticeUuid(practiceUuid: Uuid): Promise<PracticeConfigs[]>;
29
+ /**
30
+ * This function retrieves a specific config of a practice
31
+ * @param practiceUuid uuid of the practice
32
+ * @param kind of the config
33
+ * @returns the practice config
34
+ */
35
+ practiceConfigGetByKindForPracticeUuid(practiceUuid: Uuid, kind: PracticeConfigKind): Promise<PracticeConfigs>;
36
+ /**
37
+ * This function creates a config for a specific practice
38
+ * @param practiceUuid uuid of the practice
39
+ * @param config the config to add to the practice
40
+ * @returns the created practice config
41
+ */
42
+ practiceConfigCreateForPracticeUuid(practiceUuid: Uuid, config: PracticeConfigs): Promise<PracticeConfigs>;
43
+ /**
44
+ * This function updates a specific config of a practice
45
+ * @param practiceUuid uuid of the practice
46
+ * @param config the config to update
47
+ * @returns the practice config
48
+ */
49
+ practiceConfigUpdate(config: PracticeConfigs): Promise<PracticeConfigs>;
50
+ practiceGetAccounts(practiceUuid: Uuid): Promise<PracticeAccount[]>;
51
+ practiceGetAccount(practiceUuid: Uuid, accountUuid: Uuid): Promise<PracticeAccount>;
52
+ practiceGetWorkflows(practiceUuid: Uuid): Promise<PracticeWorkflow[]>;
53
+ practiceGetWorkflow(practiceUuid: Uuid, workflowType: WorkflowType): Promise<PracticeWorkflowWithTagSpecialty>;
54
+ practiceGetPlans(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePlan[]>;
55
+ practiceGetPlan(practiceUuid: Uuid, planId: number): Promise<PracticePlan>;
56
+ practiceGetPlanPrices(practiceUuid: Uuid, planId: number): Promise<PracticePlanPrices>;
57
+ practiceGetPayments(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePayment[]>;
58
+ practiceGetPayment(practiceUuid: Uuid, idStripeInvoiceOrPaymentIntent: string): Promise<PracticePayment>;
59
+ practiceGetPaymentForStripePaymentIntentWithID(practiceUuid: Uuid, stripePaymentIntentId: number): Promise<PracticePayment>;
60
+ practiceGetPaymentsIntents(practiceUuid: Uuid, planType?: PlanType): Promise<PracticePaymentIntent[]>;
61
+ /**
62
+ * This function return the user hased email to be use for creating payment intent
63
+ * @param email the email to hash
64
+ * @returns a hashed email
65
+ */
66
+ getPaymentIntentHashedEmail(email: string): string;
67
+ practiceCreatePaymentsIntent(practiceUuid: Uuid, planId: number, userEmail: string, isoLocality?: string, url_subdomain?: string, promotionCode?: string): Promise<PracticePaymentIntent>;
68
+ practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent>;
69
+ practiceUpdatePaymentsIntent(practiceUuid: string, idPraticePaymentIntent: number, practicePaymentIntent: PracticePaymentIntent, userEmail: string, promotionCode?: string): Promise<PracticePaymentIntent>;
70
+ practiceGetPractitioners(practiceUuid: Uuid): Promise<Practitioner[]>;
71
+ practiceUpdatePractitioner(practiceUuid: Uuid, practitionerUuid: Uuid, requestBody: Practitioner): Promise<Practitioner>;
72
+ practiceGetPractitioner(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<Practitioner>;
73
+ practiceGetPractitionerLicenses(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerLicense[]>;
74
+ practiceCreatePractitionerLicense(practiceUuid: Uuid, practitionerUuid: Uuid, requestBody: PractitionerLicense): Promise<PractitionerLicense>;
75
+ practiceUpdatePractitionerLicense(practiceUuid: Uuid, practitionerUuid: Uuid, licenseId: number, requestBody: PractitionerLicense): Promise<PractitionerLicense>;
76
+ practiceGetPractitionerLicense(practiceUuid: Uuid, practitionerUuid: Uuid, licenseId: number): Promise<PractitionerLicense>;
77
+ practiceGetPractitionerPreferences(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerPreference[]>;
78
+ practiceCreatePractitionerPreference(practiceUuid: Uuid, practitionerUuid: Uuid, requestBody: PractitionerPreference): Promise<PractitionerPreference>;
79
+ practiceUpdatePractitionerPreference(practiceUuid: Uuid, practitionerUuid: Uuid, preferenceId: number, requestBody: PractitionerPreference): Promise<PractitionerPreference>;
80
+ practiceGetPractitionerPreference(practiceUuid: Uuid, practitionerUuid: Uuid, preferenceId: number): Promise<PractitionerPreference>;
81
+ practiceGetPractitionerRoles(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerRole[]>;
82
+ practiceCreatePractitionerRole(practiceUuid: Uuid, practitionerUuid: Uuid, requestBody: PractitionerRole): Promise<PractitionerRole>;
83
+ practiceDeletePractitionerRoles(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<PractitionerRole>;
84
+ practiceUpdatePractitionerRole(practiceUuid: Uuid, practitionerUuid: Uuid, roleId: number, requestBody: PractitionerRole): Promise<PractitionerRole>;
85
+ practiceGetPractitionerRole(practiceUuid: Uuid, practitionerUuid: Uuid, roleId: number): Promise<PractitionerRole>;
86
+ practiceDeletePractitionerRole(practiceUuid: Uuid, practitionerUuid: Uuid, roleId: number): Promise<PractitionerRole>;
87
+ /**
88
+ * This function returns the practitioner's signature as a Blob
89
+ * @param practiceUuid the practice uuid of the practitioner
90
+ * @param practitionerUuid the practitioner uuid
91
+ * @returns a blob representing the signature
92
+ */
93
+ practiceGetPractitionerSignature(practiceUuid: Uuid, practitionerUuid: Uuid): Promise<Blob>;
94
+ practiceGetAssignments(practiceUuid: Uuid): Promise<Assignment[]>;
95
+ practiceCreateAssignment(practiceUuid: Uuid, requestBody: Assignment): Promise<Assignment>;
96
+ practiceUpdateAssignment(practiceUuid: Uuid, assignmentId: number, requestBody: Assignment): Promise<Assignment>;
97
+ practiceGetAssignment(practiceUuid: Uuid, assignmentId: number): Promise<Assignment>;
98
+ practiceGetQuotas(practiceUuid: Uuid): Promise<PractitionerQuota[]>;
99
+ practiceGetQuota(practiceUuid: Uuid, quotaId: number): Promise<PractitionerQuota>;
100
+ }
@@ -0,0 +1,9 @@
1
+ import { APIService } from './api';
2
+ import { Consult, DataCreateResponse, LockboxDataRequest, MedicalStatus, Uuid } from '../models';
3
+ export declare class TellerService {
4
+ private api;
5
+ private baseURL;
6
+ constructor(api: APIService, baseURL: string);
7
+ lockboxDataStore(lockboxUuid: Uuid, req: LockboxDataRequest, lockboxOwnerUuid?: Uuid, previousDataUuid?: Uuid): Promise<DataCreateResponse>;
8
+ updateConsultByUUID(patientUuid: Uuid, uuidConsult: Uuid, statusMedical: MedicalStatus, neverExpires?: boolean): Promise<Consult>;
9
+ }
@@ -0,0 +1,54 @@
1
+ import { APIService } from './api';
2
+ import { DataCreateResponse, DataResponse, GrantedLockboxes, LockboxCreateResponse, LockboxDataRequest, LockboxGrantRequest, LockboxManifest, SharedSecretResponse, Uuid, EncryptedVaultIndex, IndexKey, EncryptedIndexEntry } from '../models';
3
+ export declare class VaultService {
4
+ private api;
5
+ private baseURL;
6
+ constructor(api: APIService, baseURL: string);
7
+ lockboxCreate(lockboxMetadata?: Object): Promise<LockboxCreateResponse>;
8
+ lockboxMetadataAdd(lockboxUuid: Uuid, lockboxMetadata: Object, lockboxOwnerUuid?: Uuid): Promise<LockboxCreateResponse>;
9
+ lockboxSecretGet(lockboxUuid: Uuid, lockboxOwnerUuid?: Uuid): Promise<SharedSecretResponse>;
10
+ lockboxGrant(lockboxUuid: Uuid, req: LockboxGrantRequest, lockboxOwnerUuid?: Uuid): Promise<void>;
11
+ /**
12
+ * Get all lockboxes granted to user
13
+ * @param filter filter of lockbox metadata
14
+ * @returns decrypted lockboxes granted to user
15
+ */
16
+ grantsGet(): Promise<GrantedLockboxes>;
17
+ /**
18
+ * This function create or update a data into the vault.
19
+ * @note At creation it is necessary to have all `req` filled
20
+ * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.
21
+ * @param lockboxUuid The lockbox uuid the data will be stored in
22
+ * @param req The request (please see notes)
23
+ * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)
24
+ * @param previousDataUuid The data uuid of the data you want to update
25
+ * @returns
26
+ */
27
+ lockboxDataStore(lockboxUuid: Uuid, req: LockboxDataRequest, lockboxOwnerUuid?: Uuid, previousDataUuid?: Uuid): Promise<DataCreateResponse>;
28
+ lockboxDataGet(lockboxUuid: Uuid, dataUuid: Uuid, lockboxOwnerUuid?: Uuid, stream?: boolean): Promise<DataResponse>;
29
+ lockboxManifestGet(lockboxUuid: Uuid, filter?: Object, lockboxOwnerUuid?: Uuid): Promise<LockboxManifest>;
30
+ lockboxMetadataGet(lockboxUuid: Uuid, fields: string[], groupby: string[], filter?: Object, lockboxOwnerUuid?: Uuid): Promise<any[]>;
31
+ /**
32
+ * inserts or updates encrypted index entries
33
+ * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
34
+ * @note if a uuid for an entry is provided, the service will perform an update
35
+ * @param entries the encrypted index data
36
+ * @param indexOwnerUuid
37
+ */
38
+ vaultIndexPut(entries: EncryptedVaultIndex, indexOwnerUuid?: Uuid): Promise<void>;
39
+ /**
40
+ * inserts or updates index snapshot for the provided index owner
41
+ * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
42
+ * @param entry the encrypted index snapshot
43
+ */
44
+ vaultIndexSnapshotPut(entry: EncryptedIndexEntry): Promise<void>;
45
+ /**
46
+ * Retrieves the encrypted index from the vault for the requesting user
47
+ * @note index keys can be specified to narrow the scope of index being requested
48
+ * @param indexKeys accepted index fields determined by vault
49
+ * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry
50
+ * @param timestamp the minimum timestamp that index entries were created
51
+ * @returns the encrypted index
52
+ */
53
+ vaultIndexGet(indexKeys: IndexKey[], identifiers?: string[], timestamp?: Date): Promise<EncryptedVaultIndex>;
54
+ }
@@ -0,0 +1,21 @@
1
+ import { WorkflowData } from '../models/workflow';
2
+ import { APIService } from './api';
3
+ export declare class WorkflowService {
4
+ private api;
5
+ private v1Url;
6
+ constructor(api: APIService, url: string);
7
+ /**
8
+ * This function returns all workflows
9
+ * @returns desired workflow
10
+ */
11
+ getWorkflows(): Promise<WorkflowData[]>;
12
+ /**
13
+ * This function retrieves a workflow. If `locale` is not found, it will try to find 'en' version of it.
14
+ * By default, will return most recent workflow of a specific `id`. `createdAt` can be used to select older version.
15
+ * @param id The uuid of the workflow
16
+ * @param locale (optional) The desired locale of the workflow (default: 'en')
17
+ * @param createdAt (optional) The creation date of the workflow (also used for versionning)
18
+ * @returns desired workflow
19
+ */
20
+ getWorkflow(id: string, locale?: string, createdAt?: string): Promise<WorkflowData>;
21
+ }
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "version": "2.1.4-dev1.0",
3
+ "main": "dist/index.js",
4
+ "typings": "dist/index.d.ts",
5
+ "files": [
6
+ "dist",
7
+ "src"
8
+ ],
9
+ "engines": {
10
+ "node": ">=10",
11
+ "npm": ">=6.14.13"
12
+ },
13
+ "scripts": {
14
+ "link:watch": "npm link && tsdx watch",
15
+ "start": "tsdx watch",
16
+ "build": "tsdx build",
17
+ "test": "tsdx test",
18
+ "lint": "tsdx lint",
19
+ "prepare": "tsdx build",
20
+ "size": "size-limit",
21
+ "analyze": "size-limit --why",
22
+ "package": "tsdx build && npm publish"
23
+ },
24
+ "husky": {
25
+ "hooks": {
26
+ "pre-commit": "tsdx lint"
27
+ }
28
+ },
29
+ "name": "oro-sdk",
30
+ "author": "Antoine Jaouën <antoine@orohealth.me>",
31
+ "module": "dist/oro-sdk.esm.js",
32
+ "size-limit": [
33
+ {
34
+ "path": "dist/oro-sdk.cjs.production.min.js",
35
+ "limit": "10 KB"
36
+ },
37
+ {
38
+ "path": "dist/oro-sdk.esm.js",
39
+ "limit": "10 KB"
40
+ }
41
+ ],
42
+ "devDependencies": {
43
+ "@size-limit/preset-small-lib": "^4.10.2",
44
+ "@types/jest": "^27.4.1",
45
+ "@types/uuid": "^8.3.0",
46
+ "husky": "^6.0.0",
47
+ "prettier": "^2.5.1",
48
+ "prettier-plugin-svelte": "^2.3.0",
49
+ "size-limit": "^4.10.2",
50
+ "tsdx": "^0.14.1",
51
+ "tslib": "^2.2.0",
52
+ "typescript": "^4.2.4"
53
+ },
54
+ "dependencies": {
55
+ "axios": "^0.21.4",
56
+ "axios-auth-refresh": "^3.2.1",
57
+ "form-data": "^4.0.0",
58
+ "formdata-node": "^4.3.1",
59
+ "idb-keyval": "^5.0.6",
60
+ "oro-toolbox": "0.0.6",
61
+ "uuid": "^8.3.2"
62
+ }
63
+ }