@eka-care/ekascribe-ts-sdk 1.4.40 → 1.4.41
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/api/post-transaction-init.d.ts +1 -1
- package/dist/api/post-transaction-init.js +2 -2
- package/dist/constants/types.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/utils/search-sessions-by-patient-name.d.ts +7 -0
- package/dist/utils/search-sessions-by-patient-name.js +27 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TPostTransactionInitRequest, TPostTransactionResponse } from '../constants/types';
|
|
2
|
-
declare function postTransactionInit({ mode, txnId, s3Url, input_language, output_format_template, model_training_consent, auto_download, transfer, system_info,
|
|
2
|
+
declare function postTransactionInit({ mode, txnId, s3Url, input_language, output_format_template, model_training_consent, auto_download, transfer, system_info, model_type, }: TPostTransactionInitRequest): Promise<TPostTransactionResponse>;
|
|
3
3
|
export default postTransactionInit;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SDK_STATUS_CODE } from '../constants/constant';
|
|
2
2
|
import fetchWrapper from '../fetch-client';
|
|
3
3
|
import { GET_EKA_V2RX_HOST_V2 } from '../fetch-client/helper';
|
|
4
|
-
async function postTransactionInit({ mode, txnId, s3Url, input_language, output_format_template, model_training_consent, auto_download, transfer, system_info,
|
|
4
|
+
async function postTransactionInit({ mode, txnId, s3Url, input_language, output_format_template, model_training_consent, auto_download, transfer, system_info, model_type, }) {
|
|
5
5
|
try {
|
|
6
6
|
const headers = new Headers();
|
|
7
7
|
headers.append('Content-Type', 'application/json');
|
|
@@ -14,7 +14,7 @@ async function postTransactionInit({ mode, txnId, s3Url, input_language, output_
|
|
|
14
14
|
auto_download,
|
|
15
15
|
transfer,
|
|
16
16
|
system_info,
|
|
17
|
-
|
|
17
|
+
model_type,
|
|
18
18
|
};
|
|
19
19
|
const options = {
|
|
20
20
|
method: 'POST',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TGetStatusResponse } from './api/transaction/get-voice-api-v3-status';
|
|
2
2
|
import { TEndRecordingResponse, TErrorCallback, TFileUploadProgressCallback, TGetTransactionHistoryResponse, TPatchTransactionRequest, TPatchVoiceApiV2ConfigRequest, TPostTransactionResponse, TPostV1ConvertToTemplateRequest, TPostV1TemplateRequest, TPostV1TemplateSectionRequest, TStartRecordingRequest } from './constants/types';
|
|
3
|
+
import { TSearchSessionsByPatientRequest } from './utils/search-sessions-by-patient-name';
|
|
3
4
|
declare class EkaScribe {
|
|
4
5
|
private static instance;
|
|
5
6
|
private vadInstance;
|
|
@@ -62,6 +63,7 @@ declare class EkaScribe {
|
|
|
62
63
|
updateTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
63
64
|
deleteTemplateSection(section_id: string): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
64
65
|
postTransactionConvertToTemplate({ txn_id, template_id }: TPostV1ConvertToTemplateRequest): Promise<import("./constants/types").TPostV1ConvertToTemplateResponse>;
|
|
66
|
+
searchSessionsByPatientName(request: TSearchSessionsByPatientRequest): Promise<unknown>;
|
|
65
67
|
}
|
|
66
68
|
export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
|
|
67
69
|
access_token?: string;
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ import deleteV1TemplateSection from './api/template-sections/delete-v1-template-
|
|
|
28
28
|
import patchVoiceApiV2Config from './api/config/patch-voice-api-v2-config';
|
|
29
29
|
import cookV1MediaAiCreateTemplate from './api/templates/cook-v1-medai-ai-create-template';
|
|
30
30
|
import postV1ConvertToTemplate from './api/templates/post-transaction-convert-to-template';
|
|
31
|
+
import searchSessionsByPatient from './utils/search-sessions-by-patient-name';
|
|
31
32
|
class EkaScribe {
|
|
32
33
|
// Private constructor to prevent direct instantiation
|
|
33
34
|
constructor() {
|
|
@@ -312,6 +313,10 @@ class EkaScribe {
|
|
|
312
313
|
const convertToTemplateResponse = await postV1ConvertToTemplate({ txn_id, template_id });
|
|
313
314
|
return convertToTemplateResponse;
|
|
314
315
|
}
|
|
316
|
+
async searchSessionsByPatientName(request) {
|
|
317
|
+
const searchSessionsByPatientNameResponse = await searchSessionsByPatient(request);
|
|
318
|
+
return searchSessionsByPatientNameResponse;
|
|
319
|
+
}
|
|
315
320
|
}
|
|
316
321
|
Object.defineProperty(EkaScribe, "instance", {
|
|
317
322
|
enumerable: true,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TSessionHistoryData } from '../constants/types';
|
|
2
|
+
export type TSearchSessionsByPatientRequest = {
|
|
3
|
+
sessions: TSessionHistoryData[];
|
|
4
|
+
patientName: string;
|
|
5
|
+
};
|
|
6
|
+
declare const searchSessionsByPatient: ({ sessions, patientName, }: TSearchSessionsByPatientRequest) => Promise<unknown>;
|
|
7
|
+
export default searchSessionsByPatient;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function debounce(func, delay) {
|
|
2
|
+
let timeoutId;
|
|
3
|
+
return (...args) => {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
clearTimeout(timeoutId);
|
|
6
|
+
timeoutId = setTimeout(() => {
|
|
7
|
+
resolve(func(...args));
|
|
8
|
+
}, delay);
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const searchByName = (sessions, patientName) => {
|
|
13
|
+
if (!patientName.trim()) {
|
|
14
|
+
return sessions;
|
|
15
|
+
}
|
|
16
|
+
const searchTerm = patientName.toLowerCase().trim();
|
|
17
|
+
return sessions.filter((session) => {
|
|
18
|
+
if (!session.patient_details?.username)
|
|
19
|
+
return false;
|
|
20
|
+
return session.patient_details?.username.toLowerCase().includes(searchTerm);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const debouncedSearch = debounce(searchByName, 300);
|
|
24
|
+
const searchSessionsByPatient = async ({ sessions, patientName, }) => {
|
|
25
|
+
return debouncedSearch(sessions, patientName);
|
|
26
|
+
};
|
|
27
|
+
export default searchSessionsByPatient;
|