@eka-care/ekascribe-ts-sdk 1.5.68 → 1.5.70
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.
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TPostV1ConvertToTemplateRequest, TPostV1ConvertToTemplateResponse } from '../../constants/types';
|
|
2
|
+
declare function postConvertTranscriptionToTemplate({ txn_id, template_id, transcript, }: TPostV1ConvertToTemplateRequest): Promise<TPostV1ConvertToTemplateResponse>;
|
|
3
|
+
export default postConvertTranscriptionToTemplate;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SDK_STATUS_CODE } from '../../constants/constant';
|
|
2
|
+
import fetchWrapper from '../../fetch-client';
|
|
3
|
+
import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
|
|
4
|
+
async function postConvertTranscriptionToTemplate({ txn_id, template_id, transcript, }) {
|
|
5
|
+
try {
|
|
6
|
+
const headers = new Headers();
|
|
7
|
+
headers.append('Content-Type', 'application/json');
|
|
8
|
+
const options = {
|
|
9
|
+
method: 'POST',
|
|
10
|
+
headers,
|
|
11
|
+
body: JSON.stringify({
|
|
12
|
+
transcript,
|
|
13
|
+
template_id,
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/transaction/${txn_id}/convert-to-template?transcript=true`, options, 60000);
|
|
17
|
+
let res = await response.json();
|
|
18
|
+
res = {
|
|
19
|
+
...res,
|
|
20
|
+
code: response.status,
|
|
21
|
+
};
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
|
|
26
|
+
return {
|
|
27
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
28
|
+
message: `Something went wrong! ${error}`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export default postConvertTranscriptionToTemplate;
|
package/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ declare class EkaScribe {
|
|
|
66
66
|
updateTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
67
67
|
deleteTemplateSection(section_id: string): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
68
68
|
postTransactionConvertToTemplate({ txn_id, template_id }: TPostV1ConvertToTemplateRequest): Promise<import("./constants/types").TPostV1ConvertToTemplateResponse>;
|
|
69
|
-
|
|
69
|
+
convertTranscriptionToTemplate(request: TPostV1ConvertToTemplateRequest): Promise<import("./constants/types").TPostV1ConvertToTemplateResponse>;
|
|
70
70
|
searchPastSessions(request: TSearchSessionsRequest): Promise<import("./constants/types").TSessionHistoryData[]>;
|
|
71
71
|
searchSessionsByPatientName(request: TSearchSessionsByPatientRequest): Promise<import("./constants/types").TSessionHistoryData[]>;
|
|
72
72
|
searchSessionsBySessionId(request: TSearchSessionsByPatientRequest): Promise<import("./constants/types").TSessionHistoryData[]>;
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import { patchVoiceApiV3Status } from './api/transaction/patch-voice-api-v3-stat
|
|
|
32
32
|
import searchSessions, { searchSessionsByPatient, searchSessionsBySessionId, } from './utils/search-past-sessions';
|
|
33
33
|
import { getConfigV2MyTemplates } from './api/config/get-voice-api-v2-config-my-templates';
|
|
34
34
|
import putVoiceApiV2Config from './api/config/patch-voice-api-v2-config';
|
|
35
|
-
import
|
|
35
|
+
import postConvertTranscriptionToTemplate from './api/templates/post-convert-transcription-to-template';
|
|
36
36
|
class EkaScribe {
|
|
37
37
|
// Private constructor to prevent direct instantiation
|
|
38
38
|
constructor() {
|
|
@@ -338,8 +338,8 @@ class EkaScribe {
|
|
|
338
338
|
const convertToTemplateResponse = await postV1ConvertToTemplate({ txn_id, template_id });
|
|
339
339
|
return convertToTemplateResponse;
|
|
340
340
|
}
|
|
341
|
-
async
|
|
342
|
-
const convertToTemplateResponse = await
|
|
341
|
+
async convertTranscriptionToTemplate(request) {
|
|
342
|
+
const convertToTemplateResponse = await postConvertTranscriptionToTemplate(request);
|
|
343
343
|
return convertToTemplateResponse;
|
|
344
344
|
}
|
|
345
345
|
async searchPastSessions(request) {
|