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.
@@ -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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.0.0",
2
+ "version": "3.1.0",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -55,4 +55,4 @@
55
55
  "buffer": "^6.0.3",
56
56
  "hash.js": "^1.1.7"
57
57
  }
58
- }
58
+ }
@@ -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 { Diagnosis, Treatment, DiagnosisRequest, TreatmentAndDrugPrescriptionUpdateRequest, TreatmentRequest } from '../models/diagnosis'
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: string,
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: Uuid
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
- uuidConsult: Uuid
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
- public createTreatment(diagnosisUuid: string, treatmentRequest: TreatmentRequest) {
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
- uuidConsult: Uuid
88
- ): Promise<TreatmentPlans> {
89
- return this.api.get<TreatmentPlans>(
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: TreatmentPlansRequest
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
- `${this.baseURL}/v1/treatment-plans/${uuidPlan}`,
112
- {
113
- uuidConsult,
114
- diagnosis: diagnosisRequest,
115
- plan
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: string,
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
- uuidPractice: string
136
- ): Promise<Drug[] | undefined> {
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
  }