@eka-care/ekascribe-ts-sdk 2.1.26 → 2.1.28
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/index.d.ts +46 -0
- package/dist/index.mjs +55 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,9 @@ declare class EkaScribe {
|
|
|
77
77
|
getSessionHistory({ txn_count }: {
|
|
78
78
|
txn_count: number;
|
|
79
79
|
}): Promise<TGetTransactionHistoryResponse>;
|
|
80
|
+
deleteSession({ txn_id }: {
|
|
81
|
+
txn_id: string;
|
|
82
|
+
}): Promise<TDeleteTransactionResponse>;
|
|
80
83
|
getSuccessFiles(): string[];
|
|
81
84
|
getFailedFiles(): string[];
|
|
82
85
|
getTotalAudioFiles(): TAudioChunksInfo[];
|
|
@@ -118,6 +121,7 @@ declare class EkaScribe {
|
|
|
118
121
|
destroySharedWorker(): Promise<void>;
|
|
119
122
|
getDoctorHeaderFooter(request: TGetDoctorHeaderFooterRequest): Promise<TGetDoctorHeaderFooterResponse>;
|
|
120
123
|
getDoctorClinics(request: TGetDoctorClinicsRequest): Promise<TGetDoctorClinicsResponse>;
|
|
124
|
+
getSuggestedMedications(txnId: string): Promise<TSuggestedMedicationResponse>;
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
export declare enum ERROR_CODE {
|
|
@@ -217,6 +221,18 @@ export declare type TConfigSettings = {
|
|
|
217
221
|
};
|
|
218
222
|
};
|
|
219
223
|
|
|
224
|
+
declare type TDeleteTransactionResponse = {
|
|
225
|
+
code: number;
|
|
226
|
+
message?: string;
|
|
227
|
+
status?: string;
|
|
228
|
+
txn_id?: string;
|
|
229
|
+
error?: {
|
|
230
|
+
code: string;
|
|
231
|
+
message: string;
|
|
232
|
+
display_message?: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
|
|
220
236
|
declare type TDoctorHeaderFooterInfo = {
|
|
221
237
|
_id: string | null;
|
|
222
238
|
clinic_id: string | null;
|
|
@@ -737,6 +753,36 @@ export declare type TStartRecordingResponse = {
|
|
|
737
753
|
uuid?: string;
|
|
738
754
|
};
|
|
739
755
|
|
|
756
|
+
export declare type TSuggestedMedication = {
|
|
757
|
+
extracted: {
|
|
758
|
+
name: string;
|
|
759
|
+
dose: string | null;
|
|
760
|
+
frequency: string | null;
|
|
761
|
+
duration: string | null;
|
|
762
|
+
route: string | null;
|
|
763
|
+
};
|
|
764
|
+
suggestions: Array<{
|
|
765
|
+
coded_name: string;
|
|
766
|
+
coded_generic_name: string | null;
|
|
767
|
+
coded_dose_unit: string | null;
|
|
768
|
+
coded_form: string | null;
|
|
769
|
+
eka_id: string;
|
|
770
|
+
locale_id: string;
|
|
771
|
+
uncoded_name: string;
|
|
772
|
+
source: string;
|
|
773
|
+
is_fhir_confidence: boolean;
|
|
774
|
+
is_brandname_matched: boolean;
|
|
775
|
+
[key: string]: unknown;
|
|
776
|
+
}>;
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
declare type TSuggestedMedicationResponse = {
|
|
780
|
+
code: number;
|
|
781
|
+
message?: string;
|
|
782
|
+
session_id?: string;
|
|
783
|
+
medications?: TSuggestedMedication[];
|
|
784
|
+
};
|
|
785
|
+
|
|
740
786
|
export declare type TSystemInfo = {
|
|
741
787
|
platform: string;
|
|
742
788
|
language: string;
|
package/dist/index.mjs
CHANGED
|
@@ -30178,6 +30178,29 @@ const initialiseTransaction = async (s) => {
|
|
|
30178
30178
|
message: `Something went wrong in fetching transactions. ${n}`
|
|
30179
30179
|
};
|
|
30180
30180
|
}
|
|
30181
|
+
}, deleteTransaction = async ({
|
|
30182
|
+
txn_id: s
|
|
30183
|
+
}) => {
|
|
30184
|
+
try {
|
|
30185
|
+
const n = new Headers();
|
|
30186
|
+
n.append("Content-Type", "application/json");
|
|
30187
|
+
const i = {
|
|
30188
|
+
method: "DELETE",
|
|
30189
|
+
headers: n
|
|
30190
|
+
}, c = await fetchWrapper(
|
|
30191
|
+
`${GET_EKA_VOICE_HOST_V2()}/transaction/${s}`,
|
|
30192
|
+
i
|
|
30193
|
+
);
|
|
30194
|
+
return {
|
|
30195
|
+
...await c.json(),
|
|
30196
|
+
code: c.status
|
|
30197
|
+
};
|
|
30198
|
+
} catch (n) {
|
|
30199
|
+
return {
|
|
30200
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
30201
|
+
message: `Something went wrong in deleting transaction. ${n}`
|
|
30202
|
+
};
|
|
30203
|
+
}
|
|
30181
30204
|
};
|
|
30182
30205
|
async function getV1Templates() {
|
|
30183
30206
|
try {
|
|
@@ -31495,7 +31518,25 @@ const DEFAULT_HEADER_IMAGE = "https://cdn.eka.care/vagus/cmlf0ip4a00000td1dmth2w
|
|
|
31495
31518
|
message: `Failed to fetch doctor clinics, ${n}`
|
|
31496
31519
|
};
|
|
31497
31520
|
}
|
|
31498
|
-
}
|
|
31521
|
+
};
|
|
31522
|
+
async function getV1SessionSuggestedMedications(s) {
|
|
31523
|
+
try {
|
|
31524
|
+
const n = await fetchWrapper(
|
|
31525
|
+
`${GET_EKA_HOST()}/voice/v1/session/${s}/suggested-medications`,
|
|
31526
|
+
{ method: "GET" }
|
|
31527
|
+
);
|
|
31528
|
+
return {
|
|
31529
|
+
...await n.json(),
|
|
31530
|
+
code: n.status
|
|
31531
|
+
};
|
|
31532
|
+
} catch (n) {
|
|
31533
|
+
return console.error("Error in export async function getV1SessionSuggestedMedications api: ", n), {
|
|
31534
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31535
|
+
message: `Failed to fetch initial configurations, ${n}`
|
|
31536
|
+
};
|
|
31537
|
+
}
|
|
31538
|
+
}
|
|
31539
|
+
const _n = class _n {
|
|
31499
31540
|
// SystemCompatibilityManager Instance
|
|
31500
31541
|
// Private constructor to prevent direct instantiation
|
|
31501
31542
|
constructor() {
|
|
@@ -31716,6 +31757,16 @@ const DEFAULT_HEADER_IMAGE = "https://cdn.eka.care/vagus/cmlf0ip4a00000td1dmth2w
|
|
|
31716
31757
|
};
|
|
31717
31758
|
}
|
|
31718
31759
|
}
|
|
31760
|
+
async deleteSession({ txn_id: n }) {
|
|
31761
|
+
try {
|
|
31762
|
+
return await deleteTransaction({ txn_id: n });
|
|
31763
|
+
} catch (i) {
|
|
31764
|
+
return {
|
|
31765
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31766
|
+
message: `Failed to delete session, ${i}`
|
|
31767
|
+
};
|
|
31768
|
+
}
|
|
31769
|
+
}
|
|
31719
31770
|
getSuccessFiles() {
|
|
31720
31771
|
return this.audioFileManagerInstance.getSuccessfulAudioFileNames();
|
|
31721
31772
|
}
|
|
@@ -31836,6 +31887,9 @@ const DEFAULT_HEADER_IMAGE = "https://cdn.eka.care/vagus/cmlf0ip4a00000td1dmth2w
|
|
|
31836
31887
|
async getDoctorClinics(n) {
|
|
31837
31888
|
return await getDoctorClinics(n);
|
|
31838
31889
|
}
|
|
31890
|
+
async getSuggestedMedications(n) {
|
|
31891
|
+
return getV1SessionSuggestedMedications(n);
|
|
31892
|
+
}
|
|
31839
31893
|
};
|
|
31840
31894
|
_n.instance = null;
|
|
31841
31895
|
let EkaScribe = _n;
|