whio-api-sdk 1.0.223-beta-staging → 1.0.224-beta-staging

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,12 @@
1
+ import { BaseClient } from './base-client';
2
+ import { PatientsFromIntegrationResponse } from '../types/patient.types';
3
+ /**
4
+ * Patient module for handling patient-related API operations
5
+ */
6
+ export declare class PatientModule extends BaseClient {
7
+ /**
8
+ * Get patients from external integration (Tiaki)
9
+ * Returns an empty array if no integration is configured
10
+ */
11
+ getPatientsFromIntegration(): Promise<PatientsFromIntegrationResponse>;
12
+ }
@@ -0,0 +1,25 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { BaseClient } from './base-client';
11
+ import urls from '../urls';
12
+ /**
13
+ * Patient module for handling patient-related API operations
14
+ */
15
+ export class PatientModule extends BaseClient {
16
+ /**
17
+ * Get patients from external integration (Tiaki)
18
+ * Returns an empty array if no integration is configured
19
+ */
20
+ getPatientsFromIntegration() {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ return this.request(`${urls.patients}/from-integration`, 'GET');
23
+ });
24
+ }
25
+ }
@@ -15,6 +15,7 @@ import { DebugModule } from './modules/debug.module';
15
15
  import { ExternalIntegrationModule } from './modules/external-integration.module';
16
16
  import { WebSocketModule } from './modules/websocket.module';
17
17
  import { ReportsModule } from './modules/reports.module';
18
+ import { PatientModule } from './modules/patient.module';
18
19
  /**
19
20
  * Main SDK class that provides access to all domain-specific modules
20
21
  */
@@ -34,6 +35,7 @@ export declare class ApiSDK extends BaseClient {
34
35
  readonly externalIntegrations: ExternalIntegrationModule;
35
36
  readonly websocket: WebSocketModule;
36
37
  readonly reports: ReportsModule;
38
+ readonly patients: PatientModule;
37
39
  constructor(config?: SDKConfig);
38
40
  login(...args: Parameters<AuthModule['login']>): Promise<import("./types").LoginResponse>;
39
41
  logout(...args: Parameters<AuthModule['logout']>): Promise<void>;
@@ -41,9 +43,6 @@ export declare class ApiSDK extends BaseClient {
41
43
  changePassword(...args: Parameters<AuthModule['changePassword']>): Promise<import("./types").PasswordChangeResponse>;
42
44
  adminChangePassword(...args: Parameters<AuthModule['adminChangePassword']>): Promise<import("./types").PasswordChangeResponse>;
43
45
  requestLoginCode(...args: Parameters<AuthModule['requestLoginCode']>): Promise<{
44
- /**
45
- * Main SDK class that provides access to all domain-specific modules
46
- */
47
46
  message: string;
48
47
  }>;
49
48
  loginWithCode(...args: Parameters<AuthModule['loginWithCode']>): Promise<import("./types").LoginResponse>;
@@ -207,4 +206,5 @@ export declare class ApiSDK extends BaseClient {
207
206
  unsubscribe(...args: Parameters<WebSocketModule['off']>): void;
208
207
  getCompanyDailyReportCsv(...args: Parameters<ReportsModule['getCompanyDailyReportCsv']>): Promise<string>;
209
208
  downloadCompanyDailyReport(...args: Parameters<ReportsModule['downloadCompanyDailyReport']>): Promise<Blob>;
209
+ getPatientsFromIntegration(...args: Parameters<PatientModule['getPatientsFromIntegration']>): Promise<import("./types").PatientsFromIntegrationResponse>;
210
210
  }
@@ -23,6 +23,7 @@ import { DebugModule } from './modules/debug.module';
23
23
  import { ExternalIntegrationModule } from './modules/external-integration.module';
24
24
  import { WebSocketModule } from './modules/websocket.module';
25
25
  import { ReportsModule } from './modules/reports.module';
26
+ import { PatientModule } from './modules/patient.module';
26
27
  /**
27
28
  * Main SDK class that provides access to all domain-specific modules
28
29
  */
@@ -45,6 +46,7 @@ export class ApiSDK extends BaseClient {
45
46
  this.externalIntegrations = new ExternalIntegrationModule(config);
46
47
  this.websocket = new WebSocketModule(config);
47
48
  this.reports = new ReportsModule(config);
49
+ this.patients = new PatientModule(config);
48
50
  }
49
51
  // ======================
50
52
  // BACKWARD COMPATIBILITY LAYER
@@ -824,4 +826,10 @@ export class ApiSDK extends BaseClient {
824
826
  return this.reports.downloadCompanyDailyReport(...args);
825
827
  });
826
828
  }
829
+ // Patient methods
830
+ getPatientsFromIntegration(...args) {
831
+ return __awaiter(this, void 0, void 0, function* () {
832
+ return this.patients.getPatientsFromIntegration(...args);
833
+ });
834
+ }
827
835
  }
