@fincuratech/sikka-sdk-js 0.0.1
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/LICENSE +21 -0
- package/README.md +373 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/client.js +244 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/logger.js +47 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/client.d.ts +33 -0
- package/dist/types/lib/client.d.ts.map +1 -0
- package/dist/types/lib/logger.d.ts +11 -0
- package/dist/types/lib/logger.d.ts.map +1 -0
- package/dist/types/lib/types.d.ts +255 -0
- package/dist/types/lib/types.d.ts.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Fincura Technologies, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
# Sikka SDK for JavaScript/TypeScript
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for [Sikka ONE API](https://www.sikkasoft.com/oneapi). This library provides type-safe wrappers for Sikka's REST APIs, enabling integration with 400+ practice management systems across dental, medical, and veterinary healthcare.
|
|
4
|
+
|
|
5
|
+
> [!NOTE]
|
|
6
|
+
> This is an unofficial third-party SDK for integrating with Sikka APIs. It is not affiliated with or endorsed by Sikka Software. Learn more [about us](#about-us).
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/@fincuratech/sikka-sdk-js)
|
|
9
|
+
[](https://www.typescriptlang.org/)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- Complete TypeScript definitions for API methods and responses
|
|
15
|
+
- Type-safe client for Sikka ONE API
|
|
16
|
+
- Automatic token refresh handling
|
|
17
|
+
- Flexible logging with support for custom loggers (Winston, Pino, etc.)
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
|
|
21
|
+
- [Installation](#installation)
|
|
22
|
+
- [Quick Start](#quick-start)
|
|
23
|
+
- [API Reference](#api-reference)
|
|
24
|
+
- [TypeScript Support](#typescript-support)
|
|
25
|
+
- [Logging](#logging)
|
|
26
|
+
- [Contributing](#contributing)
|
|
27
|
+
- [License](#license)
|
|
28
|
+
- [Resources](#resources)
|
|
29
|
+
- [Support](#support)
|
|
30
|
+
- [About Us](#about-us)
|
|
31
|
+
|
|
32
|
+
## Requirements
|
|
33
|
+
|
|
34
|
+
- Node.js >= 20.x
|
|
35
|
+
- TypeScript >= 5.0 (for development)
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @fincuratech/sikka-sdk-js
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
or with yarn:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
yarn add @fincuratech/sikka-sdk-js
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
or with pnpm:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm add @fincuratech/sikka-sdk-js
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { createSikkaClient } from '@fincuratech/sikka-sdk-js';
|
|
59
|
+
|
|
60
|
+
// Create a client with your credentials
|
|
61
|
+
const sikka = createSikkaClient({
|
|
62
|
+
appId: 'your-app-id',
|
|
63
|
+
appKey: 'your-app-key',
|
|
64
|
+
officeId: 'practice-office-id',
|
|
65
|
+
secretKey: 'practice-secret-key',
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Authenticate (required before making other API calls)
|
|
69
|
+
await sikka.authenticate();
|
|
70
|
+
|
|
71
|
+
// Example: Search for patients
|
|
72
|
+
const patients = await sikka.patients.list({
|
|
73
|
+
firstname: 'John',
|
|
74
|
+
lastname: 'Doe',
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## API Reference
|
|
79
|
+
|
|
80
|
+
### Authentication
|
|
81
|
+
|
|
82
|
+
The client is initialized with all credentials upfront:
|
|
83
|
+
|
|
84
|
+
- `appId` - Your Sikka app ID
|
|
85
|
+
- `appKey` - Your Sikka app key
|
|
86
|
+
- `officeId` - The practice/office identifier
|
|
87
|
+
- `secretKey` - The practice secret key
|
|
88
|
+
|
|
89
|
+
#### `authenticate()`
|
|
90
|
+
|
|
91
|
+
Authenticate with the Sikka API for a specific practice. Must be called before making any other API requests. The request key is valid for 24 hours and is automatically refreshed when needed.
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
await sikka.authenticate();
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Additional methods:**
|
|
98
|
+
|
|
99
|
+
- `isAuthenticated()` - Check if authenticated
|
|
100
|
+
- `getRequestKey()` - Get current request key (throws if not authenticated)
|
|
101
|
+
- `clearAuth()` - Clear authentication
|
|
102
|
+
- `refreshAuthentication()` - Manually refresh the token
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### Patients
|
|
107
|
+
|
|
108
|
+
#### `patients.list(params)`
|
|
109
|
+
|
|
110
|
+
Search for patients by name, birthdate, or patient ID.
|
|
111
|
+
|
|
112
|
+
**Parameters:**
|
|
113
|
+
|
|
114
|
+
| Name | Type | Required | Description |
|
|
115
|
+
|------|------|----------|-------------|
|
|
116
|
+
| `firstname` | string | | Filter by first name |
|
|
117
|
+
| `lastname` | string | | Filter by last name |
|
|
118
|
+
| `birthdate` | string | | Filter by birthdate |
|
|
119
|
+
| `patient_id` | string | | Filter by patient ID |
|
|
120
|
+
| `limit` | number | | Results per page |
|
|
121
|
+
| `offset` | number | | Pagination offset |
|
|
122
|
+
|
|
123
|
+
**Returns:** `Promise<SikkaPatient[]>`
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
const patients = await sikka.patients.list({
|
|
127
|
+
firstname: 'John',
|
|
128
|
+
lastname: 'Doe',
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
### Claims
|
|
135
|
+
|
|
136
|
+
#### `claims.list(params)`
|
|
137
|
+
|
|
138
|
+
Retrieve insurance claims for patients.
|
|
139
|
+
|
|
140
|
+
**Parameters:**
|
|
141
|
+
|
|
142
|
+
| Name | Type | Required | Description |
|
|
143
|
+
|------|------|----------|-------------|
|
|
144
|
+
| `patient_id` | string | | Filter by patient ID |
|
|
145
|
+
| `claim_id` | string | | Filter by claim ID |
|
|
146
|
+
| `status` | string | | Filter by claim status |
|
|
147
|
+
| `start_date` | string | | Filter claims after this date |
|
|
148
|
+
| `end_date` | string | | Filter claims before this date |
|
|
149
|
+
| `limit` | number | | Results per page |
|
|
150
|
+
| `offset` | number | | Pagination offset |
|
|
151
|
+
|
|
152
|
+
**Returns:** `Promise<SikkaClaim[]>`
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
const claims = await sikka.claims.list({
|
|
156
|
+
patient_id: '12345',
|
|
157
|
+
status: 'Pending',
|
|
158
|
+
start_date: '2024-01-01',
|
|
159
|
+
end_date: '2024-12-31',
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### Transactions
|
|
166
|
+
|
|
167
|
+
Transactions represent both procedures (service line items) and payments.
|
|
168
|
+
|
|
169
|
+
#### `transactions.list(params)`
|
|
170
|
+
|
|
171
|
+
List transactions for a claim or patient.
|
|
172
|
+
|
|
173
|
+
**Parameters:**
|
|
174
|
+
|
|
175
|
+
| Name | Type | Required | Description |
|
|
176
|
+
|------|------|----------|-------------|
|
|
177
|
+
| `claim_sr_no` | string | | Filter by claim serial number |
|
|
178
|
+
| `patient_id` | string | | Filter by patient ID |
|
|
179
|
+
| `transaction_type` | string | | Filter by type (`Procedure` or `Payment`) |
|
|
180
|
+
| `limit` | number | | Results per page |
|
|
181
|
+
| `offset` | number | | Pagination offset |
|
|
182
|
+
|
|
183
|
+
**Returns:** `Promise<SikkaTransaction[]>`
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
const transactions = await sikka.transactions.list({
|
|
187
|
+
claim_sr_no: '123456',
|
|
188
|
+
});
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
#### `transactions.listProcedures(claimSrNo)`
|
|
194
|
+
|
|
195
|
+
Convenience method to list only procedure transactions for a claim.
|
|
196
|
+
|
|
197
|
+
**Returns:** `Promise<SikkaTransaction[]>`
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
const procedures = await sikka.transactions.listProcedures('123456');
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
### Claim Payments
|
|
206
|
+
|
|
207
|
+
#### `claimPayment.post(request)`
|
|
208
|
+
|
|
209
|
+
Post a payment to a claim. Uses pipe-delimited values for posting payments across multiple line items.
|
|
210
|
+
|
|
211
|
+
**Parameters:**
|
|
212
|
+
|
|
213
|
+
| Name | Type | Required | Description |
|
|
214
|
+
|------|------|----------|-------------|
|
|
215
|
+
| `claim_sr_no` | string | ✓ | Claim serial number |
|
|
216
|
+
| `practice_id` | string | ✓ | Practice ID |
|
|
217
|
+
| `payment_amount` | string | ✓ | Pipe-delimited payment amounts |
|
|
218
|
+
| `transaction_sr_no` | string | ✓ | Pipe-delimited transaction IDs |
|
|
219
|
+
| `write_off` | string | ✓ | Pipe-delimited write-off amounts |
|
|
220
|
+
| `claim_payment_date` | string | ✓ | Payment date (YYYY-MM-DD) |
|
|
221
|
+
| `payment_mode` | string | ✓ | `Cash`, `Check`, or `EFT` |
|
|
222
|
+
| `cheque_no` | string | ✓ | Check/EFT reference number |
|
|
223
|
+
| `is_payment_by_procedure_code` | string | ✓ | `'true'` or `'false'` |
|
|
224
|
+
| `note` | string | ✓ | Payment notes |
|
|
225
|
+
|
|
226
|
+
**Returns:** `Promise<SikkaClaimPaymentResponse>`
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
const result = await sikka.claimPayment.post({
|
|
230
|
+
claim_sr_no: '123456',
|
|
231
|
+
practice_id: 'practice-id',
|
|
232
|
+
payment_amount: '100.00|50.00', // Payment for each line item
|
|
233
|
+
transaction_sr_no: '789|790', // Corresponding transaction IDs
|
|
234
|
+
write_off: '0.00|0.00',
|
|
235
|
+
claim_payment_date: '2024-01-15',
|
|
236
|
+
payment_mode: 'EFT',
|
|
237
|
+
cheque_no: 'CHK123',
|
|
238
|
+
is_payment_by_procedure_code: 'false',
|
|
239
|
+
note: 'Insurance payment',
|
|
240
|
+
});
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## TypeScript Support
|
|
246
|
+
|
|
247
|
+
This SDK is written in TypeScript and provides full type definitions.
|
|
248
|
+
|
|
249
|
+
### Available Types
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import type {
|
|
253
|
+
// Client & Config
|
|
254
|
+
SikkaClient,
|
|
255
|
+
SikkaClientConfig,
|
|
256
|
+
SikkaClientCredentials,
|
|
257
|
+
|
|
258
|
+
// Authentication
|
|
259
|
+
SikkaRequestKeyRequest,
|
|
260
|
+
SikkaRequestKeyResponse,
|
|
261
|
+
SikkaGrantType,
|
|
262
|
+
|
|
263
|
+
// Patients
|
|
264
|
+
SikkaPatient,
|
|
265
|
+
SikkaPatientListParams,
|
|
266
|
+
SikkaPatientListResponse,
|
|
267
|
+
|
|
268
|
+
// Claims
|
|
269
|
+
SikkaClaim,
|
|
270
|
+
SikkaClaimListParams,
|
|
271
|
+
SikkaClaimListResponse,
|
|
272
|
+
|
|
273
|
+
// Transactions
|
|
274
|
+
SikkaTransaction,
|
|
275
|
+
SikkaTransactionType,
|
|
276
|
+
SikkaTransactionListParams,
|
|
277
|
+
SikkaTransactionListResponse,
|
|
278
|
+
|
|
279
|
+
// Payments
|
|
280
|
+
SikkaClaimPaymentRequest,
|
|
281
|
+
SikkaClaimPaymentResponse,
|
|
282
|
+
SikkaPaymentMode,
|
|
283
|
+
|
|
284
|
+
// Common
|
|
285
|
+
SikkaPaginatedResponse,
|
|
286
|
+
SikkaApiError,
|
|
287
|
+
} from '@fincuratech/sikka-sdk-js';
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Logging
|
|
291
|
+
|
|
292
|
+
The SDK is **silent by default**. Enable logging for debugging:
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
import { createSikkaClient, setLogger, createConsoleLogger } from '@fincuratech/sikka-sdk-js';
|
|
296
|
+
|
|
297
|
+
setLogger(createConsoleLogger('debug'));
|
|
298
|
+
|
|
299
|
+
const sikka = createSikkaClient({
|
|
300
|
+
appId: 'your-app-id',
|
|
301
|
+
appKey: 'your-app-key',
|
|
302
|
+
officeId: 'office-id',
|
|
303
|
+
secretKey: 'secret-key',
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Available log levels: `'debug'` | `'info'` | `'warn'` | `'error'`
|
|
308
|
+
|
|
309
|
+
### Custom Logger
|
|
310
|
+
|
|
311
|
+
Integrate any logging framework by implementing the `Logger` interface:
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
import { setLogger, type Logger } from '@fincuratech/sikka-sdk-js';
|
|
315
|
+
|
|
316
|
+
const customLogger: Logger = {
|
|
317
|
+
debug: (message, meta) => { /* ... */ },
|
|
318
|
+
info: (message, meta) => { /* ... */ },
|
|
319
|
+
warn: (message, meta) => { /* ... */ },
|
|
320
|
+
error: (message, meta) => { /* ... */ },
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
setLogger(customLogger);
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Contributing
|
|
327
|
+
|
|
328
|
+
Contributions are welcome. Please follow these guidelines:
|
|
329
|
+
|
|
330
|
+
### Development Setup
|
|
331
|
+
|
|
332
|
+
**Use pnpm** - npm has issues with platform-specific native bindings (especially on macOS).
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
pnpm install
|
|
336
|
+
pnpm test
|
|
337
|
+
pnpm run lint
|
|
338
|
+
pnpm run build
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Guidelines
|
|
342
|
+
|
|
343
|
+
- Write tests for new features
|
|
344
|
+
- Follow the existing code style
|
|
345
|
+
- Update documentation for API changes
|
|
346
|
+
- Ensure all tests pass before submitting PRs
|
|
347
|
+
- Use conventional commit messages
|
|
348
|
+
|
|
349
|
+
## License
|
|
350
|
+
|
|
351
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for full details.
|
|
352
|
+
|
|
353
|
+
Copyright (c) 2024 Fincura Technologies, Inc.
|
|
354
|
+
|
|
355
|
+
## Resources
|
|
356
|
+
|
|
357
|
+
- [Sikka ONE API](https://www.sikkasoft.com/oneapi)
|
|
358
|
+
- [Sikka Software](https://www.sikkasoft.com)
|
|
359
|
+
|
|
360
|
+
## Support
|
|
361
|
+
|
|
362
|
+
For issues and questions:
|
|
363
|
+
|
|
364
|
+
- Open an issue on [GitHub](https://github.com/fincura-ai/sikka-sdk-js/issues)
|
|
365
|
+
- Contact Us at [tech@fincura.ai](mailto:tech@fincura.ai)
|
|
366
|
+
|
|
367
|
+
## About Us
|
|
368
|
+
|
|
369
|
+
Developed by [Fincura Technologies, Inc.](https://fincura.ai)
|
|
370
|
+
|
|
371
|
+
We provide healthcare practices and providers with automated insurance payment reconciliation and posting software, enabling provider staff to get paid 2.5x faster by payers and automate 40 hours per month in payment reconciliations.
|
|
372
|
+
|
|
373
|
+
Our platform leverages multiple sources to access ERA 835 payment remittance details of health insurance claims, including direct payer integrations and clearinghouse partners. This SDK powers integrations with Sikka's ONE API for patient management, claims data, and payment posting across 400+ practice management systems.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAEhB,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,cAAc,gBAAgB,CAAC","sourcesContent":["export { createSikkaClient, SikkaClient } from './lib/client.js';\nexport {\n createConsoleLogger,\n createNoOpLogger,\n type Logger,\n setLogger,\n} from './lib/logger.js';\nexport * from './lib/types.js';\n"]}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { getLogger } from './logger.js';
|
|
2
|
+
const SIKKA_BASE_URL = 'https://api.sikkasoft.com';
|
|
3
|
+
export class SikkaClient {
|
|
4
|
+
claimPayment = {
|
|
5
|
+
post: async (request) => {
|
|
6
|
+
const response = await this.post('/v4/claim_payment', request);
|
|
7
|
+
return response;
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
claims = {
|
|
11
|
+
list: async (params) => {
|
|
12
|
+
const queryParams = {};
|
|
13
|
+
if (params.patient_id) {
|
|
14
|
+
queryParams.patient_id = params.patient_id;
|
|
15
|
+
}
|
|
16
|
+
if (params.claim_id) {
|
|
17
|
+
queryParams.claim_id = params.claim_id;
|
|
18
|
+
}
|
|
19
|
+
if (params.status) {
|
|
20
|
+
queryParams.status = params.status;
|
|
21
|
+
}
|
|
22
|
+
if (params.start_date) {
|
|
23
|
+
queryParams.start_date = params.start_date;
|
|
24
|
+
}
|
|
25
|
+
if (params.end_date) {
|
|
26
|
+
queryParams.end_date = params.end_date;
|
|
27
|
+
}
|
|
28
|
+
if (params.limit) {
|
|
29
|
+
queryParams.limit = String(params.limit);
|
|
30
|
+
}
|
|
31
|
+
if (params.offset) {
|
|
32
|
+
queryParams.offset = String(params.offset);
|
|
33
|
+
}
|
|
34
|
+
const response = await this.get('/v4/claims', queryParams);
|
|
35
|
+
return response.items;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
patients = {
|
|
39
|
+
list: async (params) => {
|
|
40
|
+
const queryParams = {};
|
|
41
|
+
if (params.firstname) {
|
|
42
|
+
queryParams.firstname = params.firstname;
|
|
43
|
+
}
|
|
44
|
+
if (params.lastname) {
|
|
45
|
+
queryParams.lastname = params.lastname;
|
|
46
|
+
}
|
|
47
|
+
if (params.birthdate) {
|
|
48
|
+
queryParams.birthdate = params.birthdate;
|
|
49
|
+
}
|
|
50
|
+
if (params.patient_id) {
|
|
51
|
+
queryParams.patient_id = params.patient_id;
|
|
52
|
+
}
|
|
53
|
+
if (params.limit) {
|
|
54
|
+
queryParams.limit = String(params.limit);
|
|
55
|
+
}
|
|
56
|
+
if (params.offset) {
|
|
57
|
+
queryParams.offset = String(params.offset);
|
|
58
|
+
}
|
|
59
|
+
const response = await this.get('/v4/patients', queryParams);
|
|
60
|
+
return response.items;
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
transactions = {
|
|
64
|
+
list: async (params) => {
|
|
65
|
+
const queryParams = {};
|
|
66
|
+
if (params.claim_sr_no) {
|
|
67
|
+
queryParams.claim_sr_no = params.claim_sr_no;
|
|
68
|
+
}
|
|
69
|
+
if (params.patient_id) {
|
|
70
|
+
queryParams.patient_id = params.patient_id;
|
|
71
|
+
}
|
|
72
|
+
if (params.transaction_type) {
|
|
73
|
+
queryParams.transaction_type = params.transaction_type;
|
|
74
|
+
}
|
|
75
|
+
if (params.limit) {
|
|
76
|
+
queryParams.limit = String(params.limit);
|
|
77
|
+
}
|
|
78
|
+
if (params.offset) {
|
|
79
|
+
queryParams.offset = String(params.offset);
|
|
80
|
+
}
|
|
81
|
+
const response = await this.get('/v4/transactions', queryParams);
|
|
82
|
+
return response.items;
|
|
83
|
+
},
|
|
84
|
+
listProcedures: async (claimSrNo) => {
|
|
85
|
+
const transactions = await this.transactions.list({
|
|
86
|
+
claim_sr_no: claimSrNo,
|
|
87
|
+
});
|
|
88
|
+
return transactions.filter((txn) => txn.transaction_type === 'Procedure');
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
baseUrl;
|
|
92
|
+
credentials;
|
|
93
|
+
refreshKey = null;
|
|
94
|
+
requestKey = null;
|
|
95
|
+
requestKeyExpiresAt = null;
|
|
96
|
+
constructor(config) {
|
|
97
|
+
this.baseUrl = config.baseUrl ?? SIKKA_BASE_URL;
|
|
98
|
+
this.credentials = config.credentials;
|
|
99
|
+
}
|
|
100
|
+
async authenticate() {
|
|
101
|
+
const log = getLogger();
|
|
102
|
+
log.debug('Sikka API: Authenticating');
|
|
103
|
+
const requestBody = {
|
|
104
|
+
app_id: this.credentials.appId,
|
|
105
|
+
app_key: this.credentials.appKey,
|
|
106
|
+
grant_type: 'request_key',
|
|
107
|
+
office_id: this.credentials.officeId,
|
|
108
|
+
secret_key: this.credentials.secretKey,
|
|
109
|
+
};
|
|
110
|
+
const response = await this.requestNewKey(requestBody);
|
|
111
|
+
this.requestKey = response.request_key;
|
|
112
|
+
this.refreshKey = response.refresh_key;
|
|
113
|
+
this.requestKeyExpiresAt = new Date(response.end_time);
|
|
114
|
+
log.debug('Sikka API: Authenticated successfully', {
|
|
115
|
+
expiresAt: this.requestKeyExpiresAt.toISOString(),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
clearAuth() {
|
|
119
|
+
this.requestKey = null;
|
|
120
|
+
this.refreshKey = null;
|
|
121
|
+
this.requestKeyExpiresAt = null;
|
|
122
|
+
}
|
|
123
|
+
async ensureAuthenticated() {
|
|
124
|
+
if (!this.requestKey) {
|
|
125
|
+
throw new Error('Not authenticated. Call authenticate() first.');
|
|
126
|
+
}
|
|
127
|
+
const oneHourFromNow = new Date(Date.now() + 60 * 60 * 1_000);
|
|
128
|
+
if (this.requestKeyExpiresAt && this.requestKeyExpiresAt < oneHourFromNow) {
|
|
129
|
+
await this.refreshAuthentication();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async get(endpoint, params) {
|
|
133
|
+
const log = getLogger();
|
|
134
|
+
await this.ensureAuthenticated();
|
|
135
|
+
const requestKey = this.getRequestKey();
|
|
136
|
+
const url = new URL(`${this.baseUrl}${endpoint}`);
|
|
137
|
+
url.searchParams.set('request_key', requestKey);
|
|
138
|
+
if (params) {
|
|
139
|
+
for (const [key, value] of Object.entries(params)) {
|
|
140
|
+
url.searchParams.set(key, value);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
log.debug('Sikka API GET request', { endpoint, params });
|
|
144
|
+
const response = await fetch(url.toString(), {
|
|
145
|
+
headers: {
|
|
146
|
+
'Content-Type': 'application/json',
|
|
147
|
+
'Request-Key': requestKey,
|
|
148
|
+
},
|
|
149
|
+
method: 'GET',
|
|
150
|
+
});
|
|
151
|
+
if (!response.ok) {
|
|
152
|
+
const errorBody = await response.text();
|
|
153
|
+
throw new Error(`Sikka API GET ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`);
|
|
154
|
+
}
|
|
155
|
+
const text = await response.text();
|
|
156
|
+
if (!text || text.trim() === '') {
|
|
157
|
+
return { items: [] };
|
|
158
|
+
}
|
|
159
|
+
const data = JSON.parse(text);
|
|
160
|
+
log.debug('Sikka API GET response', { endpoint, status: response.status });
|
|
161
|
+
return data;
|
|
162
|
+
}
|
|
163
|
+
getRequestKey() {
|
|
164
|
+
if (!this.requestKey) {
|
|
165
|
+
throw new Error('Not authenticated. Call authenticate() first.');
|
|
166
|
+
}
|
|
167
|
+
return this.requestKey;
|
|
168
|
+
}
|
|
169
|
+
isAuthenticated() {
|
|
170
|
+
if (!this.requestKey || !this.requestKeyExpiresAt) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return this.requestKeyExpiresAt > new Date();
|
|
174
|
+
}
|
|
175
|
+
async post(endpoint, body) {
|
|
176
|
+
const log = getLogger();
|
|
177
|
+
await this.ensureAuthenticated();
|
|
178
|
+
const requestKey = this.getRequestKey();
|
|
179
|
+
const url = new URL(`${this.baseUrl}${endpoint}`);
|
|
180
|
+
url.searchParams.set('request_key', requestKey);
|
|
181
|
+
log.debug('Sikka API POST request', { body, endpoint });
|
|
182
|
+
const response = await fetch(url.toString(), {
|
|
183
|
+
body: JSON.stringify(body),
|
|
184
|
+
headers: {
|
|
185
|
+
'Content-Type': 'application/json',
|
|
186
|
+
'Request-Key': requestKey,
|
|
187
|
+
},
|
|
188
|
+
method: 'POST',
|
|
189
|
+
});
|
|
190
|
+
if (!response.ok) {
|
|
191
|
+
const errorBody = await response.text();
|
|
192
|
+
throw new Error(`Sikka API POST ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`);
|
|
193
|
+
}
|
|
194
|
+
const data = (await response.json());
|
|
195
|
+
log.debug('Sikka API POST response', { endpoint, status: response.status });
|
|
196
|
+
return data;
|
|
197
|
+
}
|
|
198
|
+
async refreshAuthentication() {
|
|
199
|
+
const log = getLogger();
|
|
200
|
+
if (!this.refreshKey) {
|
|
201
|
+
throw new Error('No refresh key available. Call authenticate() first.');
|
|
202
|
+
}
|
|
203
|
+
log.debug('Sikka API: Refreshing authentication');
|
|
204
|
+
const requestBody = {
|
|
205
|
+
app_id: this.credentials.appId,
|
|
206
|
+
app_key: this.credentials.appKey,
|
|
207
|
+
grant_type: 'refresh_key',
|
|
208
|
+
refresh_key: this.refreshKey,
|
|
209
|
+
};
|
|
210
|
+
const response = await this.requestNewKey(requestBody);
|
|
211
|
+
this.requestKey = response.request_key;
|
|
212
|
+
this.refreshKey = response.refresh_key;
|
|
213
|
+
this.requestKeyExpiresAt = new Date(response.end_time);
|
|
214
|
+
log.debug('Sikka API: Authentication refreshed', {
|
|
215
|
+
expiresAt: this.requestKeyExpiresAt.toISOString(),
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
async requestNewKey(requestBody) {
|
|
219
|
+
const response = await fetch(`${this.baseUrl}/v4/request_key`, {
|
|
220
|
+
body: JSON.stringify(requestBody),
|
|
221
|
+
headers: { 'Content-Type': 'application/json' },
|
|
222
|
+
method: 'POST',
|
|
223
|
+
});
|
|
224
|
+
if (!response.ok) {
|
|
225
|
+
let errorMessage = `${response.status} ${response.statusText}`;
|
|
226
|
+
try {
|
|
227
|
+
const errorBody = (await response.json());
|
|
228
|
+
errorMessage =
|
|
229
|
+
errorBody.error_description ??
|
|
230
|
+
errorBody.error ??
|
|
231
|
+
errorBody.message ??
|
|
232
|
+
errorMessage;
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
}
|
|
236
|
+
throw new Error(`Sikka authentication failed: ${errorMessage}`);
|
|
237
|
+
}
|
|
238
|
+
return response.json();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
export const createSikkaClient = (credentials, baseUrl) => {
|
|
242
|
+
return new SikkaClient({ baseUrl, credentials });
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoBxC,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAuBnD,MAAM,OAAO,WAAW;IAIN,YAAY,GAAG;QAuB7B,IAAI,EAAE,KAAK,EACT,OAAiC,EACG,EAAE;YACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAC9B,mBAAmB,EACnB,OAA6C,CAC9C,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;IAKc,MAAM,GAAG;QAiBvB,IAAI,EAAE,KAAK,EAAE,MAA4B,EAAyB,EAAE;YAClE,MAAM,WAAW,GAA2B,EAAE,CAAC;YAC/C,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACtB,WAAW,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YAC7C,CAAC;YAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;YACzC,CAAC;YAED,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClB,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YACrC,CAAC;YAED,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACtB,WAAW,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YAC7C,CAAC;YAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;YACzC,CAAC;YAED,IAAI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AC;YAET,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,YAAY,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAsC,CAAC;IAC7D,CAAC;CACF;AAqBD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,WAAmC,EACnC,OAAgB,EACH,EAAE;IACf,OAAO,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["import { getLogger } from './logger.js';\nimport {\n type SikkaApiError,\n type SikkaClaim,\n type SikkaClaimListParams,\n type SikkaClaimListResponse,\n type SikkaClaimPaymentRequest,\n type SikkaClaimPaymentResponse,\n type SikkaClientConfig,\n type SikkaClientCredentials,\n type SikkaPatient,\n type SikkaPatientListParams,\n type SikkaPatientListResponse,\n type SikkaRequestKeyRequest,\n type SikkaRequestKeyResponse,\n type SikkaTransaction,\n type SikkaTransactionListParams,\n type SikkaTransactionListResponse,\n} from './types.js';\n\nconst SIKKA_BASE_URL = 'https://api.sikkasoft.com';\n\n/**\n * Sikka API Client\n *\n * Provides authenticated access to Sikka's ONE API for a specific practice/office.\n *\n * @example\n * ```typescript\n * const client = new SikkaClient({\n * credentials: {\n * appId: 'your-app-id',\n * appKey: 'your-app-key',\n * officeId: 'practice-office-id',\n * secretKey: 'practice-secret-key',\n * },\n * });\n *\n * await client.authenticate();\n *\n * const patients = await client.patients.list({ firstname: 'John' });\n * ```\n */\nexport class SikkaClient {\n /**\n * Claim payment endpoints.\n */\n public readonly claimPayment = {\n /**\n * Post a payment to a claim.\n *\n * @param request - Payment details\n * @returns Payment response\n *\n * @example\n * ```typescript\n * const result = await client.claimPayment.post({\n * claim_sr_no: '123456',\n * practice_id: 'practice-id',\n * payment_amount: '100.00|50.00', // Pipe-delimited for multiple line items\n * transaction_sr_no: '789|790', // Corresponding transaction IDs\n * write_off: '0.00|0.00',\n * claim_payment_date: '2024-01-15',\n * payment_mode: 'EFT',\n * cheque_no: 'CHK123',\n * is_payment_by_procedure_code: 'false',\n * note: 'Insurance payment',\n * });\n * ```\n */\n post: async (\n request: SikkaClaimPaymentRequest,\n ): Promise<SikkaClaimPaymentResponse> => {\n const response = await this.post<SikkaClaimPaymentResponse>(\n '/v4/claim_payment',\n request as unknown as Record<string, unknown>,\n );\n return response;\n },\n };\n\n /**\n * Claims management endpoints.\n */\n public readonly claims = {\n /**\n * List claims matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching claims\n *\n * @example\n * ```typescript\n * const claims = await client.claims.list({\n * patient_id: '12345',\n * status: 'Pending',\n * start_date: '2024-01-01',\n * end_date: '2024-12-31',\n * });\n * ```\n */\n list: async (params: SikkaClaimListParams): Promise<SikkaClaim[]> => {\n const queryParams: Record<string, string> = {};\n if (params.patient_id) {\n queryParams.patient_id = params.patient_id;\n }\n\n if (params.claim_id) {\n queryParams.claim_id = params.claim_id;\n }\n\n if (params.status) {\n queryParams.status = params.status;\n }\n\n if (params.start_date) {\n queryParams.start_date = params.start_date;\n }\n\n if (params.end_date) {\n queryParams.end_date = params.end_date;\n }\n\n if (params.limit) {\n queryParams.limit = String(params.limit);\n }\n\n if (params.offset) {\n queryParams.offset = String(params.offset);\n }\n\n const response = await this.get<SikkaClaimListResponse>(\n '/v4/claims',\n queryParams,\n );\n return response.items;\n },\n };\n\n /**\n * Patient management endpoints.\n */\n public readonly patients = {\n /**\n * List patients matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching patients\n *\n * @example\n * ```typescript\n * const patients = await client.patients.list({\n * firstname: 'John',\n * lastname: 'Doe',\n * });\n * ```\n */\n list: async (params: SikkaPatientListParams): Promise<SikkaPatient[]> => {\n const queryParams: Record<string, string> = {};\n if (params.firstname) {\n queryParams.firstname = params.firstname;\n }\n\n if (params.lastname) {\n queryParams.lastname = params.lastname;\n }\n\n if (params.birthdate) {\n queryParams.birthdate = params.birthdate;\n }\n\n if (params.patient_id) {\n queryParams.patient_id = params.patient_id;\n }\n\n if (params.limit) {\n queryParams.limit = String(params.limit);\n }\n\n if (params.offset) {\n queryParams.offset = String(params.offset);\n }\n\n const response = await this.get<SikkaPatientListResponse>(\n '/v4/patients',\n queryParams,\n );\n return response.items;\n },\n };\n\n /**\n * Transactions management endpoints.\n * Transactions include both procedures (service line items) and payments.\n */\n public readonly transactions = {\n /**\n * List transactions matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching transactions\n *\n * @example\n * ```typescript\n * const transactions = await client.transactions.list({\n * claim_sr_no: '123456',\n * });\n * ```\n */\n list: async (\n params: SikkaTransactionListParams,\n ): Promise<SikkaTransaction[]> => {\n const queryParams: Record<string, string> = {};\n if (params.claim_sr_no) {\n queryParams.claim_sr_no = params.claim_sr_no;\n }\n\n if (params.patient_id) {\n queryParams.patient_id = params.patient_id;\n }\n\n if (params.transaction_type) {\n queryParams.transaction_type = params.transaction_type;\n }\n\n if (params.limit) {\n queryParams.limit = String(params.limit);\n }\n\n if (params.offset) {\n queryParams.offset = String(params.offset);\n }\n\n const response = await this.get<SikkaTransactionListResponse>(\n '/v4/transactions',\n queryParams,\n );\n return response.items;\n },\n\n /**\n * List only procedure transactions for a specific claim.\n *\n * @param claimSrNo - The claim serial number\n * @returns List of procedure transactions\n */\n listProcedures: async (claimSrNo: string): Promise<SikkaTransaction[]> => {\n const transactions = await this.transactions.list({\n claim_sr_no: claimSrNo,\n });\n return transactions.filter((txn) => txn.transaction_type === 'Procedure');\n },\n };\n\n private readonly baseUrl: string;\n\n private readonly credentials: SikkaClientCredentials;\n\n private refreshKey: string | null = null;\n\n private requestKey: string | null = null;\n\n private requestKeyExpiresAt: Date | null = null;\n\n constructor(config: SikkaClientConfig) {\n this.baseUrl = config.baseUrl ?? SIKKA_BASE_URL;\n this.credentials = config.credentials;\n }\n\n /**\n * Authenticate with the Sikka API.\n * Must be called before making any other API requests.\n * The request key is valid for 24 hours.\n */\n async authenticate(): Promise<void> {\n const log = getLogger();\n\n log.debug('Sikka API: Authenticating');\n\n const requestBody: SikkaRequestKeyRequest = {\n app_id: this.credentials.appId,\n app_key: this.credentials.appKey,\n grant_type: 'request_key',\n office_id: this.credentials.officeId,\n secret_key: this.credentials.secretKey,\n };\n\n const response = await this.requestNewKey(requestBody);\n this.requestKey = response.request_key;\n this.refreshKey = response.refresh_key;\n this.requestKeyExpiresAt = new Date(response.end_time);\n\n log.debug('Sikka API: Authenticated successfully', {\n expiresAt: this.requestKeyExpiresAt.toISOString(),\n });\n }\n\n /**\n * Clear the current authentication state.\n */\n clearAuth(): void {\n this.requestKey = null;\n this.refreshKey = null;\n this.requestKeyExpiresAt = null;\n }\n\n /**\n * Ensure the client is authenticated, refreshing if necessary.\n * Automatically refreshes if token expires within 1 hour.\n */\n async ensureAuthenticated(): Promise<void> {\n if (!this.requestKey) {\n throw new Error('Not authenticated. Call authenticate() first.');\n }\n\n const oneHourFromNow = new Date(Date.now() + 60 * 60 * 1_000);\n if (this.requestKeyExpiresAt && this.requestKeyExpiresAt < oneHourFromNow) {\n await this.refreshAuthentication();\n }\n }\n\n /**\n * Make an authenticated GET request to the Sikka API.\n */\n async get<T>(endpoint: string, params?: Record<string, string>): Promise<T> {\n const log = getLogger();\n\n await this.ensureAuthenticated();\n\n const requestKey = this.getRequestKey();\n const url = new URL(`${this.baseUrl}${endpoint}`);\n url.searchParams.set('request_key', requestKey);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n url.searchParams.set(key, value);\n }\n }\n\n log.debug('Sikka API GET request', { endpoint, params });\n\n const response = await fetch(url.toString(), {\n headers: {\n 'Content-Type': 'application/json',\n 'Request-Key': requestKey,\n },\n method: 'GET',\n });\n\n if (!response.ok) {\n const errorBody = await response.text();\n throw new Error(\n `Sikka API GET ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`,\n );\n }\n\n const text = await response.text();\n if (!text || text.trim() === '') {\n return { items: [] } as T;\n }\n\n const data = JSON.parse(text) as T;\n\n log.debug('Sikka API GET response', { endpoint, status: response.status });\n\n return data;\n }\n\n /**\n * Get the current request key.\n *\n * @throws Error if not authenticated\n */\n getRequestKey(): string {\n if (!this.requestKey) {\n throw new Error('Not authenticated. Call authenticate() first.');\n }\n\n return this.requestKey;\n }\n\n // -------------------------------------------------------------------------\n // API Modules\n\n /**\n * Check if the client is currently authenticated with a valid token.\n */\n isAuthenticated(): boolean {\n if (!this.requestKey || !this.requestKeyExpiresAt) {\n return false;\n }\n\n return this.requestKeyExpiresAt > new Date();\n }\n\n /**\n * Make an authenticated POST request to the Sikka API.\n */\n async post<T>(endpoint: string, body: Record<string, unknown>): Promise<T> {\n const log = getLogger();\n\n await this.ensureAuthenticated();\n\n const requestKey = this.getRequestKey();\n const url = new URL(`${this.baseUrl}${endpoint}`);\n url.searchParams.set('request_key', requestKey);\n\n log.debug('Sikka API POST request', { body, endpoint });\n\n const response = await fetch(url.toString(), {\n body: JSON.stringify(body),\n headers: {\n 'Content-Type': 'application/json',\n 'Request-Key': requestKey,\n },\n method: 'POST',\n });\n\n if (!response.ok) {\n const errorBody = await response.text();\n throw new Error(\n `Sikka API POST ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`,\n );\n }\n\n const data = (await response.json()) as T;\n\n log.debug('Sikka API POST response', { endpoint, status: response.status });\n\n return data;\n }\n\n /**\n * Refresh the authentication token using the refresh key.\n * Called automatically when token is near expiration.\n */\n async refreshAuthentication(): Promise<void> {\n const log = getLogger();\n\n if (!this.refreshKey) {\n throw new Error('No refresh key available. Call authenticate() first.');\n }\n\n log.debug('Sikka API: Refreshing authentication');\n\n const requestBody: SikkaRequestKeyRequest = {\n app_id: this.credentials.appId,\n app_key: this.credentials.appKey,\n grant_type: 'refresh_key',\n refresh_key: this.refreshKey,\n };\n\n const response = await this.requestNewKey(requestBody);\n this.requestKey = response.request_key;\n this.refreshKey = response.refresh_key;\n this.requestKeyExpiresAt = new Date(response.end_time);\n\n log.debug('Sikka API: Authentication refreshed', {\n expiresAt: this.requestKeyExpiresAt.toISOString(),\n });\n }\n\n private async requestNewKey(\n requestBody: SikkaRequestKeyRequest,\n ): Promise<SikkaRequestKeyResponse> {\n const response = await fetch(`${this.baseUrl}/v4/request_key`, {\n body: JSON.stringify(requestBody),\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n });\n\n if (!response.ok) {\n let errorMessage = `${response.status} ${response.statusText}`;\n try {\n const errorBody = (await response.json()) as SikkaApiError;\n errorMessage =\n errorBody.error_description ??\n errorBody.error ??\n errorBody.message ??\n errorMessage;\n } catch {\n // Ignore JSON parse errors\n }\n\n throw new Error(`Sikka authentication failed: ${errorMessage}`);\n }\n\n return response.json() as Promise<SikkaRequestKeyResponse>;\n }\n}\n\n/**\n * Create a new Sikka client instance.\n *\n * @param credentials - Office-level credentials\n * @param baseUrl - Optional base URL override\n * @returns A new SikkaClient instance\n *\n * @example\n * ```typescript\n * const client = createSikkaClient({\n * appId: 'your-app-id',\n * appKey: 'your-app-key',\n * officeId: 'practice-office-id',\n * secretKey: 'practice-secret-key',\n * });\n *\n * await client.authenticate();\n * ```\n */\nexport const createSikkaClient = (\n credentials: SikkaClientCredentials,\n baseUrl?: string,\n): SikkaClient => {\n return new SikkaClient({ baseUrl, credentials });\n};\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const createNoOpLogger = () => ({
|
|
2
|
+
debug: () => {
|
|
3
|
+
},
|
|
4
|
+
error: () => {
|
|
5
|
+
},
|
|
6
|
+
info: () => {
|
|
7
|
+
},
|
|
8
|
+
warn: () => {
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const formatMeta = (meta) => meta && Object.keys(meta).length > 0 ? JSON.stringify(meta, null, 2) : '';
|
|
12
|
+
export const createConsoleLogger = (minLevel = 'info') => {
|
|
13
|
+
const levels = { debug: 0, error: 3, info: 1, warn: 2 };
|
|
14
|
+
const minLevelValue = levels[minLevel];
|
|
15
|
+
return {
|
|
16
|
+
debug: (message, meta) => {
|
|
17
|
+
if (levels.debug >= minLevelValue) {
|
|
18
|
+
const metaStr = formatMeta(meta);
|
|
19
|
+
console.debug(`[sikka-sdk] DEBUG: ${message}`, metaStr);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
error: (message, meta) => {
|
|
23
|
+
if (levels.error >= minLevelValue) {
|
|
24
|
+
const metaStr = formatMeta(meta);
|
|
25
|
+
console.error(`[sikka-sdk] ERROR: ${message}`, metaStr);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
info: (message, meta) => {
|
|
29
|
+
if (levels.info >= minLevelValue) {
|
|
30
|
+
const metaStr = formatMeta(meta);
|
|
31
|
+
console.info(`[sikka-sdk] INFO: ${message}`, metaStr);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
warn: (message, meta) => {
|
|
35
|
+
if (levels.warn >= minLevelValue) {
|
|
36
|
+
const metaStr = formatMeta(meta);
|
|
37
|
+
console.warn(`[sikka-sdk] WARN: ${message}`, metaStr);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
let logger = createNoOpLogger();
|
|
43
|
+
export const setLogger = (customLogger) => {
|
|
44
|
+
logger = customLogger;
|
|
45
|
+
};
|
|
46
|
+
export const getLogger = () => logger;
|
|
47
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AA4CA,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAW,EAAE,CAAC,CAAC;IAC7C,KAAK,EAAE,GAAG,EAAE;IAEZ,CAAC;IACD,KAAK,EAAE,GAAG,EAAE;IAEZ,CAAC;IACD,IAAI,EAAE,GAAG,EAAE;IAEX,CAAC;IACD,IAAI,EAAE,GAAG,EAAE;IAEX,CAAC;CACF,CAAC,CAAC;AAQH,MAAM,UAAU,GAAG,CAAC,IAA8B,EAAU,EAAE,CAC5D,IAAI,IAAI,MAAM,CAAC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AE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;YACtB,IAAI,MAAM,CAAC,IAAI,IAAI,aAAa,EAAE,CAAC;gBACjC,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;gBAEjC,OAAO,CAAC,IAAI,CAAC,qBAAqB,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAGF,IAAI,MAAM,GAAW,gBAAgB,EAAE,CAAC;AAmCxC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,YAAoB,EAAQ,EAAE;IACtD,MAAM,GAAG,YAAY,CAAC;AACxB,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,MAAM,CAAC","sourcesContent":["/**\n * Logger interface for the Sikka SDK.\n * Consumers can implement this interface to integrate their own logging solutions.\n */\nexport type Logger = {\n /**\n * Log a debug message.\n *\n * @param message - The message to log\n * @param meta - Optional metadata to include with the log\n */\n debug: (message: string, meta?: Record<string, unknown>) => void;\n\n /**\n * Log an info message.\n *\n * @param message - The message to log\n * @param meta - Optional metadata to include with the log\n */\n info: (message: string, meta?: Record<string, unknown>) => void;\n\n /**\n * Log a warning message.\n *\n * @param message - The message to log\n * @param meta - Optional metadata to include with the log\n */\n warn: (message: string, meta?: Record<string, unknown>) => void;\n\n /**\n * Log an error message.\n *\n * @param message - The message to log\n * @param meta - Optional metadata to include with the log\n */\n error: (message: string, meta?: Record<string, unknown>) => void;\n};\n\n/**\n * Creates a no-op logger that doesn't output anything.\n * This is the default logger to keep the SDK silent in production.\n *\n * @returns A logger that performs no operations\n */\nexport const createNoOpLogger = (): Logger => ({\n debug: () => {\n // No-op\n },\n error: () => {\n // No-op\n },\n info: () => {\n // No-op\n },\n warn: () => {\n // No-op\n },\n});\n\n/**\n * Helper function to format metadata for console output.\n *\n * @param meta - Optional metadata to format\n * @returns Formatted metadata string\n */\nconst formatMeta = (meta?: Record<string, unknown>): string =>\n meta && Object.keys(meta).length > 0 ? JSON.stringify(meta, null, 2) : '';\n\n/**\n * Creates a console-based logger for development and debugging.\n * All logs are prefixed with [sikka-sdk] for easy identification.\n *\n * @param minLevel - The minimum log level to output (default: 'info')\n * @returns A logger that outputs to the console\n */\nexport const createConsoleLogger = (\n minLevel: 'debug' | 'error' | 'info' | 'warn' = 'info',\n): Logger => {\n const levels = { debug: 0, error: 3, info: 1, warn: 2 };\n const minLevelValue = levels[minLevel];\n\n return {\n debug: (message, meta) => {\n if (levels.debug >= minLevelValue) {\n const metaStr = formatMeta(meta);\n // eslint-disable-next-line no-console\n console.debug(`[sikka-sdk] DEBUG: ${message}`, metaStr);\n }\n },\n error: (message, meta) => {\n if (levels.error >= minLevelValue) {\n const metaStr = formatMeta(meta);\n // eslint-disable-next-line no-console\n console.error(`[sikka-sdk] ERROR: ${message}`, metaStr);\n }\n },\n info: (message, meta) => {\n if (levels.info >= minLevelValue) {\n const metaStr = formatMeta(meta);\n // eslint-disable-next-line no-console\n console.info(`[sikka-sdk] INFO: ${message}`, metaStr);\n }\n },\n warn: (message, meta) => {\n if (levels.warn >= minLevelValue) {\n const metaStr = formatMeta(meta);\n // eslint-disable-next-line no-console\n console.warn(`[sikka-sdk] WARN: ${message}`, metaStr);\n }\n },\n };\n};\n\n// Internal logger instance (no-op by default)\nlet logger: Logger = createNoOpLogger();\n\n/**\n * Sets a custom logger for the SDK.\n * This allows consumers to plug in their own logging implementation\n * (e.g., Winston, Pino, Bunyan, or any custom logger).\n *\n * @param customLogger - A logger implementation conforming to the Logger interface\n * @example\n * ```typescript\n * import { setLogger, createConsoleLogger } from '@fincuratech/sikka-sdk-js';\n *\n * // Enable console logging for debugging\n * setLogger(createConsoleLogger('debug'));\n * ```\n * @example\n * ```typescript\n * import { setLogger } from '@fincuratech/sikka-sdk-js';\n * import winston from 'winston';\n *\n * const winstonLogger = winston.createLogger({\n * level: 'info',\n * format: winston.format.json(),\n * transports: [new winston.transports.Console()],\n * });\n *\n * // Adapt Winston to the Logger interface\n * setLogger({\n * debug: (msg, meta) => winstonLogger.debug(msg, meta),\n * info: (msg, meta) => winstonLogger.info(msg, meta),\n * warn: (msg, meta) => winstonLogger.warn(msg, meta),\n * error: (msg, meta) => winstonLogger.error(msg, meta),\n * });\n * ```\n */\nexport const setLogger = (customLogger: Logger): void => {\n logger = customLogger;\n};\n\n/**\n * Gets the current logger instance.\n * This is used internally by the SDK.\n *\n * @returns The current logger instance\n */\nexport const getLogger = (): Logger => logger;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Sikka SDK Types\n *\n * Types for interacting with the Sikka API (https://api.sikkasoft.com)\n */\n\n/**\n * Grant type for authentication\n */\nexport type SikkaGrantType = 'refresh_key' | 'request_key';\n\n/**\n * Request body for obtaining a request key\n */\nexport type SikkaRequestKeyRequest = {\n app_id: string;\n app_key: string;\n grant_type: SikkaGrantType;\n office_id?: string;\n refresh_key?: string;\n secret_key?: string;\n};\n\n/**\n * Response from the request_key endpoint\n */\nexport type SikkaRequestKeyResponse = {\n domain: string;\n end_time: string;\n expires_in: string;\n href: string;\n issued_to: string;\n refresh_key: string;\n request_count: string;\n request_key: string;\n scope: string;\n start_time: string;\n status: string;\n};\n\n/**\n * Sikka API error response\n */\nexport type SikkaApiError = {\n error?: string;\n error_description?: string;\n message?: string;\n};\n\n/**\n * An authorized practice from the authorized_practices endpoint\n */\nexport type SikkaAuthorizedPractice = {\n address: string;\n city: string;\n data_insert_date: string;\n data_synchronization_date: string;\n domain: string;\n email: string;\n href: string;\n office_id: string;\n practice_id: string;\n practice_management_system: string;\n practice_management_system_refresh_date: string;\n practice_management_system_version: string;\n practice_name: string;\n secret_key: string;\n state: string;\n zip: string;\n};\n\n/**\n * Response from the authorized_practices endpoint\n */\nexport type SikkaAuthorizedPracticesResponse = {\n execution_time: string;\n items: SikkaAuthorizedPractice[];\n limit: string;\n offset: string;\n pagination: {\n current: string;\n first: string;\n last: string;\n next: string;\n previous: string;\n };\n total_count: string;\n};\n\n/**\n * App-level credentials (from env vars)\n */\nexport type SikkaAppCredentials = {\n appId: string;\n appKey: string;\n};\n\n/**\n * Credentials required to initialize the Sikka client for a specific office\n */\nexport type SikkaClientCredentials = {\n appId: string;\n appKey: string;\n officeId: string;\n secretKey: string;\n};\n\n/**\n * Configuration for the Sikka client\n */\nexport type SikkaClientConfig = {\n baseUrl?: string;\n credentials: SikkaClientCredentials;\n};\n\n// -----------------------------------------------------------------------------\n// Paginated Response Types\n\n/**\n * Generic paginated response from Sikka API\n */\nexport type SikkaPaginatedResponse<T> = {\n execution_time: string;\n items: T[];\n limit: string;\n offset: string;\n pagination: {\n current: string;\n first: string;\n last: string;\n next: string;\n previous: string;\n };\n total_count: string;\n};\n\n// -----------------------------------------------------------------------------\n// Patient Types\n\n/**\n * Sikka patient record\n */\nexport type SikkaPatient = {\n address_line1: string;\n address_line2: string;\n appointment_href: string;\n birthdate: string;\n cell: string;\n city: string;\n created_date: string;\n email: string;\n fee_no: string;\n first_visit: string;\n firstname: string;\n guarantor_first_name: string;\n guarantor_href: string;\n guarantor_id: string;\n guarantor_last_name: string;\n href: string;\n last_visit: string;\n lastname: string;\n middlename: string;\n other_referral: string;\n patient_id: string;\n patient_referral: string;\n practice_href: string;\n practice_id: string;\n preferred_communication_method: string;\n preferred_contact: string;\n preferred_name: string;\n primary_insurance_company_href: string;\n primary_insurance_company_id: string;\n primary_medical_insurance: string;\n primary_medical_insurance_id: string;\n primary_medical_relationship: string;\n primary_medical_subscriber_id: string;\n primary_relationship: string;\n provider_href: string;\n provider_id: string;\n referred_out: string;\n salutation: string;\n state: string;\n status: string;\n subscriber_id: string;\n zipcode: string;\n};\n\n/**\n * Parameters for listing patients\n */\nexport type SikkaPatientListParams = {\n birthdate?: string;\n firstname?: string;\n lastname?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n};\n\n/**\n * Response from the patients endpoint\n */\nexport type SikkaPatientListResponse = SikkaPaginatedResponse<SikkaPatient>;\n\n// -----------------------------------------------------------------------------\n// Claim Types\n\n/**\n * Sikka claim record\n */\nexport type SikkaClaim = {\n bank_no: string;\n carrier_id: string;\n cheque_no: string;\n claim_channel: string;\n claim_description_href: string;\n claim_description_id: string;\n claim_payment_date: string;\n claim_sent_date: string;\n claim_sr_no: string;\n claim_status: string;\n creation_date: string;\n estimated_amount: string;\n guarantor_href: string;\n guarantor_id: string;\n href: string;\n insurance_company_href: string;\n insurance_company_id: string;\n insurance_company_name: string;\n note: string;\n on_hold_date: string;\n others: string;\n patient_href: string;\n patient_id: string;\n pay_to_provider: string;\n payer_id: string;\n payment_amount: string;\n practice_href: string;\n practice_id: string;\n preventive: string;\n primary_claim_id: string;\n primary_or_secondary: string;\n provider_href: string;\n provider_id: string;\n rendering_provider: string;\n resent_date: string;\n return_date: string;\n sent_claim_status: string;\n standard: string;\n total_billed_amount: string;\n total_paid_amount: string;\n tp: string;\n tracer: string;\n};\n\n/**\n * Parameters for listing claims\n */\nexport type SikkaClaimListParams = {\n claim_id?: string;\n end_date?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n start_date?: string;\n status?: string;\n};\n\n/**\n * Response from the claims endpoint\n */\nexport type SikkaClaimListResponse = SikkaPaginatedResponse<SikkaClaim>;\n\n// -----------------------------------------------------------------------------\n// Transaction Types\n\n/**\n * Transaction type in Sikka (Procedure = service line item, Payment = payment)\n */\nexport type SikkaTransactionType = 'Payment' | 'Procedure';\n\n/**\n * Sikka transaction record (represents both procedures and payments)\n */\nexport type SikkaTransaction = {\n amount: string;\n claim_href: string;\n claim_sr_no: string;\n created_by: string;\n cust_id: string;\n estimated_insurance_payment: string;\n guarantor_href: string;\n guarantor_id: string;\n href: string;\n insurance_payment: string;\n last_updated_by: string;\n note: string;\n patient_href: string;\n patient_id: string;\n payment_type: string;\n practice_href: string;\n practice_id: string;\n primary_insurance_estimate: string;\n procedure_code: string;\n procedure_description: string;\n provider_href: string;\n provider_id: string;\n quantity: string;\n rowhash: string;\n surface: string;\n tooth_from: string;\n tooth_to: string;\n transaction_date: string;\n transaction_entry_date: string;\n transaction_sr_no: string;\n transaction_type: SikkaTransactionType;\n};\n\n/**\n * Parameters for listing transactions\n */\nexport type SikkaTransactionListParams = {\n claim_sr_no?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n transaction_type?: SikkaTransactionType;\n};\n\n/**\n * Response from the transactions endpoint\n */\nexport type SikkaTransactionListResponse =\n SikkaPaginatedResponse<SikkaTransaction>;\n\n// -----------------------------------------------------------------------------\n// Claim Payment Types\n\n/**\n * Payment mode for posting payments\n */\nexport type SikkaPaymentMode = 'Cash' | 'Check' | 'EFT';\n\n/**\n * Request body for posting a claim payment.\n * Uses pipe-delimited values for line item amounts.\n */\nexport type SikkaClaimPaymentRequest = {\n cheque_no: string;\n claim_payment_date: string;\n claim_sr_no: string;\n is_payment_by_procedure_code: 'false' | 'true';\n note: string;\n payment_amount: string;\n payment_mode: SikkaPaymentMode;\n practice_id: string;\n transaction_sr_no: string;\n write_off: string;\n};\n\n/**\n * Response from posting a claim payment\n */\nexport type SikkaClaimPaymentResponse = {\n claim_sr_no: string;\n message: string;\n status: string;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,MAAM,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type SikkaClaim, type SikkaClaimListParams, type SikkaClaimPaymentRequest, type SikkaClaimPaymentResponse, type SikkaClientConfig, type SikkaClientCredentials, type SikkaPatient, type SikkaPatientListParams, type SikkaTransaction, type SikkaTransactionListParams } from './types.js';
|
|
2
|
+
export declare class SikkaClient {
|
|
3
|
+
readonly claimPayment: {
|
|
4
|
+
post: (request: SikkaClaimPaymentRequest) => Promise<SikkaClaimPaymentResponse>;
|
|
5
|
+
};
|
|
6
|
+
readonly claims: {
|
|
7
|
+
list: (params: SikkaClaimListParams) => Promise<SikkaClaim[]>;
|
|
8
|
+
};
|
|
9
|
+
readonly patients: {
|
|
10
|
+
list: (params: SikkaPatientListParams) => Promise<SikkaPatient[]>;
|
|
11
|
+
};
|
|
12
|
+
readonly transactions: {
|
|
13
|
+
list: (params: SikkaTransactionListParams) => Promise<SikkaTransaction[]>;
|
|
14
|
+
listProcedures: (claimSrNo: string) => Promise<SikkaTransaction[]>;
|
|
15
|
+
};
|
|
16
|
+
private readonly baseUrl;
|
|
17
|
+
private readonly credentials;
|
|
18
|
+
private refreshKey;
|
|
19
|
+
private requestKey;
|
|
20
|
+
private requestKeyExpiresAt;
|
|
21
|
+
constructor(config: SikkaClientConfig);
|
|
22
|
+
authenticate(): Promise<void>;
|
|
23
|
+
clearAuth(): void;
|
|
24
|
+
ensureAuthenticated(): Promise<void>;
|
|
25
|
+
get<T>(endpoint: string, params?: Record<string, string>): Promise<T>;
|
|
26
|
+
getRequestKey(): string;
|
|
27
|
+
isAuthenticated(): boolean;
|
|
28
|
+
post<T>(endpoint: string, body: Record<string, unknown>): Promise<T>;
|
|
29
|
+
refreshAuthentication(): Promise<void>;
|
|
30
|
+
private requestNewKey;
|
|
31
|
+
}
|
|
32
|
+
export declare const createSikkaClient: (credentials: SikkaClientCredentials, baseUrl?: string) => SikkaClient;
|
|
33
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,oBAAoB,EAEzB,KAAK,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sCpE,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;YA0B9B,aAAa;CA2B5B;AAqBD,eAAO,MAAM,iBAAiB,GAC5B,aAAa,sBAAsB,EACnC,UAAU,MAAM,KACf,WAEF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Logger = {
|
|
2
|
+
debug: (message: string, meta?: Record<string, unknown>) => void;
|
|
3
|
+
info: (message: string, meta?: Record<string, unknown>) => void;
|
|
4
|
+
warn: (message: string, meta?: Record<string, unknown>) => void;
|
|
5
|
+
error: (message: string, meta?: Record<string, unknown>) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const createNoOpLogger: () => Logger;
|
|
8
|
+
export declare const createConsoleLogger: (minLevel?: "debug" | "error" | "info" | "warn") => Logger;
|
|
9
|
+
export declare const setLogger: (customLogger: Logger) => void;
|
|
10
|
+
export declare const getLogger: () => Logger;
|
|
11
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/logger.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,MAAM,GAAG;IAOnB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAQjE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAQhE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAQhE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAClE,CAAC;AAQF,eAAO,MAAM,gBAAgB,QAAO,MAalC,CAAC;AAkBH,eAAO,MAAM,mBAAmB,GAC9B,WAAU,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAe,KACrD,MAkCF,CAAC;AAsCF,eAAO,MAAM,SAAS,GAAI,cAAc,MAAM,KAAG,IAEhD,CAAC;AAQF,eAAO,MAAM,SAAS,QAAO,MAAgB,CAAC"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
export type SikkaGrantType = 'refresh_key' | 'request_key';
|
|
2
|
+
export type SikkaRequestKeyRequest = {
|
|
3
|
+
app_id: string;
|
|
4
|
+
app_key: string;
|
|
5
|
+
grant_type: SikkaGrantType;
|
|
6
|
+
office_id?: string;
|
|
7
|
+
refresh_key?: string;
|
|
8
|
+
secret_key?: string;
|
|
9
|
+
};
|
|
10
|
+
export type SikkaRequestKeyResponse = {
|
|
11
|
+
domain: string;
|
|
12
|
+
end_time: string;
|
|
13
|
+
expires_in: string;
|
|
14
|
+
href: string;
|
|
15
|
+
issued_to: string;
|
|
16
|
+
refresh_key: string;
|
|
17
|
+
request_count: string;
|
|
18
|
+
request_key: string;
|
|
19
|
+
scope: string;
|
|
20
|
+
start_time: string;
|
|
21
|
+
status: string;
|
|
22
|
+
};
|
|
23
|
+
export type SikkaApiError = {
|
|
24
|
+
error?: string;
|
|
25
|
+
error_description?: string;
|
|
26
|
+
message?: string;
|
|
27
|
+
};
|
|
28
|
+
export type SikkaAuthorizedPractice = {
|
|
29
|
+
address: string;
|
|
30
|
+
city: string;
|
|
31
|
+
data_insert_date: string;
|
|
32
|
+
data_synchronization_date: string;
|
|
33
|
+
domain: string;
|
|
34
|
+
email: string;
|
|
35
|
+
href: string;
|
|
36
|
+
office_id: string;
|
|
37
|
+
practice_id: string;
|
|
38
|
+
practice_management_system: string;
|
|
39
|
+
practice_management_system_refresh_date: string;
|
|
40
|
+
practice_management_system_version: string;
|
|
41
|
+
practice_name: string;
|
|
42
|
+
secret_key: string;
|
|
43
|
+
state: string;
|
|
44
|
+
zip: string;
|
|
45
|
+
};
|
|
46
|
+
export type SikkaAuthorizedPracticesResponse = {
|
|
47
|
+
execution_time: string;
|
|
48
|
+
items: SikkaAuthorizedPractice[];
|
|
49
|
+
limit: string;
|
|
50
|
+
offset: string;
|
|
51
|
+
pagination: {
|
|
52
|
+
current: string;
|
|
53
|
+
first: string;
|
|
54
|
+
last: string;
|
|
55
|
+
next: string;
|
|
56
|
+
previous: string;
|
|
57
|
+
};
|
|
58
|
+
total_count: string;
|
|
59
|
+
};
|
|
60
|
+
export type SikkaAppCredentials = {
|
|
61
|
+
appId: string;
|
|
62
|
+
appKey: string;
|
|
63
|
+
};
|
|
64
|
+
export type SikkaClientCredentials = {
|
|
65
|
+
appId: string;
|
|
66
|
+
appKey: string;
|
|
67
|
+
officeId: string;
|
|
68
|
+
secretKey: string;
|
|
69
|
+
};
|
|
70
|
+
export type SikkaClientConfig = {
|
|
71
|
+
baseUrl?: string;
|
|
72
|
+
credentials: SikkaClientCredentials;
|
|
73
|
+
};
|
|
74
|
+
export type SikkaPaginatedResponse<T> = {
|
|
75
|
+
execution_time: string;
|
|
76
|
+
items: T[];
|
|
77
|
+
limit: string;
|
|
78
|
+
offset: string;
|
|
79
|
+
pagination: {
|
|
80
|
+
current: string;
|
|
81
|
+
first: string;
|
|
82
|
+
last: string;
|
|
83
|
+
next: string;
|
|
84
|
+
previous: string;
|
|
85
|
+
};
|
|
86
|
+
total_count: string;
|
|
87
|
+
};
|
|
88
|
+
export type SikkaPatient = {
|
|
89
|
+
address_line1: string;
|
|
90
|
+
address_line2: string;
|
|
91
|
+
appointment_href: string;
|
|
92
|
+
birthdate: string;
|
|
93
|
+
cell: string;
|
|
94
|
+
city: string;
|
|
95
|
+
created_date: string;
|
|
96
|
+
email: string;
|
|
97
|
+
fee_no: string;
|
|
98
|
+
first_visit: string;
|
|
99
|
+
firstname: string;
|
|
100
|
+
guarantor_first_name: string;
|
|
101
|
+
guarantor_href: string;
|
|
102
|
+
guarantor_id: string;
|
|
103
|
+
guarantor_last_name: string;
|
|
104
|
+
href: string;
|
|
105
|
+
last_visit: string;
|
|
106
|
+
lastname: string;
|
|
107
|
+
middlename: string;
|
|
108
|
+
other_referral: string;
|
|
109
|
+
patient_id: string;
|
|
110
|
+
patient_referral: string;
|
|
111
|
+
practice_href: string;
|
|
112
|
+
practice_id: string;
|
|
113
|
+
preferred_communication_method: string;
|
|
114
|
+
preferred_contact: string;
|
|
115
|
+
preferred_name: string;
|
|
116
|
+
primary_insurance_company_href: string;
|
|
117
|
+
primary_insurance_company_id: string;
|
|
118
|
+
primary_medical_insurance: string;
|
|
119
|
+
primary_medical_insurance_id: string;
|
|
120
|
+
primary_medical_relationship: string;
|
|
121
|
+
primary_medical_subscriber_id: string;
|
|
122
|
+
primary_relationship: string;
|
|
123
|
+
provider_href: string;
|
|
124
|
+
provider_id: string;
|
|
125
|
+
referred_out: string;
|
|
126
|
+
salutation: string;
|
|
127
|
+
state: string;
|
|
128
|
+
status: string;
|
|
129
|
+
subscriber_id: string;
|
|
130
|
+
zipcode: string;
|
|
131
|
+
};
|
|
132
|
+
export type SikkaPatientListParams = {
|
|
133
|
+
birthdate?: string;
|
|
134
|
+
firstname?: string;
|
|
135
|
+
lastname?: string;
|
|
136
|
+
limit?: number;
|
|
137
|
+
offset?: number;
|
|
138
|
+
patient_id?: string;
|
|
139
|
+
};
|
|
140
|
+
export type SikkaPatientListResponse = SikkaPaginatedResponse<SikkaPatient>;
|
|
141
|
+
export type SikkaClaim = {
|
|
142
|
+
bank_no: string;
|
|
143
|
+
carrier_id: string;
|
|
144
|
+
cheque_no: string;
|
|
145
|
+
claim_channel: string;
|
|
146
|
+
claim_description_href: string;
|
|
147
|
+
claim_description_id: string;
|
|
148
|
+
claim_payment_date: string;
|
|
149
|
+
claim_sent_date: string;
|
|
150
|
+
claim_sr_no: string;
|
|
151
|
+
claim_status: string;
|
|
152
|
+
creation_date: string;
|
|
153
|
+
estimated_amount: string;
|
|
154
|
+
guarantor_href: string;
|
|
155
|
+
guarantor_id: string;
|
|
156
|
+
href: string;
|
|
157
|
+
insurance_company_href: string;
|
|
158
|
+
insurance_company_id: string;
|
|
159
|
+
insurance_company_name: string;
|
|
160
|
+
note: string;
|
|
161
|
+
on_hold_date: string;
|
|
162
|
+
others: string;
|
|
163
|
+
patient_href: string;
|
|
164
|
+
patient_id: string;
|
|
165
|
+
pay_to_provider: string;
|
|
166
|
+
payer_id: string;
|
|
167
|
+
payment_amount: string;
|
|
168
|
+
practice_href: string;
|
|
169
|
+
practice_id: string;
|
|
170
|
+
preventive: string;
|
|
171
|
+
primary_claim_id: string;
|
|
172
|
+
primary_or_secondary: string;
|
|
173
|
+
provider_href: string;
|
|
174
|
+
provider_id: string;
|
|
175
|
+
rendering_provider: string;
|
|
176
|
+
resent_date: string;
|
|
177
|
+
return_date: string;
|
|
178
|
+
sent_claim_status: string;
|
|
179
|
+
standard: string;
|
|
180
|
+
total_billed_amount: string;
|
|
181
|
+
total_paid_amount: string;
|
|
182
|
+
tp: string;
|
|
183
|
+
tracer: string;
|
|
184
|
+
};
|
|
185
|
+
export type SikkaClaimListParams = {
|
|
186
|
+
claim_id?: string;
|
|
187
|
+
end_date?: string;
|
|
188
|
+
limit?: number;
|
|
189
|
+
offset?: number;
|
|
190
|
+
patient_id?: string;
|
|
191
|
+
start_date?: string;
|
|
192
|
+
status?: string;
|
|
193
|
+
};
|
|
194
|
+
export type SikkaClaimListResponse = SikkaPaginatedResponse<SikkaClaim>;
|
|
195
|
+
export type SikkaTransactionType = 'Payment' | 'Procedure';
|
|
196
|
+
export type SikkaTransaction = {
|
|
197
|
+
amount: string;
|
|
198
|
+
claim_href: string;
|
|
199
|
+
claim_sr_no: string;
|
|
200
|
+
created_by: string;
|
|
201
|
+
cust_id: string;
|
|
202
|
+
estimated_insurance_payment: string;
|
|
203
|
+
guarantor_href: string;
|
|
204
|
+
guarantor_id: string;
|
|
205
|
+
href: string;
|
|
206
|
+
insurance_payment: string;
|
|
207
|
+
last_updated_by: string;
|
|
208
|
+
note: string;
|
|
209
|
+
patient_href: string;
|
|
210
|
+
patient_id: string;
|
|
211
|
+
payment_type: string;
|
|
212
|
+
practice_href: string;
|
|
213
|
+
practice_id: string;
|
|
214
|
+
primary_insurance_estimate: string;
|
|
215
|
+
procedure_code: string;
|
|
216
|
+
procedure_description: string;
|
|
217
|
+
provider_href: string;
|
|
218
|
+
provider_id: string;
|
|
219
|
+
quantity: string;
|
|
220
|
+
rowhash: string;
|
|
221
|
+
surface: string;
|
|
222
|
+
tooth_from: string;
|
|
223
|
+
tooth_to: string;
|
|
224
|
+
transaction_date: string;
|
|
225
|
+
transaction_entry_date: string;
|
|
226
|
+
transaction_sr_no: string;
|
|
227
|
+
transaction_type: SikkaTransactionType;
|
|
228
|
+
};
|
|
229
|
+
export type SikkaTransactionListParams = {
|
|
230
|
+
claim_sr_no?: string;
|
|
231
|
+
limit?: number;
|
|
232
|
+
offset?: number;
|
|
233
|
+
patient_id?: string;
|
|
234
|
+
transaction_type?: SikkaTransactionType;
|
|
235
|
+
};
|
|
236
|
+
export type SikkaTransactionListResponse = SikkaPaginatedResponse<SikkaTransaction>;
|
|
237
|
+
export type SikkaPaymentMode = 'Cash' | 'Check' | 'EFT';
|
|
238
|
+
export type SikkaClaimPaymentRequest = {
|
|
239
|
+
cheque_no: string;
|
|
240
|
+
claim_payment_date: string;
|
|
241
|
+
claim_sr_no: string;
|
|
242
|
+
is_payment_by_procedure_code: 'false' | 'true';
|
|
243
|
+
note: string;
|
|
244
|
+
payment_amount: string;
|
|
245
|
+
payment_mode: SikkaPaymentMode;
|
|
246
|
+
practice_id: string;
|
|
247
|
+
transaction_sr_no: string;
|
|
248
|
+
write_off: string;
|
|
249
|
+
};
|
|
250
|
+
export type SikkaClaimPaymentResponse = {
|
|
251
|
+
claim_sr_no: string;
|
|
252
|
+
message: string;
|
|
253
|
+
status: string;
|
|
254
|
+
};
|
|
255
|
+
//# sourceMappingURL=types.d.ts.map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G,KAAK,CAAC;AAMxD,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAKF,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Fincura Technologies, Inc.",
|
|
3
|
+
"packageManager": "pnpm@10.11.0",
|
|
4
|
+
"dependencies": {},
|
|
5
|
+
"description": "Sikka SDK JS - TypeScript SDK for Sikka ONE API",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@jest/globals": "30.2.0",
|
|
8
|
+
"@swc/jest": "0.2.39",
|
|
9
|
+
"@types/jest": "30.0.0",
|
|
10
|
+
"@types/node": "25.0.2",
|
|
11
|
+
"@typescript-eslint/eslint-plugin": "8.49.0",
|
|
12
|
+
"@typescript-eslint/parser": "8.49.0",
|
|
13
|
+
"eslint": "9.39.2",
|
|
14
|
+
"eslint-config-canonical": "47.3.7",
|
|
15
|
+
"eslint-plugin-import": "2.32.0",
|
|
16
|
+
"jest": "30.2.0",
|
|
17
|
+
"jest-mock-extended": "4.0.0",
|
|
18
|
+
"tsx": "4.21.0",
|
|
19
|
+
"typescript": "5.9.3"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"name": "@fincuratech/sikka-sdk-js",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/fincura-ai/sikka-sdk-js.git"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc --incremental",
|
|
36
|
+
"lint": "eslint --cache './src' './__tests__'",
|
|
37
|
+
"lint-fix": "eslint --cache './src' './__tests__' --fix",
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"typecheck": "tsc --noEmit --incremental --project tsconfig.eslint.json",
|
|
40
|
+
"watch": "tsc -w"
|
|
41
|
+
},
|
|
42
|
+
"type": "module",
|
|
43
|
+
"types": "dist/types/index.d.ts",
|
|
44
|
+
"version": "0.0.1"
|
|
45
|
+
}
|