@rinse-dental/open-dental 4.0.0 → 4.1.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/README.md +87 -17
- package/dist/api/appointments.js +1 -1
- package/dist/api/claims.js +1 -1
- package/dist/api/patients.d.ts +2 -2
- package/dist/api/patients.d.ts.map +1 -1
- package/dist/api/patients.js +3 -3
- package/dist/api/procedureLog.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/types/patientTypes.d.ts +1 -1
- package/dist/types/patientTypes.d.ts.map +1 -1
- package/dist/utils/dateUtils.d.ts +25 -0
- package/dist/utils/dateUtils.d.ts.map +1 -0
- package/dist/utils/dateUtils.js +39 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,14 +19,12 @@ npm install @rinse-dental/open-dental
|
|
|
19
19
|
```ts
|
|
20
20
|
import { OpenDental } from '@rinse-dental/open-dental';
|
|
21
21
|
|
|
22
|
-
// Initialize once at application startup
|
|
22
|
+
// Initialize once at application startup (the SDK appends /api/v1 automatically)
|
|
23
23
|
OpenDental.initialize(
|
|
24
24
|
'https://your-open-dental-server.example.com', // base URL — no trailing slash
|
|
25
|
-
'YOUR_API_TOKEN'
|
|
25
|
+
'YOUR_API_TOKEN', // Base64 "ODFHIR {DeveloperKey}/{CustomerKey}" token
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
// The SDK appends /api/v1 automatically — do not include it in baseURL.
|
|
29
|
-
|
|
30
28
|
// Use any resource
|
|
31
29
|
const patients = OpenDental.Patients();
|
|
32
30
|
const results = await patients.getPatients({ LName: 'Smith' });
|
|
@@ -37,18 +35,31 @@ console.log(results);
|
|
|
37
35
|
|
|
38
36
|
## Initialization
|
|
39
37
|
|
|
40
|
-
`OpenDental.initialize(baseURL, authToken)` must be called **once** before any other method. All subsequent calls reuse the same HTTP client.
|
|
38
|
+
`OpenDental.initialize(baseURL, authToken, options?)` must be called **once** before any other method. All subsequent calls reuse the same HTTP client.
|
|
41
39
|
|
|
42
|
-
| Parameter
|
|
43
|
-
|
|
44
|
-
| `baseURL`
|
|
45
|
-
| `authToken`
|
|
40
|
+
| Parameter | Type | Required | Description |
|
|
41
|
+
|--------------------|---------|----------|----------------------------------------------------------|
|
|
42
|
+
| `baseURL` | string | Yes | Root URL of your Open Dental server (no trailing slash). |
|
|
43
|
+
| `authToken` | string | Yes | Base64-encoded `ODFHIR {DeveloperKey}/{CustomerKey}` API token. |
|
|
44
|
+
| `options.timeout` | number | No | Request timeout in milliseconds. Default: `30000`. |
|
|
45
|
+
| `options.debug` | boolean | No | Log HTTP errors to console (strips PHI). Default: `false`. |
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
|
+
// Minimal
|
|
48
49
|
OpenDental.initialize(
|
|
49
50
|
process.env.OPEN_DENTAL_BASEURL!,
|
|
50
51
|
process.env.OPEN_DENTAL_API_KEY!
|
|
51
52
|
);
|
|
53
|
+
|
|
54
|
+
// With options
|
|
55
|
+
OpenDental.initialize(
|
|
56
|
+
process.env.OPEN_DENTAL_BASEURL!,
|
|
57
|
+
process.env.OPEN_DENTAL_API_KEY!,
|
|
58
|
+
{
|
|
59
|
+
timeout: 15_000, // 15 seconds
|
|
60
|
+
debug: process.env.NODE_ENV !== 'production',
|
|
61
|
+
}
|
|
62
|
+
);
|
|
52
63
|
```
|
|
53
64
|
|
|
54
65
|
---
|
|
@@ -287,6 +298,36 @@ await benefits.deleteBenefit(benefitNum);
|
|
|
287
298
|
|
|
288
299
|
---
|
|
289
300
|
|
|
301
|
+
## Date Utilities
|
|
302
|
+
|
|
303
|
+
Open Dental returns dates and datetimes **without timezone information** — they reflect the local clock of the Open Dental server. Use `toISO` to convert these to ISO 8601 UTC strings before storing or comparing them in your application.
|
|
304
|
+
|
|
305
|
+
```ts
|
|
306
|
+
import { toISO } from '@rinse-dental/open-dental';
|
|
307
|
+
|
|
308
|
+
// Datetime string — "yyyy-MM-dd HH:mm:ss"
|
|
309
|
+
toISO("2021-08-05 02:00:00", "America/Los_Angeles");
|
|
310
|
+
// => "2021-08-05T09:00:00.000Z" (PDT, UTC-7)
|
|
311
|
+
|
|
312
|
+
// Date-only string — interpreted as midnight in the given timezone
|
|
313
|
+
toISO("2021-08-05", "America/Los_Angeles");
|
|
314
|
+
// => "2021-08-05T07:00:00.000Z" (PDT, UTC-7)
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Pass an [IANA timezone name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) matching your Open Dental server's configured timezone. DST transitions are handled automatically. Strings that don't match either format are returned unchanged.
|
|
318
|
+
|
|
319
|
+
**Typical usage after an API call:**
|
|
320
|
+
|
|
321
|
+
```ts
|
|
322
|
+
const appt = await OpenDental.Appointments().getAppointment(12345);
|
|
323
|
+
const TZ = "America/Los_Angeles";
|
|
324
|
+
|
|
325
|
+
const startISO = toISO(appt.AptDateTime, TZ);
|
|
326
|
+
const endISO = toISO(appt.AptDateTimeEnd, TZ);
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
290
331
|
## API Documentation (`Docs/`)
|
|
291
332
|
|
|
292
333
|
This package includes the full Open Dental API reference documentation in the `Docs/` folder, enriched with database schema mappings and field-level notes for every endpoint. These markdown files are optimized for AI-assisted development.
|
|
@@ -305,19 +346,19 @@ Docs/
|
|
|
305
346
|
|
|
306
347
|
## Breaking Changes
|
|
307
348
|
|
|
308
|
-
###
|
|
349
|
+
### v4.0.0
|
|
309
350
|
|
|
310
|
-
The following changes are **breaking** relative to v3.
|
|
351
|
+
The following changes are **breaking** relative to v3.x.
|
|
311
352
|
|
|
312
353
|
**`ChartModules.PatientInfo()` → `ChartModules.getPatientInfo()`**
|
|
313
354
|
|
|
314
355
|
The method was renamed to follow the SDK's `getX()` naming convention.
|
|
315
356
|
|
|
316
357
|
```ts
|
|
317
|
-
// Before (v3.
|
|
358
|
+
// Before (v3.x)
|
|
318
359
|
const info = await OpenDental.ChartModules().PatientInfo(patNum);
|
|
319
360
|
|
|
320
|
-
// After (
|
|
361
|
+
// After (v4.0.1)
|
|
321
362
|
const info = await OpenDental.ChartModules().getPatientInfo(patNum);
|
|
322
363
|
```
|
|
323
364
|
|
|
@@ -326,29 +367,58 @@ const info = await OpenDental.ChartModules().getPatientInfo(patNum);
|
|
|
326
367
|
The method was renamed to correctly reflect that it deletes a benefit record, not a patient plan.
|
|
327
368
|
|
|
328
369
|
```ts
|
|
329
|
-
// Before (v3.
|
|
370
|
+
// Before (v3.x)
|
|
330
371
|
await OpenDental.Benefits().deletePatPlan(benefitNum);
|
|
331
372
|
|
|
332
|
-
// After (
|
|
373
|
+
// After (v4.0.0)
|
|
333
374
|
await OpenDental.Benefits().deleteBenefit(benefitNum);
|
|
334
375
|
```
|
|
335
376
|
|
|
377
|
+
**`RefAttaches.deleteInsSub()` → `RefAttaches.deleteRefAttach()`**
|
|
378
|
+
|
|
379
|
+
The method was incorrectly named after a different resource. It has been corrected.
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
// Before (v3.x)
|
|
383
|
+
await OpenDental.RefAttaches().deleteInsSub(refAttachNum);
|
|
384
|
+
|
|
385
|
+
// After (v4.0.0)
|
|
386
|
+
await OpenDental.RefAttaches().deleteRefAttach(refAttachNum);
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**`InsVerifies.createInsVerifies()` now correctly uses POST**
|
|
390
|
+
|
|
391
|
+
Previously this method called `PUT /insverifies` instead of `POST /insverifies`. Any consumers relying on the incorrect behavior should verify their integration.
|
|
392
|
+
|
|
336
393
|
**API errors now throw `Error` instances**
|
|
337
394
|
|
|
338
395
|
Previously, API errors threw the raw Axios response object. They now throw a standard `Error` with a descriptive message string. Update any catch blocks that inspected `err.status` or `err.data` directly:
|
|
339
396
|
|
|
340
397
|
```ts
|
|
341
|
-
// Before (v3.
|
|
398
|
+
// Before (v3.x) — err was an AxiosResponse
|
|
342
399
|
catch (err: any) {
|
|
343
400
|
console.log(err.status);
|
|
344
401
|
}
|
|
345
402
|
|
|
346
|
-
// After (
|
|
403
|
+
// After (v4.0.1) — err is an Error
|
|
347
404
|
catch (err: unknown) {
|
|
348
405
|
if (err instanceof Error) console.log(err.message);
|
|
349
406
|
}
|
|
350
407
|
```
|
|
351
408
|
|
|
409
|
+
**All GET list endpoints now accept `Limit`, `DateFormatString`, and `DateTimeFormatString`**
|
|
410
|
+
|
|
411
|
+
These are additive and non-breaking for existing callers, but consumers relying on receiving all results in a single call should be aware of the 1000-item hard limit per request.
|
|
412
|
+
|
|
413
|
+
```ts
|
|
414
|
+
// Paginate through results
|
|
415
|
+
const page1 = await OpenDental.Appointments().getAppointments({ Offset: 0, Limit: 1000 });
|
|
416
|
+
const page2 = await OpenDental.Appointments().getAppointments({ Offset: 1000, Limit: 1000 });
|
|
417
|
+
|
|
418
|
+
// Custom date format
|
|
419
|
+
const patients = await OpenDental.Patients().getPatients({ DateFormatString: "MM/dd/yyyy" });
|
|
420
|
+
```
|
|
421
|
+
|
|
352
422
|
---
|
|
353
423
|
|
|
354
424
|
## TypeScript Support
|
package/dist/api/appointments.js
CHANGED
|
@@ -65,7 +65,7 @@ class Appointments {
|
|
|
65
65
|
if (!params.ClinicNum) {
|
|
66
66
|
throw new Error("Invalid parameter: ClinicNum is required when Clinics are enabled.");
|
|
67
67
|
}
|
|
68
|
-
return this.httpClient.get("/appointments/
|
|
68
|
+
return this.httpClient.get("/appointments/ASAP", params);
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Fetch available appointment slots.
|
package/dist/api/claims.js
CHANGED
|
@@ -157,7 +157,7 @@ class Claims {
|
|
|
157
157
|
if (!Array.isArray(procNums) || procNums.length === 0) {
|
|
158
158
|
throw new Error("Invalid parameter: procNums must be a non-empty array.");
|
|
159
159
|
}
|
|
160
|
-
return this.httpClient.put(`/claims/${ClaimNum}/Split`, { procNums });
|
|
160
|
+
return this.httpClient.put(`/claims/${ClaimNum}/Split`, { ProcNums: procNums });
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
163
|
* Delete a Claim record.
|
package/dist/api/patients.d.ts
CHANGED
|
@@ -32,14 +32,14 @@ export default class Patients {
|
|
|
32
32
|
* @param {string} [params.SubscriberId] - Filter by subscriber ID.
|
|
33
33
|
* @param {string} [params.Email] - Filter by email address.
|
|
34
34
|
* @param {string} [params.Country] - Filter by country.
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {string} [params.clinicNums] - Comma-separated clinic numbers.
|
|
36
36
|
* @param {string} [params.clinicAbbr] - Filter by clinic abbreviation.
|
|
37
37
|
* @param {string} [params.invoiceNumber] - Filter by invoice number.
|
|
38
38
|
* @param {number} [params.Offset] - Pagination offset.
|
|
39
39
|
* @returns {Promise<PatientSummary[]>} - A list of summarized patient data.
|
|
40
40
|
* @throws {Error} - If the API returns an error.
|
|
41
41
|
*/
|
|
42
|
-
getPatients({ LName, FName, Phone, Address, hideInactive, City, State, SSN, ChartNumber, guarOnly, showArchived, Birthdate, SiteNum, SubscriberId, Email, Country,
|
|
42
|
+
getPatients({ LName, FName, Phone, Address, hideInactive, City, State, SSN, ChartNumber, guarOnly, showArchived, Birthdate, SiteNum, SubscriberId, Email, Country, clinicNums, clinicAbbr, invoiceNumber, Offset, Limit, DateFormatString, DateTimeFormatString, }?: GetPatientsParams): Promise<PatientSummary[]>;
|
|
43
43
|
/**
|
|
44
44
|
* Fetch multiple patients with optional filtering and pagination.
|
|
45
45
|
* @param {Object} params - Filtering and pagination parameters.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patients.d.ts","sourceRoot":"","sources":["../../src/api/patients.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,Q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,iBAAiB,CAAC,EAC7B,KAAK,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,EACT,WAAW,EACX,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,oBAAoB,GACvB,GAAE,uBAA4B,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAsBlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACU,aAAa,CAAC,EACzB,KAAK,EACL,KAAK,EACL,GAAG,YAAY,EAChB,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAW1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwCE;IACY,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAcxF"}
|
package/dist/api/patients.js
CHANGED
|
@@ -39,14 +39,14 @@ class Patients {
|
|
|
39
39
|
* @param {string} [params.SubscriberId] - Filter by subscriber ID.
|
|
40
40
|
* @param {string} [params.Email] - Filter by email address.
|
|
41
41
|
* @param {string} [params.Country] - Filter by country.
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {string} [params.clinicNums] - Comma-separated clinic numbers.
|
|
43
43
|
* @param {string} [params.clinicAbbr] - Filter by clinic abbreviation.
|
|
44
44
|
* @param {string} [params.invoiceNumber] - Filter by invoice number.
|
|
45
45
|
* @param {number} [params.Offset] - Pagination offset.
|
|
46
46
|
* @returns {Promise<PatientSummary[]>} - A list of summarized patient data.
|
|
47
47
|
* @throws {Error} - If the API returns an error.
|
|
48
48
|
*/
|
|
49
|
-
async getPatients({ LName, FName, Phone, Address, hideInactive, City, State, SSN, ChartNumber, guarOnly, showArchived, Birthdate, SiteNum, SubscriberId, Email, Country,
|
|
49
|
+
async getPatients({ LName, FName, Phone, Address, hideInactive, City, State, SSN, ChartNumber, guarOnly, showArchived, Birthdate, SiteNum, SubscriberId, Email, Country, clinicNums, clinicAbbr, invoiceNumber, Offset, Limit, DateFormatString, DateTimeFormatString, } = {}) {
|
|
50
50
|
return await this.httpClient.get("/patients", {
|
|
51
51
|
LName,
|
|
52
52
|
FName,
|
|
@@ -64,7 +64,7 @@ class Patients {
|
|
|
64
64
|
SubscriberId,
|
|
65
65
|
Email,
|
|
66
66
|
Country,
|
|
67
|
-
|
|
67
|
+
clinicNums,
|
|
68
68
|
clinicAbbr,
|
|
69
69
|
invoiceNumber,
|
|
70
70
|
Offset,
|
package/dist/api/procedureLog.js
CHANGED
|
@@ -250,7 +250,7 @@ class ProcedureLogs {
|
|
|
250
250
|
if (!PatNum || !InsSubNum) {
|
|
251
251
|
throw new Error("Invalid parameters: PatNum and InsSubNum are required.");
|
|
252
252
|
}
|
|
253
|
-
return this.httpClient.get("/procedurelogs/
|
|
253
|
+
return this.httpClient.get("/procedurelogs/InsuranceHistory", {
|
|
254
254
|
PatNum,
|
|
255
255
|
InsSubNum,
|
|
256
256
|
Limit,
|
|
@@ -272,7 +272,7 @@ class ProcedureLogs {
|
|
|
272
272
|
if (!PatNum || !InsSubNum || !insHistPrefName || !ProcDate) {
|
|
273
273
|
throw new Error("Invalid parameter: PatNum, InsSubNum, insHistPrefName, and ProcDate are required.");
|
|
274
274
|
}
|
|
275
|
-
return this.httpClient.post("/procedurelogs/
|
|
275
|
+
return this.httpClient.post("/procedurelogs/InsuranceHistory", {
|
|
276
276
|
PatNum,
|
|
277
277
|
InsSubNum,
|
|
278
278
|
insHistPrefName,
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Transformers = exports.OpenDental = void 0;
|
|
36
|
+
exports.toISO = exports.Transformers = exports.OpenDental = void 0;
|
|
37
37
|
var openDental_1 = require("./openDental");
|
|
38
38
|
Object.defineProperty(exports, "OpenDental", { enumerable: true, get: function () { return openDental_1.OpenDental; } });
|
|
39
39
|
exports.Transformers = __importStar(require("./transformers"));
|
|
40
|
+
var dateUtils_1 = require("./utils/dateUtils");
|
|
41
|
+
Object.defineProperty(exports, "toISO", { enumerable: true, get: function () { return dateUtils_1.toISO; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patientTypes.d.ts","sourceRoot":"","sources":["../../src/types/patientTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC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EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC;CACrC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts an Open Dental date or datetime string to an ISO 8601 UTC string,
|
|
3
|
+
* interpreting the input as being in the given IANA timezone.
|
|
4
|
+
*
|
|
5
|
+
* Open Dental returns dates without timezone information. The server stores
|
|
6
|
+
* times in its local timezone (configured at the practice level). Pass that
|
|
7
|
+
* timezone here so the conversion to UTC is correct, including DST transitions.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} value - A date string in "yyyy-MM-dd" or "yyyy-MM-dd HH:mm:ss" format.
|
|
10
|
+
* @param {string} timezone - IANA timezone name (e.g. "America/Los_Angeles").
|
|
11
|
+
* @returns {string} ISO 8601 UTC string (e.g. "2021-08-05T09:00:00.000Z"),
|
|
12
|
+
* or the original value unchanged if it does not match a recognised format.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Datetime (server in PST, offset -8 in winter / -7 in summer)
|
|
16
|
+
* toISO("2021-08-05 02:00:00", "America/Los_Angeles");
|
|
17
|
+
* // => "2021-08-05T09:00:00.000Z" (PDT, UTC-7)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Date-only — interpreted as midnight in the given timezone
|
|
21
|
+
* toISO("2021-08-05", "America/Los_Angeles");
|
|
22
|
+
* // => "2021-08-05T07:00:00.000Z" (PDT, UTC-7)
|
|
23
|
+
*/
|
|
24
|
+
export declare function toISO(value: string, timezone: string): string;
|
|
25
|
+
//# sourceMappingURL=dateUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../src/utils/dateUtils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAU7D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.toISO = toISO;
|
|
7
|
+
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
8
|
+
/**
|
|
9
|
+
* Converts an Open Dental date or datetime string to an ISO 8601 UTC string,
|
|
10
|
+
* interpreting the input as being in the given IANA timezone.
|
|
11
|
+
*
|
|
12
|
+
* Open Dental returns dates without timezone information. The server stores
|
|
13
|
+
* times in its local timezone (configured at the practice level). Pass that
|
|
14
|
+
* timezone here so the conversion to UTC is correct, including DST transitions.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} value - A date string in "yyyy-MM-dd" or "yyyy-MM-dd HH:mm:ss" format.
|
|
17
|
+
* @param {string} timezone - IANA timezone name (e.g. "America/Los_Angeles").
|
|
18
|
+
* @returns {string} ISO 8601 UTC string (e.g. "2021-08-05T09:00:00.000Z"),
|
|
19
|
+
* or the original value unchanged if it does not match a recognised format.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Datetime (server in PST, offset -8 in winter / -7 in summer)
|
|
23
|
+
* toISO("2021-08-05 02:00:00", "America/Los_Angeles");
|
|
24
|
+
* // => "2021-08-05T09:00:00.000Z" (PDT, UTC-7)
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Date-only — interpreted as midnight in the given timezone
|
|
28
|
+
* toISO("2021-08-05", "America/Los_Angeles");
|
|
29
|
+
* // => "2021-08-05T07:00:00.000Z" (PDT, UTC-7)
|
|
30
|
+
*/
|
|
31
|
+
function toISO(value, timezone) {
|
|
32
|
+
if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(value)) {
|
|
33
|
+
return moment_timezone_1.default.tz(value, "YYYY-MM-DD HH:mm:ss", timezone).toISOString();
|
|
34
|
+
}
|
|
35
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
36
|
+
return moment_timezone_1.default.tz(value, "YYYY-MM-DD", timezone).startOf("day").toISOString();
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}
|