oro-sdk-apis 4.3.2 → 5.14.0-dev1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import { Consult, Drug, TreatmentAssociatedConsultData, TreatmentPlan, TreatmentPlans, TreatmentPlansRequest, TreatmentPlansResponse, Uuid } from '..';
1
+ import { Drug, TreatmentAssociatedConsultData, TreatmentPlan, TreatmentPlans, TreatmentPlansRequest, TreatmentPlansResponse, Uuid } from '..';
2
2
  import { Diagnosis, Treatment, DiagnosisRequest, TreatmentAndDrugPrescriptionUpdateRequest, TreatmentRequest } from '../models/diagnosis';
3
3
  import { APIService } from './api';
4
4
  export declare class DiagnosisService {
@@ -14,6 +14,7 @@ export declare class DiagnosisService {
14
14
  getDiagnosisByUuid(uuidDiagnosis: Uuid): Promise<Diagnosis>;
15
15
  createDiagnosis(diagnosis: DiagnosisRequest): Promise<Diagnosis>;
16
16
  updateDiagnosis(uuid: string, diagnosis: DiagnosisRequest): Promise<Diagnosis>;
17
+ getTreatmentByUuid(uuidDiagnosis: Uuid, uuidTreatment: Uuid): Promise<Treatment[]>;
17
18
  getTreatmentsFromDiagnosisUuid(diagnosisUuid: Uuid): Promise<Treatment[]>;
18
19
  /**
19
20
  * This function returns treatment plans associated to a consult
@@ -35,9 +36,8 @@ export declare class DiagnosisService {
35
36
  getTreatmentPlansPopulatedFromConsultUuid(uuidConsult: Uuid): Promise<TreatmentPlans>;
36
37
  postPlans(plans: TreatmentPlansRequest): Promise<TreatmentPlansResponse>;
37
38
  updateTreatmentPlan(uuidPlan: string, uuidConsult: string, diagnosisRequest: DiagnosisRequest, plan: TreatmentAndDrugPrescriptionUpdateRequest, refill?: boolean): Promise<TreatmentPlan>;
38
- updateTreatmentPlanAndSetAssociatedConsult(uuidPlan: string, consultAssociated: Consult, diagnosisRequest: DiagnosisRequest, plan: TreatmentAndDrugPrescriptionUpdateRequest, refill?: boolean): Promise<TreatmentPlan>;
39
- setAssociatedConsultsToTreatment(uuidPlan: string, arrAssociatedConsults: TreatmentAssociatedConsultData[]): Promise<TreatmentAssociatedConsultData[]>;
40
- updateAssociatedConsultsToTreatment(uuidPlan: string, arrAssociatedConsults: TreatmentAssociatedConsultData[]): Promise<TreatmentAssociatedConsultData[]>;
39
+ setAssociatedConsultsToTreatment(diagnosisUuid: string, treatmentUuid: string, arrAssociatedConsults: TreatmentAssociatedConsultData[]): Promise<TreatmentAssociatedConsultData[]>;
40
+ updateAssociatedConsultsToTreatment(diagnosisUuid: string, treatmentUuid: string, arrAssociatedConsults: TreatmentAssociatedConsultData[]): Promise<TreatmentAssociatedConsultData[]>;
41
41
  acceptTreatmentPlan(uuidPlan: string, uuidConsult: string): Promise<TreatmentPlan>;
42
42
  /**
43
43
  * retrieves all the drugs of the specified practice
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.3.2",
2
+ "version": "5.14.0-dev1.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
+ }
@@ -42,6 +42,10 @@ export class DiagnosisService {
42
42
  return this.api.put<Diagnosis>(`${this.baseURL}/v1/diagnoses/${uuid}`, diagnosis)
43
43
  }
44
44
 
45
+ public getTreatmentByUuid(uuidDiagnosis: Uuid, uuidTreatment: Uuid): Promise<Treatment[]> {
46
+ return this.api.get<Treatment[]>(`${this.baseURL}/v1/diagnoses/${uuidDiagnosis}/treatments/${uuidTreatment}`)
47
+ }
48
+
45
49
  public getTreatmentsFromDiagnosisUuid(diagnosisUuid: Uuid): Promise<Treatment[]> {
46
50
  return this.api.get<Treatment[]>(`${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments`)
47
51
  }
@@ -96,44 +100,24 @@ export class DiagnosisService {
96
100
  })
97
101
  }
98
102
 
99
- public updateTreatmentPlanAndSetAssociatedConsult(
100
- uuidPlan: string,
101
- consultAssociated: Consult,
102
- diagnosisRequest: DiagnosisRequest,
103
- plan: TreatmentAndDrugPrescriptionUpdateRequest,
104
- refill?: boolean
105
- ): Promise<TreatmentPlan> {
106
- const associatedConsultData : TreatmentAssociatedConsultData = {
107
- uuidConsult: consultAssociated.uuid,
108
- consultKind: consultAssociated.consultType,
109
- }
110
- //this is fire and forget and may fail later
111
- try{
112
- this.updateAssociatedConsultsToTreatment(uuidPlan, [ associatedConsultData ])
113
- }
114
- catch{
115
- console.error( `[SDK Diagnosis] We failed to updated associated consult to the treatment plan ${uuidPlan}`)
116
- }
117
-
118
- return this.updateTreatmentPlan( uuidPlan, consultAssociated.uuid, diagnosisRequest, plan, refill )
119
- }
120
-
121
103
  public setAssociatedConsultsToTreatment(
122
- uuidPlan: string,
104
+ diagnosisUuid: string,
105
+ treatmentUuid: string,
123
106
  arrAssociatedConsults: TreatmentAssociatedConsultData[]
124
107
  ): Promise<TreatmentAssociatedConsultData[]> {
125
108
  return this.api.post<TreatmentAssociatedConsultData[]>(
126
- `${this.baseURL}/v1/treatment-plans/${uuidPlan}/associated-consults`,
109
+ `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`,
127
110
  arrAssociatedConsults
128
111
  )
129
112
  }
130
113
 
131
114
  public updateAssociatedConsultsToTreatment(
132
- uuidPlan: string,
115
+ diagnosisUuid: string,
116
+ treatmentUuid: string,
133
117
  arrAssociatedConsults: TreatmentAssociatedConsultData[]
134
118
  ): Promise<TreatmentAssociatedConsultData[]> {
135
119
  return this.api.put<TreatmentAssociatedConsultData[]>(
136
- `${this.baseURL}/v1/treatment-plans/${uuidPlan}/associated-consults`,
120
+ `${this.baseURL}/v1/diagnoses/${diagnosisUuid}/treatments/${treatmentUuid}/associated-consults`,
137
121
  arrAssociatedConsults
138
122
  )
139
123
  }
@@ -151,4 +135,4 @@ export class DiagnosisService {
151
135
  if (res && res.foundDrugs) return res.foundDrugs
152
136
  return undefined
153
137
  }
154
- }
138
+ }