@fincuratech/sikka-sdk-js 1.1.0 → 1.2.0
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/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAuBxC,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,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAC7B,YAAY,EACZ,MAAM,CACP,CAAC;YACF,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;KACF,CAAC;IAKc,QAAQ,GAAG;QAezB,IAAI,EAAE,KAAK,EAAE,MAA8B,EAA2B,EAAE;YACtE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAC7B,cAAc,EACd,MAAM,CACP,CAAC;YACF,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;KACF,CAAC;IAMc,YAAY,GAAG;QAkB7B,IAAI,EAAE,KAAK,EACT,SAAqC,EAAE,EACV,EAAE;YAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAC7B,mBAAmB,EACnB,MAAM,CACP,CAAC;YACF,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;KACF,CAAC;IAMc,YAAY,GAAG;QAc7B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MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,iBAAiB,EAAE;YAC7D,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YACjC,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,IAAI,YAAY,GAAG,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;gBAC3D,YAAY;oBACV,SAAS,CAAC,iBAAiB;wBAC3B,SAAS,CAAC,KAAK;wBACf,SAAS,CAAC,OAAO;wBACjB,YAAY,CAAC;YACjB,CAAC;YAAC,MAAM,CAAC;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 SikkaPaymentType,\n type SikkaPaymentTypeListParams,\n type SikkaPaymentTypeListResponse,\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 response = await this.get<SikkaClaimListResponse>(\n '/v4/claims',\n params,\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 response = await this.get<SikkaPatientListResponse>(\n '/v4/patients',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Payment types management endpoints.\n * Payment types represent the different methods a practice accepts for payments.\n */\n public readonly paymentTypes = {\n /**\n * List payment types for the practice.\n *\n * @param params - Optional filter and pagination parameters\n * @returns List of payment types\n *\n * @example\n * ```typescript\n * // Get all payment types\n * const types = await client.paymentTypes.list();\n *\n * // Get only insurance payment types\n * const insuranceTypes = await client.paymentTypes.list({\n * is_insurance_type: true,\n * });\n * ```\n */\n list: async (\n params: SikkaPaymentTypeListParams = {},\n ): Promise<SikkaPaymentType[]> => {\n const response = await this.get<SikkaPaymentTypeListResponse>(\n '/v4/payment_types',\n params,\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 response = await this.get<SikkaTransactionListResponse>(\n '/v4/transactions',\n params,\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, 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 if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\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"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAuBxC,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAuBnD,MAAM,OAAO,WAAW;IAIN,YAAY,GAAG;QAuB7B,IAAI,EAAE,KAAK,EACT,OAA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AC,IAAI,EAAE,CAAkB,CAAC;gBAC3D,YAAY;oBACV,SAAS,CAAC,iBAAiB;wBAC3B,SAAS,CAAC,KAAK;wBACf,SAAS,CAAC,OAAO;wBACjB,YAAY,CAAC;YACjB,CAAC;YAAC,MAAM,CAAC;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 SikkaPaymentType,\n type SikkaPaymentTypeListParams,\n type SikkaPaymentTypeListResponse,\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 * deductible: '0.00|0.00', // Required, use pipe-delimited if by procedure\n * write_off: '0.00|0.00',\n * claim_payment_date: '2024-01-15',\n * payment_mode: 'EFT',\n * is_payment_by_procedure_code: 'true',\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 response = await this.get<SikkaClaimListResponse>(\n '/v4/claims',\n params,\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 response = await this.get<SikkaPatientListResponse>(\n '/v4/patients',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Payment types management endpoints.\n * Payment types represent the different methods a practice accepts for payments.\n */\n public readonly paymentTypes = {\n /**\n * List payment types for the practice.\n *\n * @param params - Optional filter and pagination parameters\n * @returns List of payment types\n *\n * @example\n * ```typescript\n * // Get all payment types\n * const types = await client.paymentTypes.list();\n *\n * // Get only insurance payment types\n * const insuranceTypes = await client.paymentTypes.list({\n * is_insurance_type: true,\n * });\n * ```\n */\n list: async (\n params: SikkaPaymentTypeListParams = {},\n ): Promise<SikkaPaymentType[]> => {\n const response = await this.get<SikkaPaymentTypeListResponse>(\n '/v4/payment_types',\n params,\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 response = await this.get<SikkaTransactionListResponse>(\n '/v4/transactions',\n params,\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, 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 if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\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"]}
|
package/dist/lib/types.js.map
CHANGED
|
@@ -1 +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\n// -----------------------------------------------------------------------------\n// Payment Type Types\n\n/**\n * Sikka payment type record\n */\nexport type SikkaPaymentType = {\n code: string;\n description: string;\n href: string;\n practice_href: string;\n practice_id: string;\n};\n\n/**\n * Parameters for listing payment types\n */\nexport type SikkaPaymentTypeListParams = {\n /**\n * Filter by payment type code in practice management system\n */\n code?: string;\n /**\n * Customer ID of office\n */\n customer_id?: string;\n /**\n * If true, returns Credit Adjustment Types only\n */\n is_adjustment_type?: boolean;\n /**\n * If true, returns Payment Types which require credit card details\n * for POST transaction (Planet DDS PMS only)\n */\n are_credit_card_details_required?: boolean;\n /**\n * If true, returns Debit Adjustment Types only\n */\n is_debit_adjustment_type?: boolean;\n /**\n * If true, returns Insurance Payment Types only\n */\n is_insurance_type?: boolean;\n /**\n * Results per page\n */\n limit?: number;\n /**\n * Pagination offset\n */\n offset?: number;\n /**\n * Practice ID of office\n */\n practice_id?: string;\n};\n\n/**\n * Response from the payment_types endpoint\n */\nexport type SikkaPaymentTypeListResponse =\n SikkaPaginatedResponse<SikkaPaymentType>;\n"]}
|
|
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 when is_payment_by_procedure_code=true.\n */\nexport type SikkaClaimPaymentRequest = {\n /**\n * The generic ID of the claim for which you want to post the payment.\n */\n claim_sr_no: string;\n\n /**\n * The unique identifier for the practice.\n */\n practice_id: string;\n\n /**\n * The total payment amount (format: xx.xx).\n * If is_payment_by_procedure_code=true, use pipe-delimited values (e.g., \"100.00|50.00\").\n */\n payment_amount: string;\n\n /**\n * Boolean flag indicating if the payment is allocated by procedure code.\n * For Tracker, value should be true only as PMS does not support without procedure code.\n */\n is_payment_by_procedure_code: 'false' | 'true';\n\n /**\n * The date of the payment (format: yyyy-MM-dd).\n */\n claim_payment_date: string;\n\n /**\n * The method of payment.\n * Get valid modes from payment_types API with is_insurance_type=true.\n */\n payment_mode: SikkaPaymentMode;\n\n /**\n * The deductible amount (format: xx.xx). Pass \"0\" if no amount.\n * PMS-specific formats:\n * - Dentrix Enterprise/G6: pipe-delimited \"standard|preventive|others\" (e.g., \"0|0|0\")\n * - Dentrix Ascend: pipe-delimited \"major|preventive|basic|ortho\" (e.g., \"0|0|0|0\")\n * - Tracker: Not supported\n */\n deductible: string;\n\n /**\n * The write-off amount (format: xx.xx). Pass \"0\" if no amount.\n * If is_payment_by_procedure_code=true, use pipe-delimited values.\n * - Dentrix Ascend: write_off not allowed for is_payment_by_procedure_code=false, pass \"0\"\n * - Tracker: Not supported\n */\n write_off: string;\n\n /**\n * The specific transaction ID(s) associated with the payment.\n * Required only if is_payment_by_procedure_code=true.\n * For multiple procedures, use pipe-delimited values (e.g., \"123|124|125\").\n */\n transaction_sr_no?: string;\n\n /**\n * Payment notes/remarks.\n * Should not contain special characters (<, >, &, ,).\n */\n note?: string;\n\n /**\n * The credit adjustment type ID.\n * Get from payment_types API with is_adjustment_type=true.\n * Supported only for Dentrix Enterprise, Dentrix Ascend, and Dentrix G6+.\n * Required if write_off value is negative in Dentrix Enterprise/Ascend.\n */\n adjustment_type?: string;\n\n /**\n * The provider ID for the credit adjustment.\n * Supported only for Dentrix G6+.\n * Must match count of write_off values (pipe-delimited).\n */\n credit_adjustment_provider?: string;\n\n /**\n * Boolean to trigger a debit adjustment write-back.\n * Not supported for Tracker.\n */\n is_debit_adjustment_writeback?: 'false' | 'true';\n\n /**\n * The amount for the debit adjustment (format: xx.xx).\n * Required only if performing debit adjustment write-back.\n * Must be positive (Dentrix G6+ allows 0).\n */\n debit_adjustment_amount?: string;\n\n /**\n * Date of the debit adjustment (format: yyyy-MM-dd).\n * Required for Open Dental PMS if performing debit adjustment write-back.\n * Not supported for Dentrix Ascend.\n */\n debit_adjustment_date?: string;\n\n /**\n * The debit adjustment type ID.\n * Get from payment_types API with is_debit_adjustment_type=true.\n * Required for Open Dental and Dentrix Ascend if performing debit adjustment write-back.\n */\n debit_adjustment_type?: string;\n\n /**\n * Notes for the debit adjustment.\n * Must not contain special characters (<, >, &, ,).\n * Not supported for Dentrix Ascend.\n */\n debit_adjustment_note?: string;\n\n /**\n * Boolean for procedure-level debit adjustments.\n * Supported for Open Dental only.\n * If true, debit_adjustment_amount, debit_adjustment_transaction_sr_no,\n * debit_adjustment_provider, and debit_adjustment_type must have matching counts (pipe-delimited).\n */\n is_debit_adjustment_by_procedure?: 'false' | 'true';\n\n /**\n * Transaction ID(s) for the debit adjustment.\n * Required if is_debit_adjustment_by_procedure=true.\n * Supported for Open Dental only.\n */\n debit_adjustment_transaction_sr_no?: string;\n\n /**\n * The provider ID for the debit adjustment.\n * Required for Open Dental if performing debit adjustment write-back.\n * For Dentrix G6+, must match count of debit_adjustment_amount (pipe-delimited).\n */\n debit_adjustment_provider?: string;\n\n /**\n * The cheque number.\n * Mandatory if payment mode is Cheque for Tracker.\n */\n cheque_no?: string;\n\n /**\n * The bank number.\n */\n bank_no?: string;\n\n /**\n * The name of the bank.\n * Mandatory for Tracker.\n * Get using writeback_details API with category=bank name and writeback_type=claim_payment.\n */\n bank_name?: string;\n\n /**\n * The direct deposit reference number.\n * Mandatory if payment mode is Direct Deposit for Tracker.\n */\n direct_deposit_number?: string;\n\n /**\n * The provider ID.\n * Get using providers API.\n * Supported only for Tracker and Dentrix PMS.\n */\n provider_id?: 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\n// -----------------------------------------------------------------------------\n// Payment Type Types\n\n/**\n * Sikka payment type record\n */\nexport type SikkaPaymentType = {\n code: string;\n description: string;\n href: string;\n practice_href: string;\n practice_id: string;\n};\n\n/**\n * Parameters for listing payment types\n */\nexport type SikkaPaymentTypeListParams = {\n /**\n * Filter by payment type code in practice management system\n */\n code?: string;\n /**\n * Customer ID of office\n */\n customer_id?: string;\n /**\n * If true, returns Credit Adjustment Types only\n */\n is_adjustment_type?: boolean;\n /**\n * If true, returns Payment Types which require credit card details\n * for POST transaction (Planet DDS PMS only)\n */\n are_credit_card_details_required?: boolean;\n /**\n * If true, returns Debit Adjustment Types only\n */\n is_debit_adjustment_type?: boolean;\n /**\n * If true, returns Insurance Payment Types only\n */\n is_insurance_type?: boolean;\n /**\n * Results per page\n */\n limit?: number;\n /**\n * Pagination offset\n */\n offset?: number;\n /**\n * Practice ID of office\n */\n practice_id?: string;\n};\n\n/**\n * Response from the payment_types endpoint\n */\nexport type SikkaPaymentTypeListResponse =\n SikkaPaginatedResponse<SikkaPaymentType>;\n"]}
|
|
@@ -236,16 +236,31 @@ export type SikkaTransactionListParams = {
|
|
|
236
236
|
export type SikkaTransactionListResponse = SikkaPaginatedResponse<SikkaTransaction>;
|
|
237
237
|
export type SikkaPaymentMode = 'Cash' | 'Check' | 'EFT';
|
|
238
238
|
export type SikkaClaimPaymentRequest = {
|
|
239
|
-
cheque_no: string;
|
|
240
|
-
claim_payment_date: string;
|
|
241
239
|
claim_sr_no: string;
|
|
242
|
-
|
|
243
|
-
note: string;
|
|
240
|
+
practice_id: string;
|
|
244
241
|
payment_amount: string;
|
|
242
|
+
is_payment_by_procedure_code: 'false' | 'true';
|
|
243
|
+
claim_payment_date: string;
|
|
245
244
|
payment_mode: SikkaPaymentMode;
|
|
246
|
-
|
|
247
|
-
transaction_sr_no: string;
|
|
245
|
+
deductible: string;
|
|
248
246
|
write_off: string;
|
|
247
|
+
transaction_sr_no?: string;
|
|
248
|
+
note?: string;
|
|
249
|
+
adjustment_type?: string;
|
|
250
|
+
credit_adjustment_provider?: string;
|
|
251
|
+
is_debit_adjustment_writeback?: 'false' | 'true';
|
|
252
|
+
debit_adjustment_amount?: string;
|
|
253
|
+
debit_adjustment_date?: string;
|
|
254
|
+
debit_adjustment_type?: string;
|
|
255
|
+
debit_adjustment_note?: string;
|
|
256
|
+
is_debit_adjustment_by_procedure?: 'false' | 'true';
|
|
257
|
+
debit_adjustment_transaction_sr_no?: string;
|
|
258
|
+
debit_adjustment_provider?: string;
|
|
259
|
+
cheque_no?: string;
|
|
260
|
+
bank_no?: string;
|
|
261
|
+
bank_name?: string;
|
|
262
|
+
direct_deposit_number?: string;
|
|
263
|
+
provider_id?: string;
|
|
249
264
|
};
|
|
250
265
|
export type SikkaClaimPaymentResponse = {
|
|
251
266
|
claim_sr_no: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,aAAa,CAAC;AAK3D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAKF,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAKF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,yBAAyB,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,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