@rinse-dental/open-dental 0.1.7 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/deploy_notes.txt +6 -2
  2. package/dist/api/definitions.d.ts +16 -0
  3. package/dist/api/definitions.d.ts.map +1 -0
  4. package/dist/api/definitions.js +25 -0
  5. package/dist/api/discountPlanSubs.d.ts +46 -0
  6. package/dist/api/discountPlanSubs.d.ts.map +1 -0
  7. package/dist/api/discountPlanSubs.js +69 -0
  8. package/dist/api/index.d.ts +6 -1
  9. package/dist/api/index.d.ts.map +1 -1
  10. package/dist/api/index.js +12 -2
  11. package/dist/api/operatories.d.ts +4 -4
  12. package/dist/api/operatories.js +4 -4
  13. package/dist/api/patFields.d.ts +3 -3
  14. package/dist/api/patFields.js +3 -3
  15. package/dist/api/payments.d.ts +49 -0
  16. package/dist/api/payments.d.ts.map +1 -0
  17. package/dist/api/payments.js +69 -0
  18. package/dist/api/providers.d.ts +38 -38
  19. package/dist/api/providers.js +38 -38
  20. package/dist/api/schedules.d.ts +4 -4
  21. package/dist/api/schedules.js +4 -4
  22. package/dist/api/treatplans.d.ts +9 -9
  23. package/dist/api/treatplans.d.ts.map +1 -1
  24. package/dist/api/treatplans.js +9 -9
  25. package/dist/openDental.d.ts +17 -2
  26. package/dist/openDental.d.ts.map +1 -1
  27. package/dist/openDental.js +32 -2
  28. package/dist/types/definitionTypes.d.ts +23 -0
  29. package/dist/types/definitionTypes.d.ts.map +1 -0
  30. package/dist/types/definitionTypes.js +2 -0
  31. package/dist/types/discountPlanSubTypes.d.ts +43 -0
  32. package/dist/types/discountPlanSubTypes.d.ts.map +1 -0
  33. package/dist/types/discountPlanSubTypes.js +2 -0
  34. package/dist/types/paymentTypes.d.ts +67 -0
  35. package/dist/types/paymentTypes.d.ts.map +1 -0
  36. package/dist/types/paymentTypes.js +2 -0
  37. package/dist/types/scheduleTypes.d.ts +2 -2
  38. package/package.json +3 -3
  39. package/src/api/definitions.ts +35 -0
  40. package/src/api/discountPlanSubs.ts +86 -0
  41. package/src/api/index.ts +6 -1
  42. package/src/api/operatories.ts +4 -4
  43. package/src/api/patFields.ts +3 -3
  44. package/src/api/payments.ts +86 -0
  45. package/src/api/providers.ts +38 -38
  46. package/src/api/schedules.ts +4 -4
  47. package/src/api/treatplans.ts +9 -10
  48. package/src/openDental.ts +34 -2
  49. package/src/types/definitionTypes.ts +24 -0
  50. package/src/types/discountPlanSubTypes.ts +46 -0
  51. package/src/types/paymentTypes.ts +70 -0
  52. package/src/types/scheduleTypes.ts +10 -10
package/deploy_notes.txt CHANGED
@@ -1,13 +1,17 @@
1
1
  npm run build
2
- npm version patch //patch, minor, major
3
- npm pack
2
+
4
3
  git add .
5
4
  git commit -m "notes"
5
+
6
+ npm version patch //patch, minor, major
7
+ npm pack
6
8
  git push origin main
7
9
  git tag //confirm tag
8
10
  git push origin vX.Y.Z
9
11
  gh release create vX.Y.Z --title "Release vX.Y.Z" --notes ""
10
12
 
13
+ gh release create v1.0.0 --title "Release v1.0.0" --notes "first major release"
14
+
11
15
  if the tag doesn't exist locally:
12
16
  git tag vX.Y.Z
13
17
  git push origin vX.Y.Z
