oro-sdk 2.15.0 → 2.15.1-dev1
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.
- package/dist/helpers/workflow.d.ts +1 -1
- package/dist/models/client.d.ts +1 -2
- package/dist/oro-sdk.cjs.development.js +22 -12
- package/dist/oro-sdk.cjs.development.js.map +1 -1
- package/dist/oro-sdk.cjs.production.min.js +1 -1
- package/dist/oro-sdk.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk.esm.js +22 -12
- package/dist/oro-sdk.esm.js.map +1 -1
- package/dist/services/external/clinia.d.ts +1 -60
- package/package.json +4 -9
- package/src/helpers/workflow.ts +10 -1
- package/src/models/client.ts +1 -2
- package/src/services/external/clinia.ts +1 -76
@@ -1,63 +1,4 @@
|
|
1
|
-
|
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
|
-
province?: string;
|
48
|
-
}
|
49
|
-
export interface IntervalData {
|
50
|
-
start: string;
|
51
|
-
end: string;
|
52
|
-
}
|
53
|
-
export interface GeoPointData {
|
54
|
-
lat: number;
|
55
|
-
lng: number;
|
56
|
-
}
|
57
|
-
export interface SocialData {
|
58
|
-
url: string;
|
59
|
-
type: string;
|
60
|
-
}
|
1
|
+
import { CliniaResponse, FacetFilter, PlaceData } from "oro-sdk-apis";
|
61
2
|
export declare class CliniaService {
|
62
3
|
private url;
|
63
4
|
private locale?;
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "2.15.
|
2
|
+
"version": "2.15.1-dev1",
|
3
3
|
"main": "dist/index.js",
|
4
4
|
"typings": "dist/index.d.ts",
|
5
5
|
"files": [
|
@@ -20,12 +20,8 @@
|
|
20
20
|
"prepare": "tsdx build",
|
21
21
|
"size": "size-limit",
|
22
22
|
"analyze": "size-limit --why",
|
23
|
-
"package": "tsdx build && npm publish"
|
24
|
-
|
25
|
-
"husky": {
|
26
|
-
"hooks": {
|
27
|
-
"pre-commit": "tsdx lint"
|
28
|
-
}
|
23
|
+
"package": "tsdx build && npm publish",
|
24
|
+
"pretty": "prettier --config ../../.prettierrc.yaml --write './src/**/*.{ts,js,json,md}' && prettier --write './*.md'"
|
29
25
|
},
|
30
26
|
"name": "oro-sdk",
|
31
27
|
"author": "Antoine Jaouën <antoine@orohealth.me>",
|
@@ -45,7 +41,6 @@
|
|
45
41
|
"@size-limit/preset-small-lib": "^4.10.2",
|
46
42
|
"@types/jest": "^27.4.1",
|
47
43
|
"@types/uuid": "^8.3.0",
|
48
|
-
"husky": "^6.0.0",
|
49
44
|
"prettier": "^2.5.1",
|
50
45
|
"prettier-plugin-svelte": "^2.3.0",
|
51
46
|
"size-limit": "^4.10.2",
|
@@ -59,7 +54,7 @@
|
|
59
54
|
"form-data": "^4.0.0",
|
60
55
|
"formdata-node": "^4.3.1",
|
61
56
|
"idb-keyval": "^5.0.6",
|
62
|
-
"oro-sdk-apis": "1.11.
|
57
|
+
"oro-sdk-apis": "1.11.1-dev1",
|
63
58
|
"oro-toolbox": "0.0.6",
|
64
59
|
"uuid": "^8.3.2"
|
65
60
|
}
|
package/src/helpers/workflow.ts
CHANGED
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
|
15
15
|
export async function filterTriggeredAnsweredWithKind(
|
16
16
|
workflowData: WorkflowData,
|
17
|
-
kind: 'text' | 'date' | 'number' | 'images' | 'images-alias' | 'body-parts' | 'pharmacy-picker'
|
17
|
+
kind: 'text' | 'textArea' | 'hybrid' | 'date' | 'number' | 'images' | 'images-alias' | 'body-parts' | 'pharmacy-picker'
|
18
18
|
): Promise<SelectedAnswerData[]> {
|
19
19
|
if (!workflowData.selectedAnswers) throw WorkflowAnswersMissingError
|
20
20
|
|
@@ -120,6 +120,15 @@ async function populateWorkflowField(
|
|
120
120
|
let displayedAnswer: string | string[] | undefined = undefined
|
121
121
|
|
122
122
|
switch (question.kind) {
|
123
|
+
case 'hybrid':
|
124
|
+
if (question.answers) {
|
125
|
+
const displayedAnswer1 = question.answers[answerValue as string].text.split(" ")[0]
|
126
|
+
const displayedAnswer2 = question.answers[answerValue as string].text.split(" ")[1]
|
127
|
+
displayedAnswer = `${displayedAnswer1} ${displayedAnswer2}`
|
128
|
+
}
|
129
|
+
|
130
|
+
answer = answerValue
|
131
|
+
break
|
123
132
|
case 'radio':
|
124
133
|
case 'radio-card':
|
125
134
|
case 'select':
|
package/src/models/client.ts
CHANGED
@@ -1,79 +1,4 @@
|
|
1
|
-
import { AxiosService } from "oro-sdk-apis"
|
2
|
-
|
3
|
-
export type FacetFilter = 'type:PHARMACY' | 'type:CLINIC' | 'type:PHARMACY_VIRTUAL'
|
4
|
-
|
5
|
-
export interface CliniaResponse<T> {
|
6
|
-
facets: any
|
7
|
-
meta: {
|
8
|
-
query: string
|
9
|
-
page: number
|
10
|
-
numPages: number
|
11
|
-
perPage: number
|
12
|
-
total: number
|
13
|
-
}
|
14
|
-
records: T[]
|
15
|
-
}
|
16
|
-
|
17
|
-
export interface PlaceData {
|
18
|
-
id: string // The Clinia Id of the resource.
|
19
|
-
documentType: string // Type of document. This will always be set to health_facility.
|
20
|
-
type: string // The type of the resource. Possible Place types are detailed here.
|
21
|
-
name: string // The name of the resource.
|
22
|
-
address: AddressData // The address of the resource.
|
23
|
-
geoPoint: GeoPointData // The coordinates of the resource. Useful to locate resource on a map.
|
24
|
-
distance: number // The distance (in meters) the is from the location used to filter the query.
|
25
|
-
onlineBookingUrl: string // The url for the online booking system of the resource.
|
26
|
-
openingHours: Map<string, Array<IntervalData>> // The opening hours of the resource. This object has integers from 1 to 7 as keys, representing days of the week from Monday to Sunday as per ISO 8601.
|
27
|
-
phones: Array<PhoneData> // Phones associated with this resource.
|
28
|
-
socials: Array<SocialData> // The social links of the resource. Can be a website or a social media link.
|
29
|
-
note: string // Special notes on the resource.
|
30
|
-
services: Array<string> // The services offered by the resource.
|
31
|
-
owner: string // The owner of the resource in the Clinia ecosystem.
|
32
|
-
}
|
33
|
-
|
34
|
-
export interface AddressData {
|
35
|
-
streetAddress: string // Street number plus route name.
|
36
|
-
suiteNumber: string // Suite, door, appartment number.
|
37
|
-
postalCode: string // Postal code.
|
38
|
-
neighborhood: string // Neighborhood.
|
39
|
-
locality: string // Locality.
|
40
|
-
place: string // City.
|
41
|
-
region: string // Name of the region.
|
42
|
-
regionCode: string // ISO 3166-2 region code.
|
43
|
-
country: string // Name of the country.
|
44
|
-
countryCode: string // ISO 3166 country code
|
45
|
-
}
|
46
|
-
|
47
|
-
export interface PhoneData {
|
48
|
-
number: string //The phone number.
|
49
|
-
extension: string //The extension of the phone number.
|
50
|
-
countryCode: string //The country code associated with this phone number.
|
51
|
-
type:
|
52
|
-
| 'MAIN'
|
53
|
-
| 'ALTERNATE'
|
54
|
-
| 'RECEPTION'
|
55
|
-
| 'FAX'
|
56
|
-
| 'TEXT_TELEPHONE_TTY'
|
57
|
-
| 'INFO'
|
58
|
-
| 'OTHER' //The type of phone.
|
59
|
-
isTollFree: boolean //If the number is toll free or not.
|
60
|
-
province?: string //If the number is specific to a province
|
61
|
-
}
|
62
|
-
|
63
|
-
export interface IntervalData {
|
64
|
-
start: string // Start time of the time interval. Format is HH:mm.
|
65
|
-
end: string // End time of the time interval. Format is HH:mm.
|
66
|
-
}
|
67
|
-
|
68
|
-
export interface GeoPointData {
|
69
|
-
lat: number // Latitude
|
70
|
-
lng: number // Longitude
|
71
|
-
}
|
72
|
-
|
73
|
-
export interface SocialData {
|
74
|
-
url: string // Url representing the link.
|
75
|
-
type: string // Type of link.
|
76
|
-
}
|
1
|
+
import { AxiosService, CliniaResponse, FacetFilter, PlaceData } from "oro-sdk-apis"
|
77
2
|
|
78
3
|
export class CliniaService {
|
79
4
|
private api: AxiosService
|