@rinse-dental/open-dental 0.1.3 → 0.1.4
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/deploy_notes.txt +21 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +3 -1
- package/dist/api/schedules.d.ts +29 -0
- package/dist/api/schedules.d.ts.map +1 -0
- package/dist/api/schedules.js +47 -0
- package/dist/openDental.d.ts +6 -1
- package/dist/openDental.d.ts.map +1 -1
- package/dist/openDental.js +11 -1
- package/dist/types/scheduleTypes.d.ts +28 -0
- package/dist/types/scheduleTypes.d.ts.map +1 -0
- package/dist/types/scheduleTypes.js +2 -0
- package/package.json +1 -1
- package/src/api/index.ts +1 -0
- package/src/api/schedules.ts +65 -0
- package/src/openDental.ts +13 -1
- package/src/types/scheduleTypes.ts +28 -0
package/deploy_notes.txt
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
npm run build
|
|
2
|
+
npm version patch //patch, minor, major
|
|
3
|
+
npm pack
|
|
4
|
+
git add .
|
|
5
|
+
git commit -m "notes"
|
|
6
|
+
git push origin main
|
|
7
|
+
git tag //confirm tag
|
|
8
|
+
git push origin vX.Y.Z
|
|
9
|
+
gh release create vX.Y.Z --title "Release vX.Y.Z" --notes ""
|
|
10
|
+
|
|
11
|
+
if the tag doesn't exist locally:
|
|
12
|
+
git tag vX.Y.Z
|
|
13
|
+
git push origin vX.Y.Z
|
|
14
|
+
gh release create vX.Y.Z --title "Release vX.Y.Z" --notes ""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
npm install /Users/casey/Dev/rinse-dental/open-dental/rinse-dental-open-dental-0.1.2.tgz
|
|
21
|
+
"@rinse-dental/open-dental":"^0.1.2",
|
package/dist/api/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { default as Patients } from "./patients";
|
|
|
6
6
|
export { default as ProcedureLogs } from "./procedureLog";
|
|
7
7
|
export { default as Recalls } from "./recalls";
|
|
8
8
|
export { default as TreatmentPlans } from "./treatplans";
|
|
9
|
+
export { default as Schedule } from "./schedules";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/api/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TreatmentPlans = exports.Recalls = exports.ProcedureLogs = exports.Patients = exports.PatFields = exports.CommLogs = exports.ChartModules = exports.Appointments = void 0;
|
|
6
|
+
exports.Schedule = exports.TreatmentPlans = exports.Recalls = exports.ProcedureLogs = exports.Patients = exports.PatFields = exports.CommLogs = exports.ChartModules = exports.Appointments = void 0;
|
|
7
7
|
var appointments_1 = require("./appointments");
|
|
8
8
|
Object.defineProperty(exports, "Appointments", { enumerable: true, get: function () { return __importDefault(appointments_1).default; } });
|
|
9
9
|
var chartModules_1 = require("./chartModules");
|
|
@@ -20,4 +20,6 @@ var recalls_1 = require("./recalls");
|
|
|
20
20
|
Object.defineProperty(exports, "Recalls", { enumerable: true, get: function () { return __importDefault(recalls_1).default; } });
|
|
21
21
|
var treatplans_1 = require("./treatplans");
|
|
22
22
|
Object.defineProperty(exports, "TreatmentPlans", { enumerable: true, get: function () { return __importDefault(treatplans_1).default; } });
|
|
23
|
+
var schedules_1 = require("./schedules");
|
|
24
|
+
Object.defineProperty(exports, "Schedule", { enumerable: true, get: function () { return __importDefault(schedules_1).default; } });
|
|
23
25
|
// Add other APIs as needed
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { Schedule, GetSchedulesParams } from "../types/scheduleTypes";
|
|
3
|
+
export default class Schedules {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch a single Schedule by its ID.
|
|
8
|
+
* @param {number} ScheduleNum - The ID of the patfield.
|
|
9
|
+
* @returns {Promise<Schedule>} - The patient data.
|
|
10
|
+
* @throws {Error} - If `PatNum` is not valid or the API returns an error.
|
|
11
|
+
*/
|
|
12
|
+
getSchedule(ScheduleNum: number): Promise<Schedule>;
|
|
13
|
+
/**
|
|
14
|
+
* Fetch multiple patients with optional filtering and pagination.
|
|
15
|
+
* @param {Object} params - Filtering and pagination parameters.
|
|
16
|
+
* @param {string} [params.date] - Optional: For a single day. Today's date by default.
|
|
17
|
+
* @param {string} [params.dateStart] - Optional: For a single day. Today's date by default.
|
|
18
|
+
* @param {string} [params.dateEnd] - Optional: For a single day. Today's date by default.
|
|
19
|
+
* @param {'Practice' | 'Provider' | 'Blockout' | 'Employee' | 'WebSchedASAP'} [params.SchedType] - Optional: Either "Practice", "Provider", "Blockout", "Employee", or "WebSchedASAP".
|
|
20
|
+
* @param {number} [params.BlockoutDefNum] - Definition.DefNum where definition.Category=25.
|
|
21
|
+
* @param {number} [params.ProvNum] - FK to provider.ProvNum.
|
|
22
|
+
* @param {number} [params.EmployeeNum] - FK to employee.EmployeeNum.
|
|
23
|
+
* @param {number} [params.Offset] - Pagination offset.
|
|
24
|
+
* @returns {Promise<Schedule[]>} - A list of summarized patient data.
|
|
25
|
+
* @throws {Error} - If the API returns an error.
|
|
26
|
+
*/
|
|
27
|
+
getSchedules({ date, dateStart, dateEnd, SchedType, BlockoutDefNum, ProvNum, EmployeeNum, Offset, }?: GetSchedulesParams): Promise<Schedule[]>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=schedules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/api/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACH,QAAQ,EACR,kBAAkB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;OAKG;IACU,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQhE;;;;;;;;;;;;;OAaG;IACY,YAAY,CAAC,EACxB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,SAAS,EACT,cAAc,EACd,OAAO,EACP,WAAW,EACX,MAAM,GAEP,GAAE,kBAAuB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAanD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Schedules {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch a single Schedule by its ID.
|
|
10
|
+
* @param {number} ScheduleNum - The ID of the patfield.
|
|
11
|
+
* @returns {Promise<Schedule>} - The patient data.
|
|
12
|
+
* @throws {Error} - If `PatNum` is not valid or the API returns an error.
|
|
13
|
+
*/
|
|
14
|
+
async getSchedule(ScheduleNum) {
|
|
15
|
+
if (!ScheduleNum || typeof ScheduleNum !== "number") {
|
|
16
|
+
throw new Error("Invalid parameter: PatNum must be a valid number.");
|
|
17
|
+
}
|
|
18
|
+
return await this.httpClient.get(`/schedules/${ScheduleNum}`);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Fetch multiple patients with optional filtering and pagination.
|
|
22
|
+
* @param {Object} params - Filtering and pagination parameters.
|
|
23
|
+
* @param {string} [params.date] - Optional: For a single day. Today's date by default.
|
|
24
|
+
* @param {string} [params.dateStart] - Optional: For a single day. Today's date by default.
|
|
25
|
+
* @param {string} [params.dateEnd] - Optional: For a single day. Today's date by default.
|
|
26
|
+
* @param {'Practice' | 'Provider' | 'Blockout' | 'Employee' | 'WebSchedASAP'} [params.SchedType] - Optional: Either "Practice", "Provider", "Blockout", "Employee", or "WebSchedASAP".
|
|
27
|
+
* @param {number} [params.BlockoutDefNum] - Definition.DefNum where definition.Category=25.
|
|
28
|
+
* @param {number} [params.ProvNum] - FK to provider.ProvNum.
|
|
29
|
+
* @param {number} [params.EmployeeNum] - FK to employee.EmployeeNum.
|
|
30
|
+
* @param {number} [params.Offset] - Pagination offset.
|
|
31
|
+
* @returns {Promise<Schedule[]>} - A list of summarized patient data.
|
|
32
|
+
* @throws {Error} - If the API returns an error.
|
|
33
|
+
*/
|
|
34
|
+
async getSchedules({ date, dateStart, dateEnd, SchedType, BlockoutDefNum, ProvNum, EmployeeNum, Offset, } = {}) {
|
|
35
|
+
return await this.httpClient.get("/schedules", {
|
|
36
|
+
date,
|
|
37
|
+
dateStart,
|
|
38
|
+
dateEnd,
|
|
39
|
+
SchedType,
|
|
40
|
+
BlockoutDefNum,
|
|
41
|
+
ProvNum,
|
|
42
|
+
EmployeeNum,
|
|
43
|
+
Offset,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.default = Schedules;
|
package/dist/openDental.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import Patients from "./api/patients";
|
|
|
6
6
|
import ProcedureLogs from "./api/procedureLog";
|
|
7
7
|
import Recalls from "./api/recalls";
|
|
8
8
|
import TreatmentPlans from "./api/treatplans";
|
|
9
|
+
import Schedules from "./api/schedules";
|
|
9
10
|
declare class OpenDental {
|
|
10
11
|
private static httpClient;
|
|
11
12
|
/**
|
|
@@ -41,9 +42,13 @@ declare class OpenDental {
|
|
|
41
42
|
*/
|
|
42
43
|
static Recalls(): Recalls;
|
|
43
44
|
/**
|
|
44
|
-
* Create a new instance of the
|
|
45
|
+
* Create a new instance of the TreatmentPlans API.
|
|
45
46
|
*/
|
|
46
47
|
static TreatmentPlans(): TreatmentPlans;
|
|
48
|
+
/**
|
|
49
|
+
* Create a new instance of the Schedules API.
|
|
50
|
+
*/
|
|
51
|
+
static Schedules(): Schedules;
|
|
47
52
|
}
|
|
48
53
|
export { OpenDental };
|
|
49
54
|
//# sourceMappingURL=openDental.d.ts.map
|
package/dist/openDental.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openDental.d.ts","sourceRoot":"","sources":["../src/openDental.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,cAAc,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"openDental.d.ts","sourceRoot":"","sources":["../src/openDental.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAGxC,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAC,UAAU,CAAa;IAEtC;;OAEG;WACW,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAWlE;;OAEG;WACa,YAAY;IAQ5B;;OAEG;WACa,QAAQ;IAOxB;;OAEG;WACW,YAAY;IAO1B;;SAEK;WACS,SAAS;IAOvB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,aAAa;IAO3B;;OAEG;WACW,OAAO;IAOrB;;OAEG;WACW,cAAc;IAO1B;;KAEC;WACa,SAAS;CAQ1B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/openDental.js
CHANGED
|
@@ -13,6 +13,7 @@ const patients_1 = __importDefault(require("./api/patients"));
|
|
|
13
13
|
const procedureLog_1 = __importDefault(require("./api/procedureLog"));
|
|
14
14
|
const recalls_1 = __importDefault(require("./api/recalls"));
|
|
15
15
|
const treatplans_1 = __importDefault(require("./api/treatplans"));
|
|
16
|
+
const schedules_1 = __importDefault(require("./api/schedules"));
|
|
16
17
|
class OpenDental {
|
|
17
18
|
static httpClient;
|
|
18
19
|
/**
|
|
@@ -90,7 +91,7 @@ class OpenDental {
|
|
|
90
91
|
return new recalls_1.default(this.httpClient);
|
|
91
92
|
}
|
|
92
93
|
/**
|
|
93
|
-
* Create a new instance of the
|
|
94
|
+
* Create a new instance of the TreatmentPlans API.
|
|
94
95
|
*/
|
|
95
96
|
static TreatmentPlans() {
|
|
96
97
|
if (!this.httpClient) {
|
|
@@ -98,5 +99,14 @@ class OpenDental {
|
|
|
98
99
|
}
|
|
99
100
|
return new treatplans_1.default(this.httpClient);
|
|
100
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Create a new instance of the Schedules API.
|
|
104
|
+
*/
|
|
105
|
+
static Schedules() {
|
|
106
|
+
if (!this.httpClient) {
|
|
107
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
108
|
+
}
|
|
109
|
+
return new schedules_1.default(this.httpClient);
|
|
110
|
+
}
|
|
101
111
|
}
|
|
102
112
|
exports.OpenDental = OpenDental;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for fetching multiple patients.
|
|
3
|
+
* @see https://www.opendental.com/site/apischedules.html
|
|
4
|
+
*/
|
|
5
|
+
export interface Schedule {
|
|
6
|
+
ScheduleNum?: number;
|
|
7
|
+
SchedDate?: string;
|
|
8
|
+
StartTime?: string;
|
|
9
|
+
StopTime?: string;
|
|
10
|
+
SchedType?: "Practice" | "Provider" | "Blockout" | "Employee" | "WebSchedASAP";
|
|
11
|
+
ProvNum?: number;
|
|
12
|
+
BlockoutType?: string;
|
|
13
|
+
blockoutType?: string;
|
|
14
|
+
Note?: string;
|
|
15
|
+
operatories?: string;
|
|
16
|
+
EmployeeNum?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface GetSchedulesParams {
|
|
19
|
+
date?: string;
|
|
20
|
+
dateStart?: string;
|
|
21
|
+
dateEnd?: string;
|
|
22
|
+
SchedType?: "Practice" | "Provider" | "Blockout" | "Employee" | "WebSchedASAP";
|
|
23
|
+
BlockoutDefNum?: string;
|
|
24
|
+
ProvNum?: number;
|
|
25
|
+
EmployeeNum?: number;
|
|
26
|
+
Offset?: number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=scheduleTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleTypes.d.ts","sourceRoot":"","sources":["../../src/types/scheduleTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { default as Patients } from "./patients";
|
|
|
6
6
|
export { default as ProcedureLogs } from "./procedureLog";
|
|
7
7
|
export { default as Recalls } from "./recalls";
|
|
8
8
|
export { default as TreatmentPlans } from "./treatplans";
|
|
9
|
+
export { default as Schedule } from "./schedules";
|
|
9
10
|
// Add other APIs as needed
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Schedule,
|
|
4
|
+
GetSchedulesParams,
|
|
5
|
+
} from "../types/scheduleTypes";
|
|
6
|
+
|
|
7
|
+
export default class Schedules {
|
|
8
|
+
private httpClient: HttpClient;
|
|
9
|
+
|
|
10
|
+
constructor(httpClient: HttpClient) {
|
|
11
|
+
this.httpClient = httpClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Fetch a single Schedule by its ID.
|
|
16
|
+
* @param {number} ScheduleNum - The ID of the patfield.
|
|
17
|
+
* @returns {Promise<Schedule>} - The patient data.
|
|
18
|
+
* @throws {Error} - If `PatNum` is not valid or the API returns an error.
|
|
19
|
+
*/
|
|
20
|
+
public async getSchedule(ScheduleNum: number): Promise<Schedule> {
|
|
21
|
+
if (!ScheduleNum || typeof ScheduleNum !== "number") {
|
|
22
|
+
throw new Error("Invalid parameter: PatNum must be a valid number.");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await this.httpClient.get<Schedule>(`/schedules/${ScheduleNum}`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Fetch multiple patients with optional filtering and pagination.
|
|
30
|
+
* @param {Object} params - Filtering and pagination parameters.
|
|
31
|
+
* @param {string} [params.date] - Optional: For a single day. Today's date by default.
|
|
32
|
+
* @param {string} [params.dateStart] - Optional: For a single day. Today's date by default.
|
|
33
|
+
* @param {string} [params.dateEnd] - Optional: For a single day. Today's date by default.
|
|
34
|
+
* @param {'Practice' | 'Provider' | 'Blockout' | 'Employee' | 'WebSchedASAP'} [params.SchedType] - Optional: Either "Practice", "Provider", "Blockout", "Employee", or "WebSchedASAP".
|
|
35
|
+
* @param {number} [params.BlockoutDefNum] - Definition.DefNum where definition.Category=25.
|
|
36
|
+
* @param {number} [params.ProvNum] - FK to provider.ProvNum.
|
|
37
|
+
* @param {number} [params.EmployeeNum] - FK to employee.EmployeeNum.
|
|
38
|
+
* @param {number} [params.Offset] - Pagination offset.
|
|
39
|
+
* @returns {Promise<Schedule[]>} - A list of summarized patient data.
|
|
40
|
+
* @throws {Error} - If the API returns an error.
|
|
41
|
+
*/
|
|
42
|
+
public async getSchedules({
|
|
43
|
+
date,
|
|
44
|
+
dateStart,
|
|
45
|
+
dateEnd,
|
|
46
|
+
SchedType,
|
|
47
|
+
BlockoutDefNum,
|
|
48
|
+
ProvNum,
|
|
49
|
+
EmployeeNum,
|
|
50
|
+
Offset,
|
|
51
|
+
|
|
52
|
+
}: GetSchedulesParams = {}): Promise<Schedule[]> {
|
|
53
|
+
|
|
54
|
+
return await this.httpClient.get<Schedule[]>("/schedules", {
|
|
55
|
+
date,
|
|
56
|
+
dateStart,
|
|
57
|
+
dateEnd,
|
|
58
|
+
SchedType,
|
|
59
|
+
BlockoutDefNum,
|
|
60
|
+
ProvNum,
|
|
61
|
+
EmployeeNum,
|
|
62
|
+
Offset,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
package/src/openDental.ts
CHANGED
|
@@ -7,6 +7,8 @@ import Patients from "./api/patients";
|
|
|
7
7
|
import ProcedureLogs from "./api/procedureLog";
|
|
8
8
|
import Recalls from "./api/recalls";
|
|
9
9
|
import TreatmentPlans from "./api/treatplans";
|
|
10
|
+
import Schedules from "./api/schedules";
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
class OpenDental {
|
|
12
14
|
private static httpClient: HttpClient;
|
|
@@ -97,7 +99,7 @@ class OpenDental {
|
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
/**
|
|
100
|
-
* Create a new instance of the
|
|
102
|
+
* Create a new instance of the TreatmentPlans API.
|
|
101
103
|
*/
|
|
102
104
|
public static TreatmentPlans() {
|
|
103
105
|
if (!this.httpClient) {
|
|
@@ -106,6 +108,16 @@ class OpenDental {
|
|
|
106
108
|
return new TreatmentPlans(this.httpClient);
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Create a new instance of the Schedules API.
|
|
113
|
+
*/
|
|
114
|
+
public static Schedules() {
|
|
115
|
+
if (!this.httpClient) {
|
|
116
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
117
|
+
}
|
|
118
|
+
return new Schedules(this.httpClient);
|
|
119
|
+
}
|
|
120
|
+
|
|
109
121
|
|
|
110
122
|
}
|
|
111
123
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for fetching multiple patients.
|
|
3
|
+
* @see https://www.opendental.com/site/apischedules.html
|
|
4
|
+
*/
|
|
5
|
+
export interface Schedule {
|
|
6
|
+
ScheduleNum?: number; //Unique identifier for patfield
|
|
7
|
+
SchedDate?: string; //"YYYY-MM-DD"
|
|
8
|
+
StartTime?: string; //"12:00:00"
|
|
9
|
+
StopTime?: string; //"12:00:00"
|
|
10
|
+
SchedType?: "Practice" | "Provider" | "Blockout" | "Employee" | "WebSchedASAP"; //Either "Practice", "Provider", "Blockout", "Employee", or "WebSchedASAP".
|
|
11
|
+
ProvNum?: number; //FK to provider.ProvNum.
|
|
12
|
+
BlockoutType?: string; //"YYYY-MM-DD"
|
|
13
|
+
blockoutType?: string; //"YYYY-MM-DD"
|
|
14
|
+
Note?: string; //"YYYY-MM-DD"
|
|
15
|
+
operatories?: string; //"YYYY-MM-DD"
|
|
16
|
+
EmployeeNum?: string; //"YYYY-MM-DD"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GetSchedulesParams {
|
|
20
|
+
date?: string; //"YYYY-MM-DD", For a single day. Today's date by default.
|
|
21
|
+
dateStart?: string; //"YYYY-MM-DD" For a date range, inclusive of both dates.
|
|
22
|
+
dateEnd?: string; //"YYYY-MM-DD" For a date range, inclusive of both dates.
|
|
23
|
+
SchedType?: "Practice" | "Provider" | "Blockout" | "Employee" | "WebSchedASAP"; //Either "Practice", "Provider", "Blockout", "Employee", or "WebSchedASAP".
|
|
24
|
+
BlockoutDefNum?: string; //Definition.DefNum where definition.Category=25.
|
|
25
|
+
ProvNum?: number; //FK to provider.ProvNum.
|
|
26
|
+
EmployeeNum?: number; //FK to employee.EmployeeNum.
|
|
27
|
+
Offset?: number; //pagination
|
|
28
|
+
}
|