@rinse-dental/open-dental 0.1.7 → 1.0.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/deploy_notes.txt +4 -2
- package/dist/api/definitions.d.ts +16 -0
- package/dist/api/definitions.d.ts.map +1 -0
- package/dist/api/definitions.js +25 -0
- package/dist/api/discountPlanSubs.d.ts +46 -0
- package/dist/api/discountPlanSubs.d.ts.map +1 -0
- package/dist/api/discountPlanSubs.js +69 -0
- package/dist/api/index.d.ts +6 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +12 -2
- package/dist/api/payments.d.ts +49 -0
- package/dist/api/payments.d.ts.map +1 -0
- package/dist/api/payments.js +69 -0
- package/dist/openDental.d.ts +17 -2
- package/dist/openDental.d.ts.map +1 -1
- package/dist/openDental.js +32 -2
- package/dist/types/definitionTypes.d.ts +23 -0
- package/dist/types/definitionTypes.d.ts.map +1 -0
- package/dist/types/definitionTypes.js +2 -0
- package/dist/types/discountPlanSubTypes.d.ts +43 -0
- package/dist/types/discountPlanSubTypes.d.ts.map +1 -0
- package/dist/types/discountPlanSubTypes.js +2 -0
- package/dist/types/paymentTypes.d.ts +67 -0
- package/dist/types/paymentTypes.d.ts.map +1 -0
- package/dist/types/paymentTypes.js +2 -0
- package/dist/types/scheduleTypes.d.ts +2 -2
- package/package.json +3 -3
- package/src/api/definitions.ts +35 -0
- package/src/api/discountPlanSubs.ts +86 -0
- package/src/api/index.ts +6 -1
- package/src/api/payments.ts +86 -0
- package/src/openDental.ts +34 -2
- package/src/types/definitionTypes.ts +24 -0
- package/src/types/discountPlanSubTypes.ts +46 -0
- package/src/types/paymentTypes.ts +70 -0
- package/src/types/scheduleTypes.ts +10 -10
package/deploy_notes.txt
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { Definition, GetDefinitionsParams } from "../types/definitionTypes";
|
|
3
|
+
export default class Definitions {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch multiple definitinos with optional filtering and pagination.
|
|
8
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
9
|
+
* @param {number} [params.Category] - Filter by category.
|
|
10
|
+
* @param {"true" | "false"} [data.includeHidden="false"] - Optional parameter that defaults to false.
|
|
11
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
12
|
+
* @returns {Promise<Definition[]>} - A list of appointments.
|
|
13
|
+
*/
|
|
14
|
+
getDefinitions({ Category, includeHidden, Offset, }?: GetDefinitionsParams): Promise<Definition[]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/api/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,UAAU,EACV,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIpC;;;;;;;OAOG;IACU,cAAc,CAAC,EACxB,QAAQ,EACR,aAAa,EACb,MAAM,GACP,GAAE,oBAAyB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CASrD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Definitions {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch multiple definitinos with optional filtering and pagination.
|
|
10
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
11
|
+
* @param {number} [params.Category] - Filter by category.
|
|
12
|
+
* @param {"true" | "false"} [data.includeHidden="false"] - Optional parameter that defaults to false.
|
|
13
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
14
|
+
* @returns {Promise<Definition[]>} - A list of appointments.
|
|
15
|
+
*/
|
|
16
|
+
async getDefinitions({ Category, includeHidden, Offset, } = {}) {
|
|
17
|
+
const params = {
|
|
18
|
+
Category,
|
|
19
|
+
includeHidden,
|
|
20
|
+
Offset,
|
|
21
|
+
};
|
|
22
|
+
return this.httpClient.get("/definitions", params);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = Definitions;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { DiscountPlanSub, GetDiscountPlanSubsParams, CreateDiscountPlanSubParams, UpdateDiscountPlanSubParams } from "../types/discountPlanSubTypes";
|
|
3
|
+
export default class DiscountPlanSubs {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch multiple definitinos with optional filtering and pagination.
|
|
8
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
9
|
+
* @param {number} [params.PatNum] - Filter by patient.
|
|
10
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
11
|
+
* @returns {Promise<DiscountPlanSub[]>} - A list of appointments.
|
|
12
|
+
*/
|
|
13
|
+
getDiscountPlanSubs({ PatNum, Offset, }?: GetDiscountPlanSubsParams): Promise<DiscountPlanSub[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new discount plan sub.
|
|
16
|
+
* @param {Object} data - The details of the procedure log to create.
|
|
17
|
+
* @param {number} data.DiscountPlanNum - Required: FK to discount plan.
|
|
18
|
+
* @param {number} data.PatNum - Required: Patient number.
|
|
19
|
+
* @param {number} data.DateEffective - Optional: Patient number.
|
|
20
|
+
* @param {number} data.DateTerm - Optional: Patient number.
|
|
21
|
+
* @param {number} data.SubNote - Optional: Patient number.
|
|
22
|
+
* @returns {Promise<DiscountPlanSub>} - The created discount plan sub.
|
|
23
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
24
|
+
*/
|
|
25
|
+
createDiscountPlanSub(data: CreateDiscountPlanSubParams): Promise<DiscountPlanSub>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new procedure log entry.
|
|
28
|
+
* @param {Object} data - The details of the procedure log to create.
|
|
29
|
+
* @param {number} data.DiscountSubNum - Required: PK
|
|
30
|
+
* @param {number} data.PatNum - Required: Patient number.
|
|
31
|
+
* @param {number} data.DateEffective - Optional: Patient number.
|
|
32
|
+
* @param {number} data.DateTerm - Optional: Patient number.
|
|
33
|
+
* @param {number} data.SubNote - Optional: Patient number.
|
|
34
|
+
* @returns {Promise<DiscountPlanSub>} - The created procedure log.
|
|
35
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
36
|
+
*/
|
|
37
|
+
updateDiscountPlanSub(data: UpdateDiscountPlanSubParams): Promise<DiscountPlanSub>;
|
|
38
|
+
/**
|
|
39
|
+
* Delete a discount plan sub entry.
|
|
40
|
+
* @param {number} DiscountSubNum - Required: The unique identifier of the discount plan sub to delete.
|
|
41
|
+
* @returns {Promise<void>} - Resolves when the discount plan sub is deleted.
|
|
42
|
+
* @throws {Error} - If `DiscountSubNum` is not valid or the API returns an error.
|
|
43
|
+
*/
|
|
44
|
+
deleteDiscountPlanSub(DiscountSubNum: number): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=discountPlanSubs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discountPlanSubs.d.ts","sourceRoot":"","sources":["../../src/api/discountPlanSubs.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;;OAMG;IACU,mBAAmB,CAAC,EAC/B,MAAM,EACN,MAAM,GACP,GAAE,yBAA8B,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAS9D;;;;;;;;;;OAUG;IACU,qBAAqB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,eAAe,CAAC;IAQ/F;;;;;;;;;;OAUG;IACU,qBAAqB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,eAAe,CAAC;IAQ/F;;;;;OAKG;IACU,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO1E"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class DiscountPlanSubs {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch multiple definitinos with optional filtering and pagination.
|
|
10
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
11
|
+
* @param {number} [params.PatNum] - Filter by patient.
|
|
12
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
13
|
+
* @returns {Promise<DiscountPlanSub[]>} - A list of appointments.
|
|
14
|
+
*/
|
|
15
|
+
async getDiscountPlanSubs({ PatNum, Offset, } = {}) {
|
|
16
|
+
const params = {
|
|
17
|
+
PatNum,
|
|
18
|
+
Offset,
|
|
19
|
+
};
|
|
20
|
+
return this.httpClient.get("/discountplansubs", params);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a new discount plan sub.
|
|
24
|
+
* @param {Object} data - The details of the procedure log to create.
|
|
25
|
+
* @param {number} data.DiscountPlanNum - Required: FK to discount plan.
|
|
26
|
+
* @param {number} data.PatNum - Required: Patient number.
|
|
27
|
+
* @param {number} data.DateEffective - Optional: Patient number.
|
|
28
|
+
* @param {number} data.DateTerm - Optional: Patient number.
|
|
29
|
+
* @param {number} data.SubNote - Optional: Patient number.
|
|
30
|
+
* @returns {Promise<DiscountPlanSub>} - The created discount plan sub.
|
|
31
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
32
|
+
*/
|
|
33
|
+
async createDiscountPlanSub(data) {
|
|
34
|
+
if (!data.DiscountPlanNum || !data.PatNum) {
|
|
35
|
+
throw new Error("Invalid data: DiscountPlanNum and PatNum are required.");
|
|
36
|
+
}
|
|
37
|
+
return this.httpClient.post("/discountplansubs", data);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a new procedure log entry.
|
|
41
|
+
* @param {Object} data - The details of the procedure log to create.
|
|
42
|
+
* @param {number} data.DiscountSubNum - Required: PK
|
|
43
|
+
* @param {number} data.PatNum - Required: Patient number.
|
|
44
|
+
* @param {number} data.DateEffective - Optional: Patient number.
|
|
45
|
+
* @param {number} data.DateTerm - Optional: Patient number.
|
|
46
|
+
* @param {number} data.SubNote - Optional: Patient number.
|
|
47
|
+
* @returns {Promise<DiscountPlanSub>} - The created procedure log.
|
|
48
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
49
|
+
*/
|
|
50
|
+
async updateDiscountPlanSub(data) {
|
|
51
|
+
if (!data.DiscountSubNum || !data.PatNum) {
|
|
52
|
+
throw new Error("Invalid data: DiscountSubNum and PatNum are required.");
|
|
53
|
+
}
|
|
54
|
+
return this.httpClient.put(`/discountplansubs/${data.DiscountSubNum}`, data);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Delete a discount plan sub entry.
|
|
58
|
+
* @param {number} DiscountSubNum - Required: The unique identifier of the discount plan sub to delete.
|
|
59
|
+
* @returns {Promise<void>} - Resolves when the discount plan sub is deleted.
|
|
60
|
+
* @throws {Error} - If `DiscountSubNum` is not valid or the API returns an error.
|
|
61
|
+
*/
|
|
62
|
+
async deleteDiscountPlanSub(DiscountSubNum) {
|
|
63
|
+
if (!DiscountSubNum || typeof DiscountSubNum !== "number") {
|
|
64
|
+
throw new Error("Invalid parameter: ProcNum must be a valid number.");
|
|
65
|
+
}
|
|
66
|
+
return this.httpClient.delete(`/discountplansubs/${DiscountSubNum}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = DiscountPlanSubs;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -6,5 +6,10 @@ 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
|
|
9
|
+
export { default as Schedules } from "./schedules";
|
|
10
|
+
export { default as Providers } from "./providers";
|
|
11
|
+
export { default as Operatories } from "./operatories";
|
|
12
|
+
export { default as Payments } from "./payments";
|
|
13
|
+
export { default as Definitions } from "./definitions";
|
|
14
|
+
export { default as DiscountPlanSubs } from "./discountPlanSubs";
|
|
10
15
|
//# 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;AACzD,OAAO,EAAE,OAAO,IAAI,
|
|
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,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,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.
|
|
6
|
+
exports.DiscountPlanSubs = exports.Definitions = exports.Payments = exports.Operatories = exports.Providers = exports.Schedules = 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");
|
|
@@ -21,5 +21,15 @@ Object.defineProperty(exports, "Recalls", { enumerable: true, get: function () {
|
|
|
21
21
|
var treatplans_1 = require("./treatplans");
|
|
22
22
|
Object.defineProperty(exports, "TreatmentPlans", { enumerable: true, get: function () { return __importDefault(treatplans_1).default; } });
|
|
23
23
|
var schedules_1 = require("./schedules");
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "Schedules", { enumerable: true, get: function () { return __importDefault(schedules_1).default; } });
|
|
25
|
+
var providers_1 = require("./providers");
|
|
26
|
+
Object.defineProperty(exports, "Providers", { enumerable: true, get: function () { return __importDefault(providers_1).default; } });
|
|
27
|
+
var operatories_1 = require("./operatories");
|
|
28
|
+
Object.defineProperty(exports, "Operatories", { enumerable: true, get: function () { return __importDefault(operatories_1).default; } });
|
|
29
|
+
var payments_1 = require("./payments");
|
|
30
|
+
Object.defineProperty(exports, "Payments", { enumerable: true, get: function () { return __importDefault(payments_1).default; } });
|
|
31
|
+
var definitions_1 = require("./definitions");
|
|
32
|
+
Object.defineProperty(exports, "Definitions", { enumerable: true, get: function () { return __importDefault(definitions_1).default; } });
|
|
33
|
+
var discountPlanSubs_1 = require("./discountPlanSubs");
|
|
34
|
+
Object.defineProperty(exports, "DiscountPlanSubs", { enumerable: true, get: function () { return __importDefault(discountPlanSubs_1).default; } });
|
|
25
35
|
// Add other APIs as needed
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { Payment, GetPaymentsParams, CreatePaymentParams, UpdatePaymentParams } from "../types/paymentTypes";
|
|
3
|
+
export default class Payments {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch multiple payments with optional filtering and pagination.
|
|
8
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
9
|
+
* @param {number} [params.PayType] - Filter by PayType, definition.DefNum where definition.Category=10.
|
|
10
|
+
* @param {number} [params.PatNum] - FK to patient.PatNum.
|
|
11
|
+
* @param {string} [params.DateEntry] - String in "yyyy-MM-dd" format. Gets all payments made on or after a certain date.
|
|
12
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
13
|
+
* @returns {Promise<Payment[]>} - A list of payments.
|
|
14
|
+
*/
|
|
15
|
+
getPayments({ PayType, PatNum, DateEntry, Offset, }?: GetPaymentsParams): Promise<Payment[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Create a payment.
|
|
18
|
+
* @param {Object} data - Data for the new appointment.
|
|
19
|
+
* @param {string} data.PayAmt - Required: String amount of payment as 0.00 (float.toString())
|
|
20
|
+
* @param {number} data.PatNum - Required: FK to Patient
|
|
21
|
+
* @param {string} data.PayType - Optional: definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
22
|
+
* @param {string} [data.PayDate] - Optional. String in "yyyy-MM-dd" format. Defaults to today's date. Follows the office's preference to allow future-dated payments.
|
|
23
|
+
* @param {string} [data.CheckNum] - Optional.
|
|
24
|
+
* @param {string} [data.PayNote] - Optional.
|
|
25
|
+
* @param {string} [data.BankBranch] - Optional.
|
|
26
|
+
* @param {string} [data.ClinicNum] - Optional: Defaults to patient.ClinicNum
|
|
27
|
+
* @param {"true" | "false"} [data.isPatientPreferred="false"] - Optional. When entering a payment through Open Dental directly, there is a checkbox for this option. This API field allows the same functionality. It causes the splits to go to the patient instead of being split among family members on a FIFO basis. Default "false".
|
|
28
|
+
* @param {"true" | "false"} [data.isPrepayment="false"] - Optional. Creates a single paysplit using the default unearned type for unallocated paysplits stored in the PrepaymentUnearnedType preference. See also Unearned / Prepayment. Default "false".
|
|
29
|
+
* @param {number[]} [data.procNums=[]] - Optional. An array of ProcNums, in [1,2,3] format to apply this Payment to. Procedures are paid by Procedure.ProcDate on a FIFO basis. Procedures not in the Patient's family will be silently ignored. Ignored if isPrepayment is set to "true". Default is an empty array.
|
|
30
|
+
* @param {number} [data.payPlanNum=0] - Optional. FK to payplan.PayPlanNum for a Dynamic Payment Plan. Only allowed if isPrepayment is "true" prior to version 23.3.4. Default 0.
|
|
31
|
+
* @returns {Promise<Payment>} - The created payment.
|
|
32
|
+
* @throws {Error} - If required fields are missing.
|
|
33
|
+
*/
|
|
34
|
+
createPayment(data: CreatePaymentParams): Promise<Payment>;
|
|
35
|
+
/**
|
|
36
|
+
* Update a payment.
|
|
37
|
+
* @param {Object} data - Data for the new appointment.
|
|
38
|
+
* @param {string} data.PayNum - Required: PK of Payment to update.
|
|
39
|
+
* @param {string} data.PayType - Optional: definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
40
|
+
* @param {string} [data.CheckNum] - Optional.
|
|
41
|
+
* @param {string} [data.PayNote] - Optional.
|
|
42
|
+
* @param {string} [data.BankBranch] - Optional.
|
|
43
|
+
* @param {"OnlineProcessed" | "OnlinePending"} [data.ProcessStatus] - Indicates whether a payment came from in office or online, and if the online payment is processed or pending. Either "OnlineProcessed" or "OnlinePending".
|
|
44
|
+
* @returns {Promise<Payment>} - The updated payment.
|
|
45
|
+
* @throws {Error} - If required fields are missing.
|
|
46
|
+
*/
|
|
47
|
+
updatePayment(data: UpdatePaymentParams): Promise<Payment>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/api/payments.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIpC;;;;;;;;OAQG;IACU,WAAW,CAAC,EACrB,OAAO,EACP,MAAM,EACN,SAAS,EACT,MAAM,GACP,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAW9C;;;;;;;;;;;;;;;;;OAiBG;IACY,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAQzE;;;;;;;;;;;OAWG;IACU,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAOxE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Payments {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch multiple payments with optional filtering and pagination.
|
|
10
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
11
|
+
* @param {number} [params.PayType] - Filter by PayType, definition.DefNum where definition.Category=10.
|
|
12
|
+
* @param {number} [params.PatNum] - FK to patient.PatNum.
|
|
13
|
+
* @param {string} [params.DateEntry] - String in "yyyy-MM-dd" format. Gets all payments made on or after a certain date.
|
|
14
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
15
|
+
* @returns {Promise<Payment[]>} - A list of payments.
|
|
16
|
+
*/
|
|
17
|
+
async getPayments({ PayType, PatNum, DateEntry, Offset, } = {}) {
|
|
18
|
+
const params = {
|
|
19
|
+
PayType,
|
|
20
|
+
PatNum,
|
|
21
|
+
DateEntry,
|
|
22
|
+
Offset,
|
|
23
|
+
};
|
|
24
|
+
return this.httpClient.get("/payments", params);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a payment.
|
|
28
|
+
* @param {Object} data - Data for the new appointment.
|
|
29
|
+
* @param {string} data.PayAmt - Required: String amount of payment as 0.00 (float.toString())
|
|
30
|
+
* @param {number} data.PatNum - Required: FK to Patient
|
|
31
|
+
* @param {string} data.PayType - Optional: definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
32
|
+
* @param {string} [data.PayDate] - Optional. String in "yyyy-MM-dd" format. Defaults to today's date. Follows the office's preference to allow future-dated payments.
|
|
33
|
+
* @param {string} [data.CheckNum] - Optional.
|
|
34
|
+
* @param {string} [data.PayNote] - Optional.
|
|
35
|
+
* @param {string} [data.BankBranch] - Optional.
|
|
36
|
+
* @param {string} [data.ClinicNum] - Optional: Defaults to patient.ClinicNum
|
|
37
|
+
* @param {"true" | "false"} [data.isPatientPreferred="false"] - Optional. When entering a payment through Open Dental directly, there is a checkbox for this option. This API field allows the same functionality. It causes the splits to go to the patient instead of being split among family members on a FIFO basis. Default "false".
|
|
38
|
+
* @param {"true" | "false"} [data.isPrepayment="false"] - Optional. Creates a single paysplit using the default unearned type for unallocated paysplits stored in the PrepaymentUnearnedType preference. See also Unearned / Prepayment. Default "false".
|
|
39
|
+
* @param {number[]} [data.procNums=[]] - Optional. An array of ProcNums, in [1,2,3] format to apply this Payment to. Procedures are paid by Procedure.ProcDate on a FIFO basis. Procedures not in the Patient's family will be silently ignored. Ignored if isPrepayment is set to "true". Default is an empty array.
|
|
40
|
+
* @param {number} [data.payPlanNum=0] - Optional. FK to payplan.PayPlanNum for a Dynamic Payment Plan. Only allowed if isPrepayment is "true" prior to version 23.3.4. Default 0.
|
|
41
|
+
* @returns {Promise<Payment>} - The created payment.
|
|
42
|
+
* @throws {Error} - If required fields are missing.
|
|
43
|
+
*/
|
|
44
|
+
async createPayment(data) {
|
|
45
|
+
if (!data.PayAmt || !data.PatNum) {
|
|
46
|
+
throw new Error("PayAmt and PatNum are required.");
|
|
47
|
+
}
|
|
48
|
+
return this.httpClient.post("/payments", data);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Update a payment.
|
|
52
|
+
* @param {Object} data - Data for the new appointment.
|
|
53
|
+
* @param {string} data.PayNum - Required: PK of Payment to update.
|
|
54
|
+
* @param {string} data.PayType - Optional: definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
55
|
+
* @param {string} [data.CheckNum] - Optional.
|
|
56
|
+
* @param {string} [data.PayNote] - Optional.
|
|
57
|
+
* @param {string} [data.BankBranch] - Optional.
|
|
58
|
+
* @param {"OnlineProcessed" | "OnlinePending"} [data.ProcessStatus] - Indicates whether a payment came from in office or online, and if the online payment is processed or pending. Either "OnlineProcessed" or "OnlinePending".
|
|
59
|
+
* @returns {Promise<Payment>} - The updated payment.
|
|
60
|
+
* @throws {Error} - If required fields are missing.
|
|
61
|
+
*/
|
|
62
|
+
async updatePayment(data) {
|
|
63
|
+
if (!data.PayNum) {
|
|
64
|
+
throw new Error("PayNum is required.");
|
|
65
|
+
}
|
|
66
|
+
return this.httpClient.put(`/payments/${data.PayNum}`, data);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = Payments;
|
package/dist/openDental.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ import TreatmentPlans from "./api/treatplans";
|
|
|
9
9
|
import Schedules from "./api/schedules";
|
|
10
10
|
import Providers from "./api/providers";
|
|
11
11
|
import Operatories from "./api/operatories";
|
|
12
|
+
import Payments from "./api/payments";
|
|
13
|
+
import Definitions from "./api/definitions";
|
|
14
|
+
import DiscountPlanSubs from "./api/discountPlanSubs";
|
|
12
15
|
declare class OpenDental {
|
|
13
16
|
private static httpClient;
|
|
14
17
|
/**
|
|
@@ -52,13 +55,25 @@ declare class OpenDental {
|
|
|
52
55
|
*/
|
|
53
56
|
static Schedules(): Schedules;
|
|
54
57
|
/**
|
|
55
|
-
* Create a new instance of the
|
|
58
|
+
* Create a new instance of the Providers API.
|
|
56
59
|
*/
|
|
57
60
|
static Providers(): Providers;
|
|
58
61
|
/**
|
|
59
|
-
* Create a new instance of the
|
|
62
|
+
* Create a new instance of the Operatories API.
|
|
60
63
|
*/
|
|
61
64
|
static Operatories(): Operatories;
|
|
65
|
+
/**
|
|
66
|
+
* Create a new instance of the Payments API.
|
|
67
|
+
*/
|
|
68
|
+
static Payments(): Payments;
|
|
69
|
+
/**
|
|
70
|
+
* Create a new instance of the Definitions API.
|
|
71
|
+
*/
|
|
72
|
+
static Definitions(): Definitions;
|
|
73
|
+
/**
|
|
74
|
+
* Create a new instance of the DiscountPlanSubs API.
|
|
75
|
+
*/
|
|
76
|
+
static DiscountPlanSubs(): DiscountPlanSubs;
|
|
62
77
|
}
|
|
63
78
|
export { OpenDental };
|
|
64
79
|
//# 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;AAC9C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,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;AACxC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AAEtD,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;IAO5B;;OAEG;WACa,SAAS;IAOzB;;OAEG;WACa,SAAS;IAOzB;;OAEG;WACa,WAAW;IAO3B;;OAEG;WACa,QAAQ;IAOxB;;OAEG;WACW,WAAW;IAMzB;;OAEG;WACW,gBAAgB;CAM/B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/openDental.js
CHANGED
|
@@ -16,6 +16,9 @@ const treatplans_1 = __importDefault(require("./api/treatplans"));
|
|
|
16
16
|
const schedules_1 = __importDefault(require("./api/schedules"));
|
|
17
17
|
const providers_1 = __importDefault(require("./api/providers"));
|
|
18
18
|
const operatories_1 = __importDefault(require("./api/operatories"));
|
|
19
|
+
const payments_1 = __importDefault(require("./api/payments"));
|
|
20
|
+
const definitions_1 = __importDefault(require("./api/definitions"));
|
|
21
|
+
const discountPlanSubs_1 = __importDefault(require("./api/discountPlanSubs"));
|
|
19
22
|
class OpenDental {
|
|
20
23
|
static httpClient;
|
|
21
24
|
/**
|
|
@@ -111,7 +114,7 @@ class OpenDental {
|
|
|
111
114
|
return new schedules_1.default(this.httpClient);
|
|
112
115
|
}
|
|
113
116
|
/**
|
|
114
|
-
* Create a new instance of the
|
|
117
|
+
* Create a new instance of the Providers API.
|
|
115
118
|
*/
|
|
116
119
|
static Providers() {
|
|
117
120
|
if (!this.httpClient) {
|
|
@@ -120,7 +123,7 @@ class OpenDental {
|
|
|
120
123
|
return new providers_1.default(this.httpClient);
|
|
121
124
|
}
|
|
122
125
|
/**
|
|
123
|
-
* Create a new instance of the
|
|
126
|
+
* Create a new instance of the Operatories API.
|
|
124
127
|
*/
|
|
125
128
|
static Operatories() {
|
|
126
129
|
if (!this.httpClient) {
|
|
@@ -128,5 +131,32 @@ class OpenDental {
|
|
|
128
131
|
}
|
|
129
132
|
return new operatories_1.default(this.httpClient);
|
|
130
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a new instance of the Payments API.
|
|
136
|
+
*/
|
|
137
|
+
static Payments() {
|
|
138
|
+
if (!this.httpClient) {
|
|
139
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
140
|
+
}
|
|
141
|
+
return new payments_1.default(this.httpClient);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Create a new instance of the Definitions API.
|
|
145
|
+
*/
|
|
146
|
+
static Definitions() {
|
|
147
|
+
if (!this.httpClient) {
|
|
148
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
149
|
+
}
|
|
150
|
+
return new definitions_1.default(this.httpClient);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Create a new instance of the DiscountPlanSubs API.
|
|
154
|
+
*/
|
|
155
|
+
static DiscountPlanSubs() {
|
|
156
|
+
if (!this.httpClient) {
|
|
157
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
158
|
+
}
|
|
159
|
+
return new discountPlanSubs_1.default(this.httpClient);
|
|
160
|
+
}
|
|
131
161
|
}
|
|
132
162
|
exports.OpenDental = OpenDental;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a definition in the Open Dental system.
|
|
3
|
+
* Used in multiple definition-related endpoints.
|
|
4
|
+
* @see https://www.opendental.com/site/apidefinitions.html
|
|
5
|
+
*/
|
|
6
|
+
export interface Definition {
|
|
7
|
+
DefNum?: number;
|
|
8
|
+
ItemName?: string;
|
|
9
|
+
ItemValue?: string;
|
|
10
|
+
Category?: number;
|
|
11
|
+
category?: string;
|
|
12
|
+
isHidden?: 'true' | 'false';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parameters for GET Definitions.
|
|
16
|
+
* @see https://www.opendental.com/site/apidefinitions.html
|
|
17
|
+
*/
|
|
18
|
+
export interface GetDefinitionsParams {
|
|
19
|
+
Category?: number;
|
|
20
|
+
includeHidden?: 'true' | 'false';
|
|
21
|
+
Offset?: number;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=definitionTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitionTypes.d.ts","sourceRoot":"","sources":["../../src/types/definitionTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a subscription to a discount plan in the Open Dental system.
|
|
3
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
4
|
+
*/
|
|
5
|
+
export interface DiscountPlanSub {
|
|
6
|
+
DiscountSubNum?: number;
|
|
7
|
+
DiscountPlanNum?: number;
|
|
8
|
+
PatNum?: number;
|
|
9
|
+
DateEffective?: string;
|
|
10
|
+
DateTerm?: string;
|
|
11
|
+
SubNote?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for GET discount plan subs.
|
|
15
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
16
|
+
*/
|
|
17
|
+
export interface GetDiscountPlanSubsParams {
|
|
18
|
+
PatNum?: number;
|
|
19
|
+
Offset?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parameters for creating a discount plan sub.
|
|
23
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
24
|
+
*/
|
|
25
|
+
export interface CreateDiscountPlanSubParams {
|
|
26
|
+
PatNum: number;
|
|
27
|
+
DiscountPlanNum: number;
|
|
28
|
+
DateEffective?: string;
|
|
29
|
+
DateTerm?: string;
|
|
30
|
+
SubNote?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parameters for updating a discount plan sub.
|
|
34
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
35
|
+
*/
|
|
36
|
+
export interface UpdateDiscountPlanSubParams {
|
|
37
|
+
DiscountSubNum: number;
|
|
38
|
+
PatNum: string;
|
|
39
|
+
DateEffective?: string;
|
|
40
|
+
DateTerm?: string;
|
|
41
|
+
SubNote?: string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=discountPlanSubTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discountPlanSubTypes.d.ts","sourceRoot":"","sources":["../../src/types/discountPlanSubTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an appointment in the Open Dental system.
|
|
3
|
+
* Used in multiple appointment-related endpoints.
|
|
4
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
5
|
+
*/
|
|
6
|
+
export interface Payment {
|
|
7
|
+
PayNum?: number;
|
|
8
|
+
PayType?: number;
|
|
9
|
+
payType?: string;
|
|
10
|
+
PayDate?: string;
|
|
11
|
+
PayAmt?: string;
|
|
12
|
+
CheckNum?: string;
|
|
13
|
+
BankBranch?: string;
|
|
14
|
+
PayNote?: string;
|
|
15
|
+
PatNum?: number;
|
|
16
|
+
ClinicNum?: string;
|
|
17
|
+
DateEntry?: string;
|
|
18
|
+
DepositNum?: number;
|
|
19
|
+
Receipt?: string;
|
|
20
|
+
IsRecurringCC?: 'true' | 'false';
|
|
21
|
+
PaymentSource?: string;
|
|
22
|
+
ProcessStatus?: string;
|
|
23
|
+
RecurringChargeDate?: string;
|
|
24
|
+
IsCcCompleted?: 'true' | 'false';
|
|
25
|
+
serverDateTime?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parameters for GET Payments.
|
|
29
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
30
|
+
*/
|
|
31
|
+
export interface GetPaymentsParams {
|
|
32
|
+
PayType?: number;
|
|
33
|
+
PatNum?: number;
|
|
34
|
+
DateEntry?: string;
|
|
35
|
+
Offset?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parameters for creating a payment.
|
|
39
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
40
|
+
*/
|
|
41
|
+
export interface CreatePaymentParams {
|
|
42
|
+
PatNum: number;
|
|
43
|
+
PayAmt: string;
|
|
44
|
+
PayType?: number;
|
|
45
|
+
PayDate?: string;
|
|
46
|
+
CheckNum?: string;
|
|
47
|
+
PayNote?: string;
|
|
48
|
+
BankBranch?: string;
|
|
49
|
+
ClinicNum?: string;
|
|
50
|
+
isPatientPreferred?: 'true' | 'false';
|
|
51
|
+
isPrepayment?: 'true' | 'false';
|
|
52
|
+
procNums?: number[];
|
|
53
|
+
payPlanNum?: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Parameters for updating a payment.
|
|
57
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
58
|
+
*/
|
|
59
|
+
export interface UpdatePaymentParams {
|
|
60
|
+
PayNum: number;
|
|
61
|
+
PayType?: number;
|
|
62
|
+
CheckNum?: string;
|
|
63
|
+
BankBranch?: string;
|
|
64
|
+
PayNote?: string;
|
|
65
|
+
ProcessStatus?: 'OnlineProcessed' | 'OnlinePending';
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=paymentTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymentTypes.d.ts","sourceRoot":"","sources":["../../src/types/paymentTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAG,iBAAiB,GAAG,eAAe,CAAC;CACtD"}
|
|
@@ -8,7 +8,7 @@ export interface Schedule {
|
|
|
8
8
|
StartTime?: string;
|
|
9
9
|
StopTime?: string;
|
|
10
10
|
SchedType?: "Practice" | "Provider" | "Blockout" | "Employee" | "WebSchedASAP";
|
|
11
|
-
ProvNum?:
|
|
11
|
+
ProvNum?: string;
|
|
12
12
|
BlockoutType?: string;
|
|
13
13
|
blockoutType?: string;
|
|
14
14
|
Note?: string;
|
|
@@ -16,7 +16,7 @@ export interface Schedule {
|
|
|
16
16
|
EmployeeNum?: string;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Parameters for fetching
|
|
19
|
+
* Parameters for fetching schedule records;
|
|
20
20
|
* @see https://www.opendental.com/site/apischedules.html
|
|
21
21
|
*/
|
|
22
22
|
export interface GetSchedulesParams {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rinse-dental/open-dental",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A TypeScript library for easily accessing Open Dental APIs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"url": "git+https://github.com/getrinsed/open-dental.git"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"axios": "^1.7.
|
|
19
|
-
"moment-timezone": "^0.5.
|
|
18
|
+
"axios": "^1.7.9",
|
|
19
|
+
"moment-timezone": "^0.5.47"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/jest": "^29.5.14",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Definition,
|
|
4
|
+
GetDefinitionsParams,
|
|
5
|
+
} from "../types/definitionTypes";
|
|
6
|
+
|
|
7
|
+
export default class Definitions {
|
|
8
|
+
private httpClient: HttpClient;
|
|
9
|
+
|
|
10
|
+
constructor(httpClient: HttpClient) {
|
|
11
|
+
this.httpClient = httpClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Fetch multiple definitinos with optional filtering and pagination.
|
|
16
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
17
|
+
* @param {number} [params.Category] - Filter by category.
|
|
18
|
+
* @param {"true" | "false"} [data.includeHidden="false"] - Optional parameter that defaults to false.
|
|
19
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
20
|
+
* @returns {Promise<Definition[]>} - A list of appointments.
|
|
21
|
+
*/
|
|
22
|
+
public async getDefinitions({
|
|
23
|
+
Category,
|
|
24
|
+
includeHidden,
|
|
25
|
+
Offset,
|
|
26
|
+
}: GetDefinitionsParams = {}): Promise<Definition[]> {
|
|
27
|
+
const params = {
|
|
28
|
+
Category,
|
|
29
|
+
includeHidden,
|
|
30
|
+
Offset,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return this.httpClient.get<Definition[]>("/definitions", params);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
DiscountPlanSub,
|
|
4
|
+
GetDiscountPlanSubsParams,
|
|
5
|
+
CreateDiscountPlanSubParams,
|
|
6
|
+
UpdateDiscountPlanSubParams,
|
|
7
|
+
} from "../types/discountPlanSubTypes";
|
|
8
|
+
|
|
9
|
+
export default class DiscountPlanSubs {
|
|
10
|
+
private httpClient: HttpClient;
|
|
11
|
+
|
|
12
|
+
constructor(httpClient: HttpClient) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch multiple definitinos with optional filtering and pagination.
|
|
18
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
19
|
+
* @param {number} [params.PatNum] - Filter by patient.
|
|
20
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
21
|
+
* @returns {Promise<DiscountPlanSub[]>} - A list of appointments.
|
|
22
|
+
*/
|
|
23
|
+
public async getDiscountPlanSubs({
|
|
24
|
+
PatNum,
|
|
25
|
+
Offset,
|
|
26
|
+
}: GetDiscountPlanSubsParams = {}): Promise<DiscountPlanSub[]> {
|
|
27
|
+
const params = {
|
|
28
|
+
PatNum,
|
|
29
|
+
Offset,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return this.httpClient.get<DiscountPlanSub[]>("/discountplansubs", params);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create a new discount plan sub.
|
|
37
|
+
* @param {Object} data - The details of the procedure log to create.
|
|
38
|
+
* @param {number} data.DiscountPlanNum - Required: FK to discount plan.
|
|
39
|
+
* @param {number} data.PatNum - Required: Patient number.
|
|
40
|
+
* @param {number} data.DateEffective - Optional: Patient number.
|
|
41
|
+
* @param {number} data.DateTerm - Optional: Patient number.
|
|
42
|
+
* @param {number} data.SubNote - Optional: Patient number.
|
|
43
|
+
* @returns {Promise<DiscountPlanSub>} - The created discount plan sub.
|
|
44
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
45
|
+
*/
|
|
46
|
+
public async createDiscountPlanSub(data: CreateDiscountPlanSubParams): Promise<DiscountPlanSub> {
|
|
47
|
+
if (!data.DiscountPlanNum || !data.PatNum) {
|
|
48
|
+
throw new Error("Invalid data: DiscountPlanNum and PatNum are required.");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return this.httpClient.post<DiscountPlanSub>("/discountplansubs", data);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Create a new procedure log entry.
|
|
56
|
+
* @param {Object} data - The details of the procedure log to create.
|
|
57
|
+
* @param {number} data.DiscountSubNum - Required: PK
|
|
58
|
+
* @param {number} data.PatNum - Required: Patient number.
|
|
59
|
+
* @param {number} data.DateEffective - Optional: Patient number.
|
|
60
|
+
* @param {number} data.DateTerm - Optional: Patient number.
|
|
61
|
+
* @param {number} data.SubNote - Optional: Patient number.
|
|
62
|
+
* @returns {Promise<DiscountPlanSub>} - The created procedure log.
|
|
63
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
64
|
+
*/
|
|
65
|
+
public async updateDiscountPlanSub(data: UpdateDiscountPlanSubParams): Promise<DiscountPlanSub> {
|
|
66
|
+
if (!data.DiscountSubNum || !data.PatNum) {
|
|
67
|
+
throw new Error("Invalid data: DiscountSubNum and PatNum are required.");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return this.httpClient.put<DiscountPlanSub>(`/discountplansubs/${data.DiscountSubNum}`, data);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Delete a discount plan sub entry.
|
|
75
|
+
* @param {number} DiscountSubNum - Required: The unique identifier of the discount plan sub to delete.
|
|
76
|
+
* @returns {Promise<void>} - Resolves when the discount plan sub is deleted.
|
|
77
|
+
* @throws {Error} - If `DiscountSubNum` is not valid or the API returns an error.
|
|
78
|
+
*/
|
|
79
|
+
public async deleteDiscountPlanSub(DiscountSubNum: number): Promise<void> {
|
|
80
|
+
if (!DiscountSubNum || typeof DiscountSubNum !== "number") {
|
|
81
|
+
throw new Error("Invalid parameter: ProcNum must be a valid number.");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return this.httpClient.delete<void>(`/discountplansubs/${DiscountSubNum}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
package/src/api/index.ts
CHANGED
|
@@ -6,5 +6,10 @@ 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
|
|
9
|
+
export { default as Schedules } from "./schedules";
|
|
10
|
+
export { default as Providers } from "./providers";
|
|
11
|
+
export { default as Operatories } from "./operatories";
|
|
12
|
+
export { default as Payments } from "./payments";
|
|
13
|
+
export { default as Definitions } from "./definitions";
|
|
14
|
+
export { default as DiscountPlanSubs } from "./discountPlanSubs";
|
|
10
15
|
// Add other APIs as needed
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Payment,
|
|
4
|
+
GetPaymentsParams,
|
|
5
|
+
CreatePaymentParams,
|
|
6
|
+
UpdatePaymentParams,
|
|
7
|
+
} from "../types/paymentTypes";
|
|
8
|
+
|
|
9
|
+
export default class Payments {
|
|
10
|
+
private httpClient: HttpClient;
|
|
11
|
+
|
|
12
|
+
constructor(httpClient: HttpClient) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch multiple payments with optional filtering and pagination.
|
|
18
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
19
|
+
* @param {number} [params.PayType] - Filter by PayType, definition.DefNum where definition.Category=10.
|
|
20
|
+
* @param {number} [params.PatNum] - FK to patient.PatNum.
|
|
21
|
+
* @param {string} [params.DateEntry] - String in "yyyy-MM-dd" format. Gets all payments made on or after a certain date.
|
|
22
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
23
|
+
* @returns {Promise<Payment[]>} - A list of payments.
|
|
24
|
+
*/
|
|
25
|
+
public async getPayments({
|
|
26
|
+
PayType,
|
|
27
|
+
PatNum,
|
|
28
|
+
DateEntry,
|
|
29
|
+
Offset,
|
|
30
|
+
}: GetPaymentsParams = {}): Promise<Payment[]> {
|
|
31
|
+
const params = {
|
|
32
|
+
PayType,
|
|
33
|
+
PatNum,
|
|
34
|
+
DateEntry,
|
|
35
|
+
Offset,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return this.httpClient.get<Payment[]>("/payments", params);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Create a payment.
|
|
43
|
+
* @param {Object} data - Data for the new appointment.
|
|
44
|
+
* @param {string} data.PayAmt - Required: String amount of payment as 0.00 (float.toString())
|
|
45
|
+
* @param {number} data.PatNum - Required: FK to Patient
|
|
46
|
+
* @param {string} data.PayType - Optional: definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
47
|
+
* @param {string} [data.PayDate] - Optional. String in "yyyy-MM-dd" format. Defaults to today's date. Follows the office's preference to allow future-dated payments.
|
|
48
|
+
* @param {string} [data.CheckNum] - Optional.
|
|
49
|
+
* @param {string} [data.PayNote] - Optional.
|
|
50
|
+
* @param {string} [data.BankBranch] - Optional.
|
|
51
|
+
* @param {string} [data.ClinicNum] - Optional: Defaults to patient.ClinicNum
|
|
52
|
+
* @param {"true" | "false"} [data.isPatientPreferred="false"] - Optional. When entering a payment through Open Dental directly, there is a checkbox for this option. This API field allows the same functionality. It causes the splits to go to the patient instead of being split among family members on a FIFO basis. Default "false".
|
|
53
|
+
* @param {"true" | "false"} [data.isPrepayment="false"] - Optional. Creates a single paysplit using the default unearned type for unallocated paysplits stored in the PrepaymentUnearnedType preference. See also Unearned / Prepayment. Default "false".
|
|
54
|
+
* @param {number[]} [data.procNums=[]] - Optional. An array of ProcNums, in [1,2,3] format to apply this Payment to. Procedures are paid by Procedure.ProcDate on a FIFO basis. Procedures not in the Patient's family will be silently ignored. Ignored if isPrepayment is set to "true". Default is an empty array.
|
|
55
|
+
* @param {number} [data.payPlanNum=0] - Optional. FK to payplan.PayPlanNum for a Dynamic Payment Plan. Only allowed if isPrepayment is "true" prior to version 23.3.4. Default 0.
|
|
56
|
+
* @returns {Promise<Payment>} - The created payment.
|
|
57
|
+
* @throws {Error} - If required fields are missing.
|
|
58
|
+
*/
|
|
59
|
+
public async createPayment(data: CreatePaymentParams): Promise<Payment> {
|
|
60
|
+
if (!data.PayAmt || !data.PatNum) {
|
|
61
|
+
throw new Error("PayAmt and PatNum are required.");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return this.httpClient.post<Payment>("/payments", data);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Update a payment.
|
|
69
|
+
* @param {Object} data - Data for the new appointment.
|
|
70
|
+
* @param {string} data.PayNum - Required: PK of Payment to update.
|
|
71
|
+
* @param {string} data.PayType - Optional: definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
72
|
+
* @param {string} [data.CheckNum] - Optional.
|
|
73
|
+
* @param {string} [data.PayNote] - Optional.
|
|
74
|
+
* @param {string} [data.BankBranch] - Optional.
|
|
75
|
+
* @param {"OnlineProcessed" | "OnlinePending"} [data.ProcessStatus] - Indicates whether a payment came from in office or online, and if the online payment is processed or pending. Either "OnlineProcessed" or "OnlinePending".
|
|
76
|
+
* @returns {Promise<Payment>} - The updated payment.
|
|
77
|
+
* @throws {Error} - If required fields are missing.
|
|
78
|
+
*/
|
|
79
|
+
public async updatePayment(data: UpdatePaymentParams): Promise<Payment> {
|
|
80
|
+
if (!data.PayNum) {
|
|
81
|
+
throw new Error("PayNum is required.");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return this.httpClient.put<Payment>(`/payments/${data.PayNum}`, data);
|
|
85
|
+
}
|
|
86
|
+
}
|
package/src/openDental.ts
CHANGED
|
@@ -10,6 +10,9 @@ import TreatmentPlans from "./api/treatplans";
|
|
|
10
10
|
import Schedules from "./api/schedules";
|
|
11
11
|
import Providers from "./api/providers";
|
|
12
12
|
import Operatories from "./api/operatories";
|
|
13
|
+
import Payments from "./api/payments";
|
|
14
|
+
import Definitions from "./api/definitions";
|
|
15
|
+
import DiscountPlanSubs from "./api/discountPlanSubs";
|
|
13
16
|
|
|
14
17
|
class OpenDental {
|
|
15
18
|
private static httpClient: HttpClient;
|
|
@@ -120,7 +123,7 @@ class OpenDental {
|
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
/**
|
|
123
|
-
* Create a new instance of the
|
|
126
|
+
* Create a new instance of the Providers API.
|
|
124
127
|
*/
|
|
125
128
|
public static Providers() {
|
|
126
129
|
if (!this.httpClient) {
|
|
@@ -130,7 +133,7 @@ class OpenDental {
|
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
|
-
* Create a new instance of the
|
|
136
|
+
* Create a new instance of the Operatories API.
|
|
134
137
|
*/
|
|
135
138
|
public static Operatories() {
|
|
136
139
|
if (!this.httpClient) {
|
|
@@ -138,6 +141,35 @@ class OpenDental {
|
|
|
138
141
|
}
|
|
139
142
|
return new Operatories(this.httpClient);
|
|
140
143
|
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Create a new instance of the Payments API.
|
|
147
|
+
*/
|
|
148
|
+
public static Payments() {
|
|
149
|
+
if (!this.httpClient) {
|
|
150
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
151
|
+
}
|
|
152
|
+
return new Payments(this.httpClient);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Create a new instance of the Definitions API.
|
|
157
|
+
*/
|
|
158
|
+
public static Definitions() {
|
|
159
|
+
if (!this.httpClient) {
|
|
160
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
161
|
+
}
|
|
162
|
+
return new Definitions(this.httpClient);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Create a new instance of the DiscountPlanSubs API.
|
|
166
|
+
*/
|
|
167
|
+
public static DiscountPlanSubs() {
|
|
168
|
+
if (!this.httpClient) {
|
|
169
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
170
|
+
}
|
|
171
|
+
return new DiscountPlanSubs(this.httpClient);
|
|
172
|
+
}
|
|
141
173
|
}
|
|
142
174
|
|
|
143
175
|
export { OpenDental };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a definition in the Open Dental system.
|
|
3
|
+
* Used in multiple definition-related endpoints.
|
|
4
|
+
* @see https://www.opendental.com/site/apidefinitions.html
|
|
5
|
+
*/
|
|
6
|
+
export interface Definition {
|
|
7
|
+
DefNum?: number; //PK
|
|
8
|
+
ItemName?: string; //
|
|
9
|
+
ItemValue?: string; //
|
|
10
|
+
Category?: number; //
|
|
11
|
+
category?: string; //
|
|
12
|
+
isHidden?: 'true' | 'false'; //
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Parameters for GET Definitions.
|
|
17
|
+
* @see https://www.opendental.com/site/apidefinitions.html
|
|
18
|
+
*/
|
|
19
|
+
export interface GetDefinitionsParams {
|
|
20
|
+
Category?: number; //definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
21
|
+
includeHidden?: 'true' | 'false'; //optional parameter that defaults to false.
|
|
22
|
+
Offset?: number; // Pagination offset for results
|
|
23
|
+
}
|
|
24
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a subscription to a discount plan in the Open Dental system.
|
|
3
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
4
|
+
*/
|
|
5
|
+
export interface DiscountPlanSub {
|
|
6
|
+
DiscountSubNum?: number; //PK
|
|
7
|
+
DiscountPlanNum?: number; //FK to discount plan
|
|
8
|
+
PatNum?: number; //FK to patient
|
|
9
|
+
DateEffective?: string; //String in "yyyy-MM-dd" format.
|
|
10
|
+
DateTerm?: string; //String in "yyyy-MM-dd" format.
|
|
11
|
+
SubNote?: string; //
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Parameters for GET discount plan subs.
|
|
16
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
17
|
+
*/
|
|
18
|
+
export interface GetDiscountPlanSubsParams {
|
|
19
|
+
PatNum?: number; // FK to patient.PatNum.
|
|
20
|
+
Offset?: number; // Pagination offset for results
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Parameters for creating a discount plan sub.
|
|
25
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
26
|
+
*/
|
|
27
|
+
export interface CreateDiscountPlanSubParams {
|
|
28
|
+
PatNum: number; //FK to patient
|
|
29
|
+
DiscountPlanNum: number; //FK to discount plan
|
|
30
|
+
DateEffective?: string; //Optional. String in "yyyy-MM-dd" format. The date when the plan will start impacting procedure fees. Default "0001-01-01" to indicate the beginning of the current calendar year.
|
|
31
|
+
DateTerm?: string; //Optional. String in "yyyy-MM-dd" format. The date when the plan will no longer impact procedure fees. Default "0001-01-01" to indicate no end date.
|
|
32
|
+
SubNote?: string; //Optional. Subscriber note.
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Parameters for updating a discount plan sub.
|
|
37
|
+
* @see https://www.opendental.com/site/apidiscountplansubs.html
|
|
38
|
+
*/
|
|
39
|
+
export interface UpdateDiscountPlanSubParams {
|
|
40
|
+
DiscountSubNum: number; //PK
|
|
41
|
+
PatNum: string; //FK to patient
|
|
42
|
+
DateEffective?: string; //Optional. String in "yyyy-MM-dd" format. The date when the plan will start impacting procedure fees. Default "0001-01-01" to indicate the beginning of the current calendar year.
|
|
43
|
+
DateTerm?: string; //Optional. String in "yyyy-MM-dd" format. The date when the plan will no longer impact procedure fees. Default "0001-01-01" to indicate no end date.
|
|
44
|
+
SubNote?: string; //Optional. Subscriber note.
|
|
45
|
+
}
|
|
46
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an appointment in the Open Dental system.
|
|
3
|
+
* Used in multiple appointment-related endpoints.
|
|
4
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
5
|
+
*/
|
|
6
|
+
export interface Payment {
|
|
7
|
+
PayNum?: number; //PK
|
|
8
|
+
PayType?: number; //definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
9
|
+
payType?: string; //
|
|
10
|
+
PayDate?: string; //String in "yyyy-MM-dd" format. Defaults to today's date. Follows the office's preference to allow future-dated payments.
|
|
11
|
+
PayAmt?: string; //
|
|
12
|
+
CheckNum?: string; //
|
|
13
|
+
BankBranch?: string; //
|
|
14
|
+
PayNote?: string; //
|
|
15
|
+
PatNum?: number; //FK to patient.PatNum.
|
|
16
|
+
ClinicNum?: string; //
|
|
17
|
+
DateEntry?: string; //
|
|
18
|
+
DepositNum?: number; //
|
|
19
|
+
Receipt?: string; //
|
|
20
|
+
IsRecurringCC?: 'true' | 'false'; //
|
|
21
|
+
PaymentSource?: string; //
|
|
22
|
+
ProcessStatus?: string; //
|
|
23
|
+
RecurringChargeDate?: string; //
|
|
24
|
+
IsCcCompleted?: 'true' | 'false'; //
|
|
25
|
+
serverDateTime?: string; //
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Parameters for GET Payments.
|
|
30
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
31
|
+
*/
|
|
32
|
+
export interface GetPaymentsParams {
|
|
33
|
+
PayType?: number; //definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
34
|
+
PatNum?: number; //FK to patient.PatNum.
|
|
35
|
+
DateEntry?: string; //String in "yyyy-MM-dd" format. Gets all payments made on or after a certain date.
|
|
36
|
+
Offset?: number; // Pagination offset for results
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Parameters for creating a payment.
|
|
41
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
42
|
+
*/
|
|
43
|
+
export interface CreatePaymentParams {
|
|
44
|
+
PatNum: number; //Required. FK to patient.PatNum.
|
|
45
|
+
PayAmt: string; //String amount of payment as 0.00 (float.toString())
|
|
46
|
+
PayType?: number; //definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
47
|
+
PayDate?: string; //String in "yyyy-MM-dd" format. Defaults to today's date. Follows the office's preference to allow future-dated payments.
|
|
48
|
+
CheckNum?: string; //
|
|
49
|
+
PayNote?: string; //
|
|
50
|
+
BankBranch?: string; //
|
|
51
|
+
ClinicNum?: string; //Defaults to patient.ClinicNum
|
|
52
|
+
isPatientPreferred?: 'true' | 'false'; //When entering a payment through Open Dental directly, there is a checkbox for this option. This API field allows the same functionality. It causes the splits to go to the patient instead of being split among family members on a FIFO basis. Default "false".
|
|
53
|
+
isPrepayment?: 'true' | 'false'; //Creates a single paysplit using the default unearned type for unallocated paysplits stored in the PrepaymentUnearnedType preference. See also Unearned / Prepayment. Default "false".
|
|
54
|
+
procNums?: number[]; //An array of ProcNums, in [1,2,3] format to apply this Payment to. Procedures are paid by Procedure.ProcDate on a FIFO basis. Procedures not in the Patient's family will be silently ignored. Ignored if isPrepayment is set to "true". Default is an empty array.
|
|
55
|
+
payPlanNum?: number; //FK to payplan.PayPlanNum for a Dynamic Payment Plan. Only allowed if isPrepayment is "true" prior to version 23.3.4. Default 0.
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Parameters for updating a payment.
|
|
60
|
+
* @see https://www.opendental.com/site/apipayments.html
|
|
61
|
+
*/
|
|
62
|
+
export interface UpdatePaymentParams {
|
|
63
|
+
PayNum: number; //Required PK
|
|
64
|
+
PayType?: number; //definition.DefNum where definition.Category=10. Defaults to the ApiPaymentType preference.
|
|
65
|
+
CheckNum?: string; //
|
|
66
|
+
BankBranch?: string; //
|
|
67
|
+
PayNote?: string; //
|
|
68
|
+
ProcessStatus?: 'OnlineProcessed' | 'OnlinePending'; //Indicates whether a payment came from in office or online, and if the online payment is processed or pending. Either "OnlineProcessed" or "OnlinePending".
|
|
69
|
+
}
|
|
70
|
+
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
* @see https://www.opendental.com/site/apischedules.html
|
|
4
4
|
*/
|
|
5
5
|
export interface Schedule {
|
|
6
|
-
ScheduleNum?: number; //Unique identifier for
|
|
6
|
+
ScheduleNum?: number; //Unique identifier for schedule row
|
|
7
7
|
SchedDate?: string; //"YYYY-MM-DD"
|
|
8
|
-
StartTime?: string; //"
|
|
9
|
-
StopTime?: string; //"
|
|
8
|
+
StartTime?: string; //"HH:mm:ss"
|
|
9
|
+
StopTime?: string; //"HH:mm:ss"
|
|
10
10
|
SchedType?: "Practice" | "Provider" | "Blockout" | "Employee" | "WebSchedASAP"; //Either "Practice", "Provider", "Blockout", "Employee", or "WebSchedASAP".
|
|
11
|
-
ProvNum?:
|
|
12
|
-
BlockoutType?: string; //
|
|
13
|
-
blockoutType?: string; //
|
|
14
|
-
Note?: string; //
|
|
15
|
-
operatories?: string; //
|
|
16
|
-
EmployeeNum?: string; //
|
|
11
|
+
ProvNum?: string; //FK to provider.ProvNum.
|
|
12
|
+
BlockoutType?: string; //Definition.DefNum where definition.Category=25.
|
|
13
|
+
blockoutType?: string; //Definition.ItemName where Definition.DefNum == BlockoutType
|
|
14
|
+
Note?: string; //
|
|
15
|
+
operatories?: string; //String array of operatory.OperatoryNum
|
|
16
|
+
EmployeeNum?: string; //FK to employee.EmployeeNum.
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Parameters for fetching
|
|
20
|
+
* Parameters for fetching schedule records;
|
|
21
21
|
* @see https://www.opendental.com/site/apischedules.html
|
|
22
22
|
*/
|
|
23
23
|
export interface GetSchedulesParams {
|