@@ -12,3 +12,4 @@ export * from './log.types';
12
12
  export * from './external-integration.types';
13
13
  export * from './websocket.types';
14
14
  export * from './reports.types';
15
+ export * from './patient.types';
@@ -13,3 +13,4 @@ export * from './log.types';
13
13
  export * from './external-integration.types';
14
14
  export * from './websocket.types';
15
15
  export * from './reports.types';
16
+ export * from './patient.types';
@@ -0,0 +1,7 @@
1
+ export interface TiakiPatient {
2
+ id: number;
3
+ first_name: string;
4
+ last_name: string;
5
+ nationalid: string;
6
+ }
7
+ export type PatientsFromIntegrationResponse = TiakiPatient[];
@@ -0,0 +1 @@
1
+ export {};
@@ -33,5 +33,6 @@ declare const urls: {
33
33
  debug: string;
34
34
  externalIntegrations: string;
35
35
  reports: string;
36
+ patients: string;
36
37
  };
37
38
  export default urls;
@@ -49,5 +49,7 @@ const urls = {
49
49
  externalIntegrations: '/external-integrations',
50
50
  // Reports
51
51
  reports: '/reports',
52
+ // Patients
53
+ patients: '/patients',
52
54
  };
53
55
  export default urls;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whio-api-sdk",
3
- "version": "1.0.223-beta-staging",
3
+ "version": "1.0.224-beta-staging",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -0,0 +1,17 @@
1
+ import { BaseClient } from './base-client';
2
+ import { PatientsFromIntegrationResponse } from '../types/patient.types';
3
+ import urls from '../urls';
4
+
5
+ /**
6
+ * Patient module for handling patient-related API operations
7
+ */
8
+ export class PatientModule extends BaseClient {
9
+
10
+ /**
11
+ * Get patients from external integration (Tiaki)
12
+ * Returns an empty array if no integration is configured
13
+ */
14
+ async getPatientsFromIntegration(): Promise<PatientsFromIntegrationResponse> {
15
+ return this.request<PatientsFromIntegrationResponse>(`${urls.patients}/from-integration`, 'GET');
16
+ }
17
+ }
package/src/sdk/sdk.ts CHANGED
@@ -16,6 +16,7 @@ import { DebugModule } from './modules/debug.module';
16
16
  import { ExternalIntegrationModule } from './modules/external-integration.module';
17
17
  import { WebSocketModule } from './modules/websocket.module';
18
18
  import { ReportsModule } from './modules/reports.module';
19
+ import { PatientModule } from './modules/patient.module';
19
20
 
20
21
  /**
21
22
  * Main SDK class that provides access to all domain-specific modules
@@ -36,6 +37,7 @@ export class ApiSDK extends BaseClient {
36
37
  public readonly externalIntegrations: ExternalIntegrationModule;
37
38
  public readonly websocket: WebSocketModule;
38
39
  public readonly reports: ReportsModule;
40
+ public readonly patients: PatientModule;
39
41
 
40
42
  constructor(config: SDKConfig = {}) {
41
43
  super(config);
@@ -56,6 +58,7 @@ export class ApiSDK extends BaseClient {
56
58
  this.externalIntegrations = new ExternalIntegrationModule(config);
57
59
  this.websocket = new WebSocketModule(config);
58
60
  this.reports = new ReportsModule(config);
61
+ this.patients = new PatientModule(config);
59
62
  }
60
63
 
61
64
  // ======================
@@ -701,4 +704,9 @@ export class ApiSDK extends BaseClient {
701
704
  return this.reports.downloadCompanyDailyReport(...args);
702
705
  }
703
706
 
707
+ // Patient methods
708
+ public async getPatientsFromIntegration(...args: Parameters<PatientModule['getPatientsFromIntegration']>) {
709
+ return this.patients.getPatientsFromIntegration(...args);
710
+ }
711
+
704
712
  }
@@ -13,3 +13,4 @@ export * from './log.types';
13
13
  export * from './external-integration.types';
14
14
  export * from './websocket.types';
15
15
  export * from './reports.types';
16
+ export * from './patient.types';
@@ -0,0 +1,9 @@
1
+ // Patient types for SDK
2
+ export interface TiakiPatient {
3
+ id: number;
4
+ first_name: string;
5
+ last_name: string;
6
+ nationalid: string;
7
+ }
8
+
9
+ export type PatientsFromIntegrationResponse = TiakiPatient[];
package/src/sdk/urls.ts CHANGED
@@ -64,6 +64,9 @@ const urls = {
64
64
 
65
65
  // Reports
66
66
  reports: '/reports',
67
+
68
+ // Patients
69
+ patients: '/patients',
67
70
  }
68
71
 
69
72
  export default urls;