oro-sdk-apis 3.0.1 → 3.2.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/consult.d.ts +4 -1
- package/dist/oro-sdk-apis.cjs.development.js +5 -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 +5 -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/consult.ts +20 -17
- 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/consult.ts
CHANGED
@@ -73,6 +73,8 @@ export enum MedicalStatus {
|
|
73
73
|
Reopened = 'Reopened',
|
74
74
|
Archived = 'Archived',
|
75
75
|
Failed = 'Failed',
|
76
|
+
ToRefill = 'ToRefill',
|
77
|
+
Refilled = 'Refilled'
|
76
78
|
}
|
77
79
|
|
78
80
|
export enum TaskStatus {
|
@@ -87,23 +89,23 @@ export enum ClosedReasonType {
|
|
87
89
|
/**
|
88
90
|
* A completed consultation
|
89
91
|
*/
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
92
|
+
Completed = "Completed",
|
93
|
+
/**
|
94
|
+
* The conclusion was that what the patient submitted was not a disease
|
95
|
+
*/
|
96
|
+
NotADisease = "NotADisease",
|
97
|
+
/**
|
98
|
+
* The consultation was not appropriate for virtual
|
99
|
+
*/
|
100
|
+
NotAppropriateForVirtual = "NotAppropriateForVirtual",
|
101
|
+
/**
|
102
|
+
* Any other reason why the consultation was closed
|
103
|
+
*/
|
104
|
+
Other = "Other",
|
105
|
+
/**
|
106
|
+
* A consultation that is required to be done in person
|
107
|
+
*/
|
108
|
+
RequiresInPerson = "RequiresInPerson"
|
107
109
|
}
|
108
110
|
|
109
111
|
export interface ClosedConsultReasonInsertFields {
|
@@ -155,6 +157,7 @@ export interface Consult {
|
|
155
157
|
statusMedical?: MedicalStatus
|
156
158
|
uuidAssignedDoctor: string
|
157
159
|
uuidCurrentAssigned: string
|
160
|
+
uuidParent?: string
|
158
161
|
statusTask?: TaskStatus
|
159
162
|
hasTransmissions?: boolean
|
160
163
|
assignedAssistant?: ConsultAssignedAssistant[]
|
@@ -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
|
}
|