@@ -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 definitions 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 definitions.
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 definitions 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 definitions.
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 discount plan sub 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
+ * Update a discount plan sub.
28
+ * @param {Object} data - The details of the discount sub to update.
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 updated discount plan sub.
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 discount plan sub 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
+ * Update a discount plan sub.
41
+ * @param {Object} data - The details of the discount sub to update.
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 updated discount plan sub.
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;
@@ -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 Schedule } from "./schedules";
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
@@ -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,QAAQ,EAAE,MAAM,aAAa,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,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.Schedule = exports.TreatmentPlans = exports.Recalls = exports.ProcedureLogs = exports.Patients = exports.PatFields = exports.CommLogs = exports.ChartModules = exports.Appointments = void 0;
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, "Schedule", { enumerable: true, get: function () { return __importDefault(schedules_1).default; } });
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
@@ -5,9 +5,9 @@ export default class Operatories {
5
5
  constructor(httpClient: HttpClient);
6
6
  /**
7
7
  * Fetch a single operatory by its ID.
8
- * @param {number} OperatoryNum - The ID of the patfield.
9
- * @returns {Promise<Operatory>} - The patient data.
10
- * @throws {Error} - If `PatNum` is not valid or the API returns an error.
8
+ * @param {number} OperatoryNum - The ID of the operatory.
9
+ * @returns {Promise<Operatory>} - The operatory data.
10
+ * @throws {Error} - If `OperatoryNum` is not valid or the API returns an error.
11
11
  */
12
12
  getOperatory(OperatoryNum: number): Promise<Operatory>;
13
13
  /**
@@ -15,7 +15,7 @@ export default class Operatories {
15
15
  * @param {Object} params - Filtering and pagination parameters.
16
16
  * @param {string} [params.ClinicNum] - Filter by clinicnum
17
17
  * @param {string} [params.Offset] - Filter by clinicnum
18
- * @returns {Promise<Operatory[]>} - A list of summarized patient data.
18
+ * @returns {Promise<Operatory[]>} - A list of operatories.
19
19
  * @throws {Error} - If the API returns an error.
20
20
  */
21
21
  getOperatories({ ClinicNum, Offset, }?: GetOperatoriesParams): Promise<Operatory[]>;
@@ -7,9 +7,9 @@ class Operatories {
7
7
  }
8
8
  /**
9
9
  * Fetch a single operatory by its ID.
10
- * @param {number} OperatoryNum - The ID of the patfield.
11
- * @returns {Promise<Operatory>} - The patient data.
12
- * @throws {Error} - If `PatNum` is not valid or the API returns an error.
10
+ * @param {number} OperatoryNum - The ID of the operatory.
11
+ * @returns {Promise<Operatory>} - The operatory data.
12
+ * @throws {Error} - If `OperatoryNum` is not valid or the API returns an error.
13
13
  */
14
14
  async getOperatory(OperatoryNum) {
15
15
  if (!OperatoryNum || typeof OperatoryNum !== "number") {
@@ -22,7 +22,7 @@ class Operatories {
22
22
  * @param {Object} params - Filtering and pagination parameters.
23
23
  * @param {string} [params.ClinicNum] - Filter by clinicnum
24
24
  * @param {string} [params.Offset] - Filter by clinicnum
25
- * @returns {Promise<Operatory[]>} - A list of summarized patient data.
25
+ * @returns {Promise<Operatory[]>} - A list of operatories.
26
26
  * @throws {Error} - If the API returns an error.
27
27
  */
28
28
  async getOperatories({ ClinicNum, Offset, } = {}) {
@@ -6,17 +6,17 @@ export default class PatFields {
6
6
  /**
7
7
  * Fetch a single patfield by its ID.
8
8
  * @param {number} PatFieldNum - The ID of the patfield.
9
- * @returns {Promise<PatField>} - The patient data.
9
+ * @returns {Promise<PatField>} - The patfield data.
10
10
  * @throws {Error} - If `PatNum` is not valid or the API returns an error.
11
11
  */
12
12
  getPatField(PatFieldNum: number): Promise<PatField>;
13
13
  /**
14
- * Fetch multiple patients with optional filtering and pagination.
14
+ * Fetch multiple patfields with optional filtering and pagination.
15
15
  * @param {Object} params - Filtering and pagination parameters.
16
16
  * @param {string} [params.PatNum] - Filter by last name (case-insensitive, partial match).
17
17
  * @param {string} [params.FieldName] - Filter by last name (case-insensitive, partial match).
18
18
  * @param {string} [params.SecDateTEdit] - Filter by last name (case-insensitive, partial match).
19
- * @returns {Promise<PatField[]>} - A list of summarized patient data.
19
+ * @returns {Promise<PatField[]>} - A list of patfields.
20
20
  * @throws {Error} - If the API returns an error.
21
21
  */
22
22
  getPatFields({ PatNum, FieldName, SecDateTEdit, }?: GetPatFieldsParams): Promise<PatField[]>;
@@ -8,7 +8,7 @@ class PatFields {
8
8
  /**
9
9
  * Fetch a single patfield by its ID.
10
10
  * @param {number} PatFieldNum - The ID of the patfield.
11
- * @returns {Promise<PatField>} - The patient data.
11
+ * @returns {Promise<PatField>} - The patfield data.
12
12
  * @throws {Error} - If `PatNum` is not valid or the API returns an error.
13
13
  */
14
14
  async getPatField(PatFieldNum) {
@@ -18,12 +18,12 @@ class PatFields {
18
18
  return await this.httpClient.get(`/patfields/${PatFieldNum}`);
19
19
  }
20
20
  /**
21
- * Fetch multiple patients with optional filtering and pagination.
21
+ * Fetch multiple patfields with optional filtering and pagination.
22
22
  * @param {Object} params - Filtering and pagination parameters.
23
23
  * @param {string} [params.PatNum] - Filter by last name (case-insensitive, partial match).
24
24
  * @param {string} [params.FieldName] - Filter by last name (case-insensitive, partial match).
25
25
  * @param {string} [params.SecDateTEdit] - Filter by last name (case-insensitive, partial match).
26
- * @returns {Promise<PatField[]>} - A list of summarized patient data.
26
+ * @returns {Promise<PatField[]>} - A list of patfields.
27
27
  * @throws {Error} - If the API returns an error.
28
28
  */
29
29
  async getPatFields({ PatNum, FieldName, SecDateTEdit, } = {}) {
@@ -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 payment.
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 payment.
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 payment.
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 payment.
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;
@@ -16,56 +16,56 @@ export default class Providers {
16
16
  * @param {number} [params.ClinicNum] - Get providers by ClinicNum
17
17
  * @param {string} [params.DateTStamp] - Get providers altered after the specified date and time
18
18
  * @param {string} [params.Offset] - Pagination
19
- * @returns {Promise<Provider[]>} - A list of summarized patient data.
19
+ * @returns {Promise<Provider[]>} - A list of providers.
20
20
  * @throws {Error} - If the API returns an error.
21
21
  */
22
22
  getProviders({ ClinicNum, DateTStamp, Offset, }?: GetProviderParams): Promise<Provider[]>;
23
23
  /**
24
24
  * Creates a provider. Cannot create PatFields associated with hidden PatFieldDefs.
25
- * @param {Object} data - The data for the new patfield.
25
+ * @param {Object} data - The data for the new provider.
26
26
  * @param {string} data.Abbr - Required.
27
- * @param {string} data.LName - Optional.
28
- * @param {string} data.FName - Optional.
29
- * @param {string} data.MI - Optional.
30
- * @param {string} data.Suffix - Optional.
31
- * @param {number} data.FeeSched - Optional.
32
- * @param {number} data.Specialty - Optional.
33
- * @param {string} data.SSN - Optional.
34
- * @param {'true' | 'false'} data.IsSecondary - Optional.
35
- * @param {'true' | 'false'} data.IsHidden - Optional.
36
- * @param {'true' | 'false'} data.UsingTIN - Optional.
37
- * @param {'true' | 'false'} data.SigOnFile - Optional.
38
- * @param {'true' | 'false'} data.IsNotPerson - Optional.
39
- * @param {'true' | 'false'} data.IsHiddenReport - Optional.
40
- * @param {string} data.Birthdate - Optional.
41
- * @param {string} data.SchedNote - Optional.
42
- * @param {string} data.PreferredName - Optional.
43
- * @returns {Promise<Provider>} - The created PatField.
27
+ * @param {string} [data.LName] - Optional.
28
+ * @param {string} [data.FName] - Optional.
29
+ * @param {string} [data.MI] - Optional.
30
+ * @param {string} [data.Suffix] - Optional.
31
+ * @param {number} [data.FeeSched] - Optional.
32
+ * @param {number} [data.Specialty] - Optional.
33
+ * @param {string} [data.SSN] - Optional.
34
+ * @param {'true' | 'false'} [data.IsSecondary] - Optional.
35
+ * @param {'true' | 'false'} [data.IsHidden] - Optional.
36
+ * @param {'true' | 'false'} [data.UsingTIN] - Optional.
37
+ * @param {'true' | 'false'} [data.SigOnFile] - Optional.
38
+ * @param {'true' | 'false'} [data.IsNotPerson] - Optional.
39
+ * @param {'true' | 'false'} [data.IsHiddenReport] - Optional.
40
+ * @param {string} [data.Birthdate] - Optional.
41
+ * @param {string} [data.SchedNote] - Optional.
42
+ * @param {string} [data.PreferredName] - Optional.
43
+ * @returns {Promise<Provider>} - The created provider.
44
44
  * @throws {Error} - If the data is invalid or the API returns an error.
45
45
  */
46
46
  createProvider({ Abbr, LName, FName, MI, Suffix, FeeSched, Specialty, SSN, IsSecondary, IsHidden, UsingTIN, SigOnFile, IsNotPerson, IsHiddenReport, Birthdate, SchedNote, PreferredName, }: createProviderParams): Promise<Provider>;
47
47
  /**
48
48
  * Update a provider.
49
49
  * @param {number} ProvNum - The ID of the provider.
50
- * @param {Object} data - The data for the new patfield.
51
- * @param {string} data.Abbr - Optional but must not be blank.
52
- * @param {string} data.LName - Optional.
53
- * @param {string} data.FName - Optional.
54
- * @param {string} data.MI - Optional.
55
- * @param {string} data.Suffix - Optional.
56
- * @param {number} data.FeeSched - Optional.
57
- * @param {number} data.Specialty - Optional.
58
- * @param {string} data.SSN - Optional.
59
- * @param {'true' | 'false'} data.IsSecondary - Optional.
60
- * @param {'true' | 'false'} data.IsHidden - Optional.
61
- * @param {'true' | 'false'} data.UsingTIN - Optional.
62
- * @param {'true' | 'false'} data.SigOnFile - Optional.
63
- * @param {'true' | 'false'} data.IsNotPerson - Optional.
64
- * @param {'true' | 'false'} data.IsHiddenReport - Optional.
65
- * @param {string} data.Birthdate - Optional.
66
- * @param {string} data.SchedNote - Optional.
67
- * @param {string} data.PreferredName - Optional.
68
- * @returns {Promise<Provider>} - The created PatField.
50
+ * @param {Object} data - The data for a provider.
51
+ * @param {string} [data.Abbr] - Optional but must not be blank.
52
+ * @param {string} [data.LName] - Optional.
53
+ * @param {string} [data.FName] - Optional.
54
+ * @param {string} [data.MI] - Optional.
55
+ * @param {string} [data.Suffix] - Optional.
56
+ * @param {number} [data.FeeSched] - Optional.
57
+ * @param {number} [data.Specialty] - Optional.
58
+ * @param {string} [data.SSN] - Optional.
59
+ * @param {'true' | 'false'} [data.IsSecondary] - Optional.
60
+ * @param {'true' | 'false'} [data.IsHidden] - Optional.
61
+ * @param {'true' | 'false'} [data.UsingTIN] - Optional.
62
+ * @param {'true' | 'false'} [data.SigOnFile] - Optional.
63
+ * @param {'true' | 'false'} [data.IsNotPerson] - Optional.
64
+ * @param {'true' | 'false'} [data.IsHiddenReport] - Optional.
65
+ * @param {string} [data.Birthdate] - Optional.
66
+ * @param {string} [data.SchedNote] - Optional.
67
+ * @param {string} [data.PreferredName] - Optional.
68
+ * @returns {Promise<Provider>} - The updated Provider.
69
69
  * @throws {Error} - If the data is invalid or the API returns an error.
70
70
  */
71
71
  updateProvider({ ProvNum, Abbr, LName, FName, MI, Suffix, Specialty, SSN, NationalProvID, StateLicense, UsingTIN, SigOnFile, PreferredName, }: updateProviderParams): Promise<Provider>;