oro-sdk-apis 3.0.0 → 3.1.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.
- package/dist/models/practice.d.ts +4 -0
- package/dist/oro-sdk-apis.cjs.development.js +3 -2
- package/dist/oro-sdk-apis.cjs.development.js.map +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk-apis.esm.js +3 -2
- package/dist/oro-sdk-apis.esm.js.map +1 -1
- package/dist/services/diagnosis.d.ts +1 -1
- package/package.json +2 -2
- package/src/models/practice.ts +4 -0
- package/src/services/diagnosis.ts +39 -73
@@ -34,7 +34,7 @@ export declare class DiagnosisService {
|
|
34
34
|
*/
|
35
35
|
getTreatmentPlansPopulatedFromConsultUuid(uuidConsult: Uuid): Promise<TreatmentPlans>;
|
36
36
|
postPlans(plans: TreatmentPlansRequest): Promise<TreatmentPlansResponse>;
|
37
|
-
updateTreatmentPlan(uuidPlan: string, uuidConsult: string, diagnosisRequest: DiagnosisRequest, plan: TreatmentAndDrugPrescriptionUpdateRequest): Promise<TreatmentPlan>;
|
37
|
+
updateTreatmentPlan(uuidPlan: string, uuidConsult: string, diagnosisRequest: DiagnosisRequest, plan: TreatmentAndDrugPrescriptionUpdateRequest, refill?: boolean): Promise<TreatmentPlan>;
|
38
38
|
acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan>;
|
39
39
|
/**
|
40
40
|
* retrieves all the drugs of the specified practice
|
package/package.json
CHANGED
package/src/models/practice.ts
CHANGED
@@ -287,6 +287,10 @@ export type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<
|
|
287
287
|
* The address of the online pharmacy
|
288
288
|
*/
|
289
289
|
onlinePharmacy?: PlaceData
|
290
|
+
/**
|
291
|
+
* Shows or hides the address input field in the treatment acceptance modal
|
292
|
+
*/
|
293
|
+
showTreatmentAcceptanceAddressInput: boolean
|
290
294
|
}
|
291
295
|
>
|
292
296
|
|
@@ -4,9 +4,16 @@ import {
|
|
4
4
|
TreatmentPlans,
|
5
5
|
TreatmentPlansRequest,
|
6
6
|
TreatmentPlansResponse,
|
7
|
+
TreatmentPlanUpdateRequest,
|
7
8
|
Uuid,
|
8
9
|
} from '..'
|
9
|
-
import {
|
10
|
+
import {
|
11
|
+
Diagnosis,
|
12
|
+
Treatment,
|
13
|
+
DiagnosisRequest,
|
14
|
+
TreatmentAndDrugPrescriptionUpdateRequest,
|
15
|
+
TreatmentRequest,
|
16
|
+
} from '../models/diagnosis'
|
10
17
|
import { APIService } from './api'
|
11
18
|
|
12
19
|
export class DiagnosisService {
|
@@ -22,34 +29,19 @@ export class DiagnosisService {
|
|
22
29
|
* @returns a diagnosis
|
23
30
|
*/
|
24
31
|
public getDiagnosisByUuid(uuidDiagnosis: Uuid): Promise<Diagnosis> {
|
25
|
-
return this.api.get<Diagnosis>(
|
26
|
-
`${this.baseURL}/v1/diagnoses/${uuidDiagnosis}`
|
27
|
-
)
|
32
|
+
return this.api.get<Diagnosis>(`${this.baseURL}/v1/diagnoses/${uuidDiagnosis}`)
|
28
33
|
}
|
29
34
|
|
30
35
|
public createDiagnosis(diagnosis: DiagnosisRequest): Promise<Diagnosis> {
|
31
|
-
return this.api.post<Diagnosis>(
|
32
|
-
`${this.baseURL}/v1/diagnoses`,
|
33
|
-
diagnosis
|
34
|
-
)
|
36
|
+
return this.api.post<Diagnosis>(`${this.baseURL}/v1/diagnoses`, diagnosis)
|
35
37
|
}
|
36
38
|
|
37
|
-
public updateDiagnosis(
|
38
|
-
uuid
|
39
|
-
diagnosis: DiagnosisRequest
|
40
|
-
): Promise<Diagnosis> {
|
41
|
-
return this.api.put<Diagnosis>(
|
42
|
-
`${this.baseURL}/v1/diagnoses/${uuid}`,
|
43
|
-
diagnosis
|
44
|
-
)
|
39
|
+
public updateDiagnosis(uuid: string, diagnosis: DiagnosisRequest): Promise<Diagnosis> {
|
40
|
+
return this.api.put<Diagnosis>(`${this.baseURL}/v1/diagnoses/${uuid}`, diagnosis)
|
45
41
|
}
|
46
42
|
|
47
|
-
public getTreatmentsFromDiagnosisUuid(
|
48
|
-
diagnosisUuid
|
49
|
-
): Promise<Treatment[]> {
|
50
|
-
return this.api.get<Treatment[]>(
|
51
|
-
`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`
|
52
|
-
)
|
43
|
+
public getTreatmentsFromDiagnosisUuid(diagnosisUuid: Uuid): Promise<Treatment[]> {
|
44
|
+
return this.api.get<Treatment[]>(`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`)
|
53
45
|
}
|
54
46
|
|
55
47
|
/**
|
@@ -57,13 +49,8 @@ export class DiagnosisService {
|
|
57
49
|
* @param uuidConsult the consult uuid to fetch
|
58
50
|
* @returns an array of TreatmentPlan
|
59
51
|
*/
|
60
|
-
public getTreatmentPlansFromConsultUuid(
|
61
|
-
|
62
|
-
): Promise<TreatmentPlan[]> {
|
63
|
-
return this.api.get<TreatmentPlan[]>(
|
64
|
-
`${this.baseURL}/v1/treatment-plans/`,
|
65
|
-
{ params: { uuidConsult } }
|
66
|
-
)
|
52
|
+
public getTreatmentPlansFromConsultUuid(uuidConsult: Uuid): Promise<TreatmentPlan[]> {
|
53
|
+
return this.api.get<TreatmentPlan[]>(`${this.baseURL}/v1/treatment-plans/`, { params: { uuidConsult } })
|
67
54
|
}
|
68
55
|
|
69
56
|
/**
|
@@ -71,11 +58,8 @@ export class DiagnosisService {
|
|
71
58
|
* @param diagnosisUuid uuid of the diagnosis that the treatment is linked to
|
72
59
|
* @param treatmentRequest the treatment to be inserted
|
73
60
|
*/
|
74
|
-
|
75
|
-
return this.api.post<Treatment>(
|
76
|
-
`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`,
|
77
|
-
treatmentRequest
|
78
|
-
)
|
61
|
+
public createTreatment(diagnosisUuid: string, treatmentRequest: TreatmentRequest) {
|
62
|
+
return this.api.post<Treatment>(`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`, treatmentRequest)
|
79
63
|
}
|
80
64
|
|
81
65
|
/**
|
@@ -83,62 +67,44 @@ export class DiagnosisService {
|
|
83
67
|
* @param uuidConsult the consult uuid to fetch
|
84
68
|
* @returns a TreatmentPlans object
|
85
69
|
*/
|
86
|
-
public getTreatmentPlansPopulatedFromConsultUuid(
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
`${this.baseURL}/v1/treatment-plans/`,
|
91
|
-
{ params: { uuidConsult, populated: true } }
|
92
|
-
)
|
70
|
+
public getTreatmentPlansPopulatedFromConsultUuid(uuidConsult: Uuid): Promise<TreatmentPlans> {
|
71
|
+
return this.api.get<TreatmentPlans>(`${this.baseURL}/v1/treatment-plans/`, {
|
72
|
+
params: { uuidConsult, populated: true },
|
73
|
+
})
|
93
74
|
}
|
94
75
|
|
95
|
-
public postPlans(
|
96
|
-
plans
|
97
|
-
): Promise<TreatmentPlansResponse> {
|
98
|
-
return this.api.post<TreatmentPlansResponse>(
|
99
|
-
`${this.baseURL}/v1/treatment-plans`,
|
100
|
-
plans
|
101
|
-
)
|
76
|
+
public postPlans(plans: TreatmentPlansRequest): Promise<TreatmentPlansResponse> {
|
77
|
+
return this.api.post<TreatmentPlansResponse>(`${this.baseURL}/v1/treatment-plans`, plans)
|
102
78
|
}
|
103
79
|
|
104
80
|
public updateTreatmentPlan(
|
105
81
|
uuidPlan: string,
|
106
82
|
uuidConsult: string,
|
107
83
|
diagnosisRequest: DiagnosisRequest,
|
108
|
-
plan: TreatmentAndDrugPrescriptionUpdateRequest
|
84
|
+
plan: TreatmentAndDrugPrescriptionUpdateRequest,
|
85
|
+
refill?: boolean
|
109
86
|
): Promise<TreatmentPlan> {
|
110
|
-
return this.api.put<TreatmentPlan>(
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
)
|
87
|
+
return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}`, <
|
88
|
+
TreatmentPlanUpdateRequest
|
89
|
+
>{
|
90
|
+
uuidConsult,
|
91
|
+
diagnosis: diagnosisRequest,
|
92
|
+
plan,
|
93
|
+
refill,
|
94
|
+
})
|
118
95
|
}
|
119
96
|
|
120
|
-
public acceptTreatmentPlan(
|
121
|
-
uuidPlan
|
122
|
-
uuidConsult: string
|
123
|
-
): Promise<TreatmentPlan> {
|
124
|
-
return this.api.put<TreatmentPlan>(
|
125
|
-
`${this.baseURL}/v1/treatment-plans/${uuidPlan}/accept`,
|
126
|
-
{ uuidConsult }
|
127
|
-
)
|
97
|
+
public acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan> {
|
98
|
+
return this.api.put<TreatmentPlan>(`${this.baseURL}/v1/treatment-plans/${uuidPlan}/accept`, { uuidConsult })
|
128
99
|
}
|
129
100
|
|
130
101
|
/**
|
131
102
|
* retrieves all the drugs of the specified practice
|
132
103
|
* @param uuidPractice
|
133
104
|
*/
|
134
|
-
public async getAllDrugs(
|
135
|
-
|
136
|
-
|
137
|
-
const res = await this.api.get<{foundDrugs: Drug[]}>(
|
138
|
-
`${this.baseURL}/v1/drugs/practice/${uuidPractice}`,
|
139
|
-
)
|
140
|
-
if(res && res.foundDrugs)
|
141
|
-
return res.foundDrugs
|
105
|
+
public async getAllDrugs(uuidPractice: string): Promise<Drug[] | undefined> {
|
106
|
+
const res = await this.api.get<{ foundDrugs: Drug[] }>(`${this.baseURL}/v1/drugs/practice/${uuidPractice}`)
|
107
|
+
if (res && res.foundDrugs) return res.foundDrugs
|
142
108
|
return undefined
|
143
109
|
}
|
144
110
|
}
|