@rinse-dental/open-dental 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/benefits.d.ts +62 -0
- package/dist/api/benefits.d.ts.map +1 -0
- package/dist/api/benefits.js +111 -0
- package/dist/api/insPlans.d.ts +62 -0
- package/dist/api/insPlans.d.ts.map +1 -0
- package/dist/api/insPlans.js +112 -0
- package/dist/api/patPlans.d.ts +2 -2
- package/dist/api/patPlans.js +2 -2
- package/dist/openDental.d.ts +10 -0
- package/dist/openDental.d.ts.map +1 -1
- package/dist/openDental.js +20 -0
- package/dist/types/benefitTypes.d.ts +67 -0
- package/dist/types/benefitTypes.d.ts.map +1 -0
- package/dist/types/benefitTypes.js +2 -0
- package/dist/types/insPlanTypes.d.ts +69 -0
- package/dist/types/insPlanTypes.d.ts.map +1 -0
- package/dist/types/insPlanTypes.js +2 -0
- package/package.json +1 -1
- package/release.sh +1 -1
- package/src/api/benefits.ts +155 -0
- package/src/api/insPlans.ts +158 -0
- package/src/api/patPlans.ts +2 -2
- package/src/openDental.ts +22 -0
- package/src/types/benefitTypes.ts +70 -0
- package/src/types/insPlanTypes.ts +72 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { Benefit, GetBenefitsParams, CreateBenefitParams, UpdateBenefitParams } from "../types/benefitTypes";
|
|
3
|
+
export default class Benefits {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch multiple benefits with optional filtering and pagination.
|
|
8
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
9
|
+
* @param {number} [params.PlanNum] - FK to InsPlan.PlanNum.
|
|
10
|
+
* @param {number} [params.PatPlanNum] - FK to PatPlan.PatPlanNum.
|
|
11
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
12
|
+
* @returns {Promise<Benefit[]>} - A list of benefits.
|
|
13
|
+
*/
|
|
14
|
+
getBenefits({ PlanNum, PatPlanNum, Offset, }?: GetBenefitsParams): Promise<Benefit[]>;
|
|
15
|
+
/**
|
|
16
|
+
* This adds a Benefit row to the database.
|
|
17
|
+
* @param {Object} data - The details of the Benefit to create.
|
|
18
|
+
* @param {number} data.PlanNum - This or PatPlanNum is required. FK to InsPlan.PlanNum.
|
|
19
|
+
* @param {number} data.PatPlanNum - This or PlanNum is required. FK to PatPlan.PlanNum.
|
|
20
|
+
* @param {"ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"} data.BenefitType - Required. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
21
|
+
* @param {"None" | "Individual" | "Family"} data.CoverageLevel - Required. Either "None", "Individual", or "Family".
|
|
22
|
+
* @param {number} [data.CovCatNum] - Optional. FK to covcat.CovCatNum.
|
|
23
|
+
* @param {number} [data.Percent] - Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
24
|
+
* @param {number} [data.MonetaryAmt] - Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
25
|
+
* @param {"None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"} [data.TimePeriod] - Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
26
|
+
* @param {"None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"} [data.QuantityQualifier] - Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
27
|
+
* @param {number} [data.Quantity] - Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
28
|
+
* @param {number} [data.CodeNum] - Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified. Default 0.
|
|
29
|
+
* @param {string} [data.procCode] - Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0. Default empty string.
|
|
30
|
+
* @param {number} [data.CodeGroupNum] - Optional. (Added in version 23.2.62) FK to codegroup.CodeGroupNum. The group of procedure codes that apply to this Frequency Limitation benefit.
|
|
31
|
+
* @returns {Promise<Benefit>} - The created a benefit.
|
|
32
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
33
|
+
*/
|
|
34
|
+
createBenefit({ PlanNum, PatPlanNum, BenefitType, CoverageLevel, CovCatNum, Percent, MonetaryAmt, TimePeriod, QuantityQualifier, Quantity, CodeNum, procCode, CodeGroupNum, }: CreateBenefitParams): Promise<Benefit>;
|
|
35
|
+
/**
|
|
36
|
+
* Update a Benefit.
|
|
37
|
+
* @param {Object} data - The details of Benefit to update.
|
|
38
|
+
* @param {number} data.BenefitNum - Required. PK
|
|
39
|
+
* @param {number} [data.CovCatNum] - Optional. FK to covcat.CovCatNum.
|
|
40
|
+
* @param {"ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"} [data.BenefitType] - Optional. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
41
|
+
* @param {number} [data.Percent] - Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
42
|
+
* @param {number} [data.MonetaryAmt] - Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
43
|
+
* @param {"None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"} [data.TimePeriod] - Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
44
|
+
* @param {"None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"} [data.QuantityQualifier] - Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
45
|
+
* @param {number} [data.Quantity] - Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
46
|
+
* @param {number} [data.CodeNum] - Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified.
|
|
47
|
+
* @param {string} [data.procCode] - Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0.
|
|
48
|
+
* @param {"None" | "Individual" | "Family"} [data.CoverageLevel] - Optional. Either "None", "Individual", or "Family".
|
|
49
|
+
* @returns {Promise<Benefit>} - The updated Benefit.
|
|
50
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
51
|
+
*/
|
|
52
|
+
updateBenefit({ BenefitNum, CovCatNum, BenefitType, Percent, MonetaryAmt, TimePeriod, QuantityQualifier, Quantity, CodeNum, procCode, CoverageLevel, }: UpdateBenefitParams): Promise<Benefit>;
|
|
53
|
+
/**
|
|
54
|
+
* Delete a Benefit entry.
|
|
55
|
+
* This removes a Benefit row from the database.
|
|
56
|
+
* @param {number} BenefitNum - Required: The unique identifier of the Benefit to delete.
|
|
57
|
+
* @returns {Promise<void>} - Resolves when the Benefit is deleted.
|
|
58
|
+
* @throws {Error} - If `BenefitNum` is not valid or the API returns an error.
|
|
59
|
+
*/
|
|
60
|
+
deletePatPlan(BenefitNum: number): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=benefits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benefits.d.ts","sourceRoot":"","sources":["../../src/api/benefits.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;IAIlC;;;;;;;QAOI;IACS,WAAW,CAAC,EACvB,OAAO,EACP,UAAU,EACV,MAAM,GACP,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAU9C;;;;;;;;;;;;;;;;;;OAkBG;IACU,aAAa,CAAC,EACzB,OAAO,EACP,UAAU,EACV,WAAW,EACX,aAAa,EACb,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,YAAY,GACb,EAAG,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAsB1C;;;;;;;;;;;;;;;;OAgBG;IACU,aAAa,CAAC,EACzB,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,aAAa,GACd,EAAG,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmB1C;;;;;;OAMG;IACU,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO9D"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Benefits {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch multiple benefits with optional filtering and pagination.
|
|
10
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
11
|
+
* @param {number} [params.PlanNum] - FK to InsPlan.PlanNum.
|
|
12
|
+
* @param {number} [params.PatPlanNum] - FK to PatPlan.PatPlanNum.
|
|
13
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
14
|
+
* @returns {Promise<Benefit[]>} - A list of benefits.
|
|
15
|
+
*/
|
|
16
|
+
async getBenefits({ PlanNum, PatPlanNum, Offset, } = {}) {
|
|
17
|
+
const params = {
|
|
18
|
+
PlanNum,
|
|
19
|
+
PatPlanNum,
|
|
20
|
+
Offset,
|
|
21
|
+
};
|
|
22
|
+
return this.httpClient.get("/benefits", params);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* This adds a Benefit row to the database.
|
|
26
|
+
* @param {Object} data - The details of the Benefit to create.
|
|
27
|
+
* @param {number} data.PlanNum - This or PatPlanNum is required. FK to InsPlan.PlanNum.
|
|
28
|
+
* @param {number} data.PatPlanNum - This or PlanNum is required. FK to PatPlan.PlanNum.
|
|
29
|
+
* @param {"ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"} data.BenefitType - Required. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
30
|
+
* @param {"None" | "Individual" | "Family"} data.CoverageLevel - Required. Either "None", "Individual", or "Family".
|
|
31
|
+
* @param {number} [data.CovCatNum] - Optional. FK to covcat.CovCatNum.
|
|
32
|
+
* @param {number} [data.Percent] - Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
33
|
+
* @param {number} [data.MonetaryAmt] - Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
34
|
+
* @param {"None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"} [data.TimePeriod] - Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
35
|
+
* @param {"None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"} [data.QuantityQualifier] - Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
36
|
+
* @param {number} [data.Quantity] - Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
37
|
+
* @param {number} [data.CodeNum] - Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified. Default 0.
|
|
38
|
+
* @param {string} [data.procCode] - Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0. Default empty string.
|
|
39
|
+
* @param {number} [data.CodeGroupNum] - Optional. (Added in version 23.2.62) FK to codegroup.CodeGroupNum. The group of procedure codes that apply to this Frequency Limitation benefit.
|
|
40
|
+
* @returns {Promise<Benefit>} - The created a benefit.
|
|
41
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
42
|
+
*/
|
|
43
|
+
async createBenefit({ PlanNum, PatPlanNum, BenefitType, CoverageLevel, CovCatNum, Percent, MonetaryAmt, TimePeriod, QuantityQualifier, Quantity, CodeNum, procCode, CodeGroupNum, }) {
|
|
44
|
+
if (!BenefitType || !CoverageLevel) {
|
|
45
|
+
throw new Error("Invalid data: Either PlanNum or PatPlanNum and BenefitType and CoverageLevel are required.");
|
|
46
|
+
}
|
|
47
|
+
return this.httpClient.post("/benefits", {
|
|
48
|
+
PlanNum,
|
|
49
|
+
PatPlanNum,
|
|
50
|
+
BenefitType,
|
|
51
|
+
CoverageLevel,
|
|
52
|
+
CovCatNum,
|
|
53
|
+
Percent,
|
|
54
|
+
MonetaryAmt,
|
|
55
|
+
TimePeriod,
|
|
56
|
+
QuantityQualifier,
|
|
57
|
+
Quantity,
|
|
58
|
+
CodeNum,
|
|
59
|
+
procCode,
|
|
60
|
+
CodeGroupNum,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Update a Benefit.
|
|
65
|
+
* @param {Object} data - The details of Benefit to update.
|
|
66
|
+
* @param {number} data.BenefitNum - Required. PK
|
|
67
|
+
* @param {number} [data.CovCatNum] - Optional. FK to covcat.CovCatNum.
|
|
68
|
+
* @param {"ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"} [data.BenefitType] - Optional. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
69
|
+
* @param {number} [data.Percent] - Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
70
|
+
* @param {number} [data.MonetaryAmt] - Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
71
|
+
* @param {"None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"} [data.TimePeriod] - Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
72
|
+
* @param {"None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"} [data.QuantityQualifier] - Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
73
|
+
* @param {number} [data.Quantity] - Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
74
|
+
* @param {number} [data.CodeNum] - Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified.
|
|
75
|
+
* @param {string} [data.procCode] - Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0.
|
|
76
|
+
* @param {"None" | "Individual" | "Family"} [data.CoverageLevel] - Optional. Either "None", "Individual", or "Family".
|
|
77
|
+
* @returns {Promise<Benefit>} - The updated Benefit.
|
|
78
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
79
|
+
*/
|
|
80
|
+
async updateBenefit({ BenefitNum, CovCatNum, BenefitType, Percent, MonetaryAmt, TimePeriod, QuantityQualifier, Quantity, CodeNum, procCode, CoverageLevel, }) {
|
|
81
|
+
if (!BenefitNum || typeof BenefitNum !== "number") {
|
|
82
|
+
throw new Error("Invalid data: A Valid BenefitNum is required.");
|
|
83
|
+
}
|
|
84
|
+
return this.httpClient.put(`/benefits/${BenefitNum}`, {
|
|
85
|
+
CovCatNum,
|
|
86
|
+
BenefitType,
|
|
87
|
+
Percent,
|
|
88
|
+
MonetaryAmt,
|
|
89
|
+
TimePeriod,
|
|
90
|
+
QuantityQualifier,
|
|
91
|
+
Quantity,
|
|
92
|
+
CodeNum,
|
|
93
|
+
procCode,
|
|
94
|
+
CoverageLevel,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Delete a Benefit entry.
|
|
99
|
+
* This removes a Benefit row from the database.
|
|
100
|
+
* @param {number} BenefitNum - Required: The unique identifier of the Benefit to delete.
|
|
101
|
+
* @returns {Promise<void>} - Resolves when the Benefit is deleted.
|
|
102
|
+
* @throws {Error} - If `BenefitNum` is not valid or the API returns an error.
|
|
103
|
+
*/
|
|
104
|
+
async deletePatPlan(BenefitNum) {
|
|
105
|
+
if (!BenefitNum || typeof BenefitNum !== "number") {
|
|
106
|
+
throw new Error("Invalid parameter: BenefitNum must be a valid number.");
|
|
107
|
+
}
|
|
108
|
+
return this.httpClient.delete(`/benefits/${BenefitNum}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.default = Benefits;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { InsPlan, GetInsPlansParams, CreateInsPlanParams, UpdateInsPlanParams } from "../types/insPlanTypes";
|
|
3
|
+
export default class InsPlans {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch a single insplan by its ID.
|
|
8
|
+
* @param {number} PlanNum - The ID of the insplan.
|
|
9
|
+
* @returns {Promise<InsPlan>} - The insplan data.
|
|
10
|
+
* @throws {Error} - If `InsPlan` is not valid or the API returns an error.
|
|
11
|
+
*/
|
|
12
|
+
getInsPlan(PlanNum: number): Promise<InsPlan>;
|
|
13
|
+
/**
|
|
14
|
+
* Fetch multiple insplans with optional filtering and pagination.
|
|
15
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
16
|
+
* @param {"percentage" | "p" | "f" | "c" } [params.PlanType] - Must be one of the following: "percentage" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c" (Capitation). Percentage PlanTypes are stored as blank in the database.
|
|
17
|
+
* @param {number} [params.CarrierNum] - FK to carrier.CarrierNum.
|
|
18
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
19
|
+
* @returns {Promise<InsPlan[]>} - A list of InsPlans.
|
|
20
|
+
*/
|
|
21
|
+
getInsPlans({ PlanType, CarrierNum, Offset, }?: GetInsPlansParams): Promise<InsPlan[]>;
|
|
22
|
+
/**
|
|
23
|
+
* This adds an InsPlan row to the database.
|
|
24
|
+
* @param {Object} data - The details of the insplan to create.
|
|
25
|
+
* @param {number} data.CarrierNum - Required. FK to carrier.CarrierNum.
|
|
26
|
+
* @param {string} [data.GroupName] - Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
27
|
+
* @param {string} [data.GroupNum] - Optional. The carrier assigned identifier, unique for each plan.
|
|
28
|
+
* @param {string} [data.PlanNote] - Optional. Note for this plan. Same for all subscribers.
|
|
29
|
+
* @param {number} [data.FeeSched] - Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
30
|
+
* @param {"" | "p" | "f" | "c"} [data.PlanType] - Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
31
|
+
* @param {number} [data.CopayFeeSched] - Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
32
|
+
* @param {number} [data.EmployerNum] - Optional. FK to employer.EmployerNum. Default 0.
|
|
33
|
+
* @param {"true" | "false"} [data.CodeSubstNone] - Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
34
|
+
* @param {"true" | "false"} [data.IsHidden] - ?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
35
|
+
* @param {number} [data.MonthRenew] - Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
36
|
+
* @param {"true" | "false"} [data.IsBlueBookEnabled] - Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
37
|
+
* @returns {Promise<InsPlan>} - The created insplan.
|
|
38
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
39
|
+
*/
|
|
40
|
+
createInsPlan({ CarrierNum, GroupName, GroupNum, PlanNote, FeeSched, PlanType, CopayFeeSched, EmployerNum, CodeSubstNone, IsHidden, MonthRenew, IsBlueBookEnabled, }: CreateInsPlanParams): Promise<InsPlan>;
|
|
41
|
+
/**
|
|
42
|
+
* Update a InsPlan.
|
|
43
|
+
* @param {Object} data - The details of InsPlan to update.
|
|
44
|
+
* @param {number} data.PlanNum - Required. Primary key.
|
|
45
|
+
* @param {string} [data.GroupName] - Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
46
|
+
* @param {string} [data.GroupNum] - Optional. The carrier assigned identifier, unique for each plan.
|
|
47
|
+
* @param {string} [data.PlanNote] - Optional. Note for this plan. Same for all subscribers.
|
|
48
|
+
* @param {number} [data.FeeSched] - Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
49
|
+
* @param {"" | "p" | "f" | "c"} [data.PlanType] - Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
50
|
+
* @param {number} [data.CopayFeeSched] - Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
51
|
+
* @param {number} [data.EmployerNum] - Optional. FK to employer.EmployerNum. Default 0.
|
|
52
|
+
* @param {number} [data.CarrierNum] - Optional. FK to carrier.CarrierNum.
|
|
53
|
+
* @param {"true" | "false"} [data.CodeSubstNone] - Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
54
|
+
* @param {"true" | "false"} [data.IsHidden] - ?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
55
|
+
* @param {number} [data.MonthRenew] - Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
56
|
+
* @param {"true" | "false"} [data.IsBlueBookEnabled] - Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
57
|
+
* @returns {Promise<InsPlan>} - The updated InsPlan.
|
|
58
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
59
|
+
*/
|
|
60
|
+
updateInsPlan({ PlanNum, GroupName, GroupNum, PlanNote, FeeSched, PlanType, CopayFeeSched, EmployerNum, CarrierNum, CodeSubstNone, IsHidden, MonthRenew, IsBlueBookEnabled, }: UpdateInsPlanParams): Promise<InsPlan>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=insPlans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insPlans.d.ts","sourceRoot":"","sources":["../../src/api/insPlans.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;IAIlC;;;;;OAKG;IACU,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS1D;;;;;;;QAOI;IACS,WAAW,CAAC,EACvB,QAAQ,EACR,UAAU,EACV,MAAM,GACP,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAU9C;;;;;;;;;;;;;;;;;OAiBG;IACU,aAAa,CAAC,EACzB,UAAU,EACV,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,WAAW,EACX,aAAa,EACb,QAAQ,EACR,UAAU,EACV,iBAAiB,GAClB,EAAG,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAqB1C;;;;;;;;;;;;;;;;;;OAkBG;IACU,aAAa,CAAC,EACzB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,EACb,QAAQ,EACR,UAAU,EACV,iBAAiB,GAClB,EAAG,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAoB3C"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class InsPlans {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch a single insplan by its ID.
|
|
10
|
+
* @param {number} PlanNum - The ID of the insplan.
|
|
11
|
+
* @returns {Promise<InsPlan>} - The insplan data.
|
|
12
|
+
* @throws {Error} - If `InsPlan` is not valid or the API returns an error.
|
|
13
|
+
*/
|
|
14
|
+
async getInsPlan(PlanNum) {
|
|
15
|
+
if (!PlanNum || typeof PlanNum !== "number") {
|
|
16
|
+
throw new Error("Invalid parameter: PlanNum must be a valid number.");
|
|
17
|
+
}
|
|
18
|
+
return await this.httpClient.get(`/insplans/${PlanNum}`);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Fetch multiple insplans with optional filtering and pagination.
|
|
22
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
23
|
+
* @param {"percentage" | "p" | "f" | "c" } [params.PlanType] - Must be one of the following: "percentage" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c" (Capitation). Percentage PlanTypes are stored as blank in the database.
|
|
24
|
+
* @param {number} [params.CarrierNum] - FK to carrier.CarrierNum.
|
|
25
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
26
|
+
* @returns {Promise<InsPlan[]>} - A list of InsPlans.
|
|
27
|
+
*/
|
|
28
|
+
async getInsPlans({ PlanType, CarrierNum, Offset, } = {}) {
|
|
29
|
+
const params = {
|
|
30
|
+
PlanType,
|
|
31
|
+
CarrierNum,
|
|
32
|
+
Offset,
|
|
33
|
+
};
|
|
34
|
+
return this.httpClient.get("/insplans", params);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* This adds an InsPlan row to the database.
|
|
38
|
+
* @param {Object} data - The details of the insplan to create.
|
|
39
|
+
* @param {number} data.CarrierNum - Required. FK to carrier.CarrierNum.
|
|
40
|
+
* @param {string} [data.GroupName] - Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
41
|
+
* @param {string} [data.GroupNum] - Optional. The carrier assigned identifier, unique for each plan.
|
|
42
|
+
* @param {string} [data.PlanNote] - Optional. Note for this plan. Same for all subscribers.
|
|
43
|
+
* @param {number} [data.FeeSched] - Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
44
|
+
* @param {"" | "p" | "f" | "c"} [data.PlanType] - Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
45
|
+
* @param {number} [data.CopayFeeSched] - Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
46
|
+
* @param {number} [data.EmployerNum] - Optional. FK to employer.EmployerNum. Default 0.
|
|
47
|
+
* @param {"true" | "false"} [data.CodeSubstNone] - Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
48
|
+
* @param {"true" | "false"} [data.IsHidden] - ?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
49
|
+
* @param {number} [data.MonthRenew] - Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
50
|
+
* @param {"true" | "false"} [data.IsBlueBookEnabled] - Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
51
|
+
* @returns {Promise<InsPlan>} - The created insplan.
|
|
52
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
53
|
+
*/
|
|
54
|
+
async createInsPlan({ CarrierNum, GroupName, GroupNum, PlanNote, FeeSched, PlanType, CopayFeeSched, EmployerNum, CodeSubstNone, IsHidden, MonthRenew, IsBlueBookEnabled, }) {
|
|
55
|
+
if (!CarrierNum) {
|
|
56
|
+
throw new Error("Invalid data: CarrierNum is required.");
|
|
57
|
+
}
|
|
58
|
+
return this.httpClient.post("/insplans", {
|
|
59
|
+
CarrierNum,
|
|
60
|
+
GroupName,
|
|
61
|
+
GroupNum,
|
|
62
|
+
PlanNote,
|
|
63
|
+
FeeSched,
|
|
64
|
+
PlanType,
|
|
65
|
+
CopayFeeSched,
|
|
66
|
+
EmployerNum,
|
|
67
|
+
CodeSubstNone,
|
|
68
|
+
IsHidden,
|
|
69
|
+
MonthRenew,
|
|
70
|
+
IsBlueBookEnabled,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Update a InsPlan.
|
|
75
|
+
* @param {Object} data - The details of InsPlan to update.
|
|
76
|
+
* @param {number} data.PlanNum - Required. Primary key.
|
|
77
|
+
* @param {string} [data.GroupName] - Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
78
|
+
* @param {string} [data.GroupNum] - Optional. The carrier assigned identifier, unique for each plan.
|
|
79
|
+
* @param {string} [data.PlanNote] - Optional. Note for this plan. Same for all subscribers.
|
|
80
|
+
* @param {number} [data.FeeSched] - Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
81
|
+
* @param {"" | "p" | "f" | "c"} [data.PlanType] - Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
82
|
+
* @param {number} [data.CopayFeeSched] - Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
83
|
+
* @param {number} [data.EmployerNum] - Optional. FK to employer.EmployerNum. Default 0.
|
|
84
|
+
* @param {number} [data.CarrierNum] - Optional. FK to carrier.CarrierNum.
|
|
85
|
+
* @param {"true" | "false"} [data.CodeSubstNone] - Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
86
|
+
* @param {"true" | "false"} [data.IsHidden] - ?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
87
|
+
* @param {number} [data.MonthRenew] - Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
88
|
+
* @param {"true" | "false"} [data.IsBlueBookEnabled] - Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
89
|
+
* @returns {Promise<InsPlan>} - The updated InsPlan.
|
|
90
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
91
|
+
*/
|
|
92
|
+
async updateInsPlan({ PlanNum, GroupName, GroupNum, PlanNote, FeeSched, PlanType, CopayFeeSched, EmployerNum, CarrierNum, CodeSubstNone, IsHidden, MonthRenew, IsBlueBookEnabled, }) {
|
|
93
|
+
if (!PlanNum || typeof PlanNum !== "number") {
|
|
94
|
+
throw new Error("Invalid data: A Valid PlanNum is required.");
|
|
95
|
+
}
|
|
96
|
+
return this.httpClient.put(`/insplans/${PlanNum}`, {
|
|
97
|
+
GroupName,
|
|
98
|
+
GroupNum,
|
|
99
|
+
PlanNote,
|
|
100
|
+
FeeSched,
|
|
101
|
+
PlanType,
|
|
102
|
+
CopayFeeSched,
|
|
103
|
+
EmployerNum,
|
|
104
|
+
CarrierNum,
|
|
105
|
+
CodeSubstNone,
|
|
106
|
+
IsHidden,
|
|
107
|
+
MonthRenew,
|
|
108
|
+
IsBlueBookEnabled,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.default = InsPlans;
|
package/dist/api/patPlans.d.ts
CHANGED
|
@@ -37,10 +37,10 @@ export default class PatPlans {
|
|
|
37
37
|
*/
|
|
38
38
|
updatePatPlan({ PatPlanNum, InsSubNum, Ordinal, Relationship, PatID, }: UpdatePatPlanParams): Promise<PatPlan>;
|
|
39
39
|
/**
|
|
40
|
-
* Delete
|
|
40
|
+
* Delete a PatPlan entry.
|
|
41
41
|
* This is called "Drop" in the Open Dental UI. This removes a PatPlan row from the database, indicating no coverage, but does not affect the InsPlan itself.
|
|
42
42
|
* @param {number} PatPlanNum - Required: The unique identifier of the inssub to delete.
|
|
43
|
-
* @returns {Promise<void>} - Resolves when the
|
|
43
|
+
* @returns {Promise<void>} - Resolves when the PatPlan is deleted.
|
|
44
44
|
* @throws {Error} - If `PatPlanNum` is not valid or the API returns an error.
|
|
45
45
|
*/
|
|
46
46
|
deletePatPlan(PatPlanNum: number): Promise<void>;
|
package/dist/api/patPlans.js
CHANGED
|
@@ -67,10 +67,10 @@ class PatPlans {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Delete
|
|
70
|
+
* Delete a PatPlan entry.
|
|
71
71
|
* This is called "Drop" in the Open Dental UI. This removes a PatPlan row from the database, indicating no coverage, but does not affect the InsPlan itself.
|
|
72
72
|
* @param {number} PatPlanNum - Required: The unique identifier of the inssub to delete.
|
|
73
|
-
* @returns {Promise<void>} - Resolves when the
|
|
73
|
+
* @returns {Promise<void>} - Resolves when the PatPlan is deleted.
|
|
74
74
|
* @throws {Error} - If `PatPlanNum` is not valid or the API returns an error.
|
|
75
75
|
*/
|
|
76
76
|
async deletePatPlan(PatPlanNum) {
|
package/dist/openDental.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ import PatPlans from "./api/patPlans";
|
|
|
18
18
|
import LabCases from "./api/labCases";
|
|
19
19
|
import Referrals from "./api/referrals";
|
|
20
20
|
import RefAttaches from "./api/refAttaches";
|
|
21
|
+
import InsPlans from "./api/insPlans";
|
|
22
|
+
import Benefits from "./api/benefits";
|
|
21
23
|
declare class OpenDental {
|
|
22
24
|
private static httpClient;
|
|
23
25
|
/**
|
|
@@ -104,6 +106,14 @@ declare class OpenDental {
|
|
|
104
106
|
* Create a new instance of the LabCases API.
|
|
105
107
|
*/
|
|
106
108
|
static RefAttaches(): RefAttaches;
|
|
109
|
+
/**
|
|
110
|
+
* Create a new instance of the LabCases API.
|
|
111
|
+
*/
|
|
112
|
+
static InsPlans(): InsPlans;
|
|
113
|
+
/**
|
|
114
|
+
* Create a new instance of the LabCases API.
|
|
115
|
+
*/
|
|
116
|
+
static Benefits(): Benefits;
|
|
107
117
|
}
|
|
108
118
|
export { OpenDental };
|
|
109
119
|
//# 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;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,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;AACtD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,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;IAOzB;;OAEG;WACW,gBAAgB;IAO9B;;OAEG;WACW,aAAa;IAO3B;;OAEG;WACW,OAAO;IAOrB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,SAAS;IAOvB;;OAEG;WACW,WAAW;IAOzB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,QAAQ;CAMvB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/openDental.js
CHANGED
|
@@ -25,6 +25,8 @@ const patPlans_1 = __importDefault(require("./api/patPlans"));
|
|
|
25
25
|
const labCases_1 = __importDefault(require("./api/labCases"));
|
|
26
26
|
const referrals_1 = __importDefault(require("./api/referrals"));
|
|
27
27
|
const refAttaches_1 = __importDefault(require("./api/refAttaches"));
|
|
28
|
+
const insPlans_1 = __importDefault(require("./api/insPlans"));
|
|
29
|
+
const benefits_1 = __importDefault(require("./api/benefits"));
|
|
28
30
|
class OpenDental {
|
|
29
31
|
static httpClient;
|
|
30
32
|
/**
|
|
@@ -218,5 +220,23 @@ class OpenDental {
|
|
|
218
220
|
}
|
|
219
221
|
return new refAttaches_1.default(this.httpClient);
|
|
220
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Create a new instance of the LabCases API.
|
|
225
|
+
*/
|
|
226
|
+
static InsPlans() {
|
|
227
|
+
if (!this.httpClient) {
|
|
228
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
229
|
+
}
|
|
230
|
+
return new insPlans_1.default(this.httpClient);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Create a new instance of the LabCases API.
|
|
234
|
+
*/
|
|
235
|
+
static Benefits() {
|
|
236
|
+
if (!this.httpClient) {
|
|
237
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
238
|
+
}
|
|
239
|
+
return new benefits_1.default(this.httpClient);
|
|
240
|
+
}
|
|
221
241
|
}
|
|
222
242
|
exports.OpenDental = OpenDental;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
3
|
+
*/
|
|
4
|
+
export interface Benefit {
|
|
5
|
+
BenefitNum?: number;
|
|
6
|
+
PlanNum?: number;
|
|
7
|
+
PatPlanNum?: number;
|
|
8
|
+
CovCatNum?: number;
|
|
9
|
+
BenefitType?: "ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod";
|
|
10
|
+
Percent?: number;
|
|
11
|
+
MonetaryAmt?: number;
|
|
12
|
+
TimePeriod?: "None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months";
|
|
13
|
+
QuantityQualifier?: "None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months";
|
|
14
|
+
Quantity?: number;
|
|
15
|
+
CodeNum?: number;
|
|
16
|
+
procCode?: string;
|
|
17
|
+
CoverageLevel?: "None" | "Individual" | "Family";
|
|
18
|
+
SecDateTEntry?: string;
|
|
19
|
+
SecDateTEdit?: string;
|
|
20
|
+
CodeGroupNum?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets a list of PatPlans that meet a set of search criteria.
|
|
24
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
25
|
+
*/
|
|
26
|
+
export interface GetBenefitsParams {
|
|
27
|
+
PlanNum?: number;
|
|
28
|
+
PatPlanNum?: number;
|
|
29
|
+
Offset?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parameters for creating a new insplan.
|
|
33
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
34
|
+
*/
|
|
35
|
+
export interface CreateBenefitParams {
|
|
36
|
+
PlanNum?: number;
|
|
37
|
+
PatPlanNum?: number;
|
|
38
|
+
BenefitType: "ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod";
|
|
39
|
+
CoverageLevel: "None" | "Individual" | "Family";
|
|
40
|
+
CovCatNum?: number;
|
|
41
|
+
Percent?: number;
|
|
42
|
+
MonetaryAmt?: number;
|
|
43
|
+
TimePeriod?: "None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months";
|
|
44
|
+
QuantityQualifier?: "None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months";
|
|
45
|
+
Quantity?: number;
|
|
46
|
+
CodeNum?: number;
|
|
47
|
+
procCode?: string;
|
|
48
|
+
CodeGroupNum?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parameters to update an insplan.
|
|
52
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
53
|
+
*/
|
|
54
|
+
export interface UpdateBenefitParams {
|
|
55
|
+
BenefitNum: number;
|
|
56
|
+
CovCatNum?: number;
|
|
57
|
+
BenefitType?: "ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod";
|
|
58
|
+
Percent?: number;
|
|
59
|
+
MonetaryAmt?: number;
|
|
60
|
+
TimePeriod?: "None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months";
|
|
61
|
+
QuantityQualifier?: "None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months";
|
|
62
|
+
Quantity?: number;
|
|
63
|
+
CodeNum?: number;
|
|
64
|
+
procCode?: string;
|
|
65
|
+
CoverageLevel?: "None" | "Individual" | "Family";
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=benefitTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benefitTypes.d.ts","sourceRoot":"","sources":["../../src/types/benefitTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,eAAe,CAAC;IAC7H,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,sBAAsB,CAAC;IACrG,iBAAiB,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,eAAe,CAAC;IAC5H,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,sBAAsB,CAAC;IACrG,iBAAiB,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,eAAe,CAAC;IAC7H,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,sBAAsB,CAAC;IACrG,iBAAiB,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC;CAClD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
3
|
+
*/
|
|
4
|
+
export interface InsPlan {
|
|
5
|
+
PlanNum?: number;
|
|
6
|
+
GroupName?: string;
|
|
7
|
+
GroupNum?: string;
|
|
8
|
+
PlanNote?: string;
|
|
9
|
+
FeeSched?: number;
|
|
10
|
+
PlanType?: "" | "p" | "f" | "c";
|
|
11
|
+
ClaimFormNum?: number;
|
|
12
|
+
CopayFeeSched?: number;
|
|
13
|
+
EmployerNum?: number;
|
|
14
|
+
CarrierNum?: number;
|
|
15
|
+
CodeSubstNone?: "true" | "false";
|
|
16
|
+
IsHidden?: "true" | "false";
|
|
17
|
+
MonthRenew?: number;
|
|
18
|
+
SecUserNumEntry?: number;
|
|
19
|
+
SecDateEntry?: string;
|
|
20
|
+
SecDateTEdit?: string;
|
|
21
|
+
IsBlueBookEnabled?: "true" | "false";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Gets a list of PatPlans that meet a set of search criteria.
|
|
25
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
26
|
+
*/
|
|
27
|
+
export interface GetInsPlansParams {
|
|
28
|
+
PlanType?: "percentage" | "p" | "f" | "c";
|
|
29
|
+
CarrierNum?: number;
|
|
30
|
+
Offset?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parameters for creating a new insplan.
|
|
34
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
35
|
+
*/
|
|
36
|
+
export interface CreateInsPlanParams {
|
|
37
|
+
CarrierNum: number;
|
|
38
|
+
GroupName?: string;
|
|
39
|
+
GroupNum?: string;
|
|
40
|
+
PlanNote?: string;
|
|
41
|
+
FeeSched?: number;
|
|
42
|
+
PlanType?: "" | "p" | "f" | "c";
|
|
43
|
+
CopayFeeSched?: number;
|
|
44
|
+
EmployerNum?: number;
|
|
45
|
+
CodeSubstNone?: "true" | "false";
|
|
46
|
+
IsHidden?: "true" | "false";
|
|
47
|
+
MonthRenew?: number;
|
|
48
|
+
IsBlueBookEnabled?: "true" | "false";
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parameters to update an insplan.
|
|
52
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
53
|
+
*/
|
|
54
|
+
export interface UpdateInsPlanParams {
|
|
55
|
+
PlanNum: number;
|
|
56
|
+
GroupName?: string;
|
|
57
|
+
GroupNum?: string;
|
|
58
|
+
PlanNote?: string;
|
|
59
|
+
FeeSched?: number;
|
|
60
|
+
PlanType?: "" | "p" | "f" | "c";
|
|
61
|
+
CopayFeeSched?: number;
|
|
62
|
+
EmployerNum?: number;
|
|
63
|
+
CarrierNum: number;
|
|
64
|
+
CodeSubstNone?: "true" | "false";
|
|
65
|
+
IsHidden?: "true" | "false";
|
|
66
|
+
MonthRenew?: number;
|
|
67
|
+
IsBlueBookEnabled?: "true" | "false";
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=insPlanTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insPlanTypes.d.ts","sourceRoot":"","sources":["../../src/types/insPlanTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,OAAO;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtC"}
|
package/package.json
CHANGED
package/release.sh
CHANGED
|
@@ -41,5 +41,5 @@ gh release create "$NEW_TAG" --title "Release $NEW_TAG" --notes "$COMMIT_MSG"
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
#example ./release.sh "Some commit message" patch
|
|
44
|
-
#example ./release.sh "
|
|
44
|
+
#example ./release.sh "Added insplans and benefits" minor
|
|
45
45
|
#example ./release.sh "Some commit message" major
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Benefit,
|
|
4
|
+
GetBenefitsParams,
|
|
5
|
+
CreateBenefitParams,
|
|
6
|
+
UpdateBenefitParams,
|
|
7
|
+
} from "../types/benefitTypes";
|
|
8
|
+
|
|
9
|
+
export default class Benefits {
|
|
10
|
+
private httpClient: HttpClient;
|
|
11
|
+
|
|
12
|
+
constructor(httpClient: HttpClient) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch multiple benefits with optional filtering and pagination.
|
|
18
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
19
|
+
* @param {number} [params.PlanNum] - FK to InsPlan.PlanNum.
|
|
20
|
+
* @param {number} [params.PatPlanNum] - FK to PatPlan.PatPlanNum.
|
|
21
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
22
|
+
* @returns {Promise<Benefit[]>} - A list of benefits.
|
|
23
|
+
*/
|
|
24
|
+
public async getBenefits({
|
|
25
|
+
PlanNum,
|
|
26
|
+
PatPlanNum,
|
|
27
|
+
Offset,
|
|
28
|
+
}: GetBenefitsParams = {}): Promise<Benefit[]> {
|
|
29
|
+
const params = {
|
|
30
|
+
PlanNum,
|
|
31
|
+
PatPlanNum,
|
|
32
|
+
Offset,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return this.httpClient.get<Benefit[]>("/benefits", params);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* This adds a Benefit row to the database.
|
|
40
|
+
* @param {Object} data - The details of the Benefit to create.
|
|
41
|
+
* @param {number} data.PlanNum - This or PatPlanNum is required. FK to InsPlan.PlanNum.
|
|
42
|
+
* @param {number} data.PatPlanNum - This or PlanNum is required. FK to PatPlan.PlanNum.
|
|
43
|
+
* @param {"ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"} data.BenefitType - Required. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
44
|
+
* @param {"None" | "Individual" | "Family"} data.CoverageLevel - Required. Either "None", "Individual", or "Family".
|
|
45
|
+
* @param {number} [data.CovCatNum] - Optional. FK to covcat.CovCatNum.
|
|
46
|
+
* @param {number} [data.Percent] - Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
47
|
+
* @param {number} [data.MonetaryAmt] - Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
48
|
+
* @param {"None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"} [data.TimePeriod] - Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
49
|
+
* @param {"None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"} [data.QuantityQualifier] - Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
50
|
+
* @param {number} [data.Quantity] - Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
51
|
+
* @param {number} [data.CodeNum] - Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified. Default 0.
|
|
52
|
+
* @param {string} [data.procCode] - Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0. Default empty string.
|
|
53
|
+
* @param {number} [data.CodeGroupNum] - Optional. (Added in version 23.2.62) FK to codegroup.CodeGroupNum. The group of procedure codes that apply to this Frequency Limitation benefit.
|
|
54
|
+
* @returns {Promise<Benefit>} - The created a benefit.
|
|
55
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
56
|
+
*/
|
|
57
|
+
public async createBenefit({
|
|
58
|
+
PlanNum,
|
|
59
|
+
PatPlanNum,
|
|
60
|
+
BenefitType,
|
|
61
|
+
CoverageLevel,
|
|
62
|
+
CovCatNum,
|
|
63
|
+
Percent,
|
|
64
|
+
MonetaryAmt,
|
|
65
|
+
TimePeriod,
|
|
66
|
+
QuantityQualifier,
|
|
67
|
+
Quantity,
|
|
68
|
+
CodeNum,
|
|
69
|
+
procCode,
|
|
70
|
+
CodeGroupNum,
|
|
71
|
+
} : CreateBenefitParams): Promise<Benefit> {
|
|
72
|
+
if (!BenefitType || !CoverageLevel) {
|
|
73
|
+
throw new Error("Invalid data: Either PlanNum or PatPlanNum and BenefitType and CoverageLevel are required.");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return this.httpClient.post<Benefit>("/benefits", {
|
|
77
|
+
PlanNum,
|
|
78
|
+
PatPlanNum,
|
|
79
|
+
BenefitType,
|
|
80
|
+
CoverageLevel,
|
|
81
|
+
CovCatNum,
|
|
82
|
+
Percent,
|
|
83
|
+
MonetaryAmt,
|
|
84
|
+
TimePeriod,
|
|
85
|
+
QuantityQualifier,
|
|
86
|
+
Quantity,
|
|
87
|
+
CodeNum,
|
|
88
|
+
procCode,
|
|
89
|
+
CodeGroupNum,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Update a Benefit.
|
|
95
|
+
* @param {Object} data - The details of Benefit to update.
|
|
96
|
+
* @param {number} data.BenefitNum - Required. PK
|
|
97
|
+
* @param {number} [data.CovCatNum] - Optional. FK to covcat.CovCatNum.
|
|
98
|
+
* @param {"ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"} [data.BenefitType] - Optional. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
99
|
+
* @param {number} [data.Percent] - Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
100
|
+
* @param {number} [data.MonetaryAmt] - Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
101
|
+
* @param {"None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"} [data.TimePeriod] - Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
102
|
+
* @param {"None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"} [data.QuantityQualifier] - Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
103
|
+
* @param {number} [data.Quantity] - Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
104
|
+
* @param {number} [data.CodeNum] - Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified.
|
|
105
|
+
* @param {string} [data.procCode] - Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0.
|
|
106
|
+
* @param {"None" | "Individual" | "Family"} [data.CoverageLevel] - Optional. Either "None", "Individual", or "Family".
|
|
107
|
+
* @returns {Promise<Benefit>} - The updated Benefit.
|
|
108
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
109
|
+
*/
|
|
110
|
+
public async updateBenefit({
|
|
111
|
+
BenefitNum,
|
|
112
|
+
CovCatNum,
|
|
113
|
+
BenefitType,
|
|
114
|
+
Percent,
|
|
115
|
+
MonetaryAmt,
|
|
116
|
+
TimePeriod,
|
|
117
|
+
QuantityQualifier,
|
|
118
|
+
Quantity,
|
|
119
|
+
CodeNum,
|
|
120
|
+
procCode,
|
|
121
|
+
CoverageLevel,
|
|
122
|
+
} : UpdateBenefitParams): Promise<Benefit> {
|
|
123
|
+
if (!BenefitNum || typeof BenefitNum !== "number") {
|
|
124
|
+
throw new Error("Invalid data: A Valid BenefitNum is required.");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return this.httpClient.put<Benefit>(`/benefits/${BenefitNum}`, {
|
|
128
|
+
CovCatNum,
|
|
129
|
+
BenefitType,
|
|
130
|
+
Percent,
|
|
131
|
+
MonetaryAmt,
|
|
132
|
+
TimePeriod,
|
|
133
|
+
QuantityQualifier,
|
|
134
|
+
Quantity,
|
|
135
|
+
CodeNum,
|
|
136
|
+
procCode,
|
|
137
|
+
CoverageLevel,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Delete a Benefit entry.
|
|
143
|
+
* This removes a Benefit row from the database.
|
|
144
|
+
* @param {number} BenefitNum - Required: The unique identifier of the Benefit to delete.
|
|
145
|
+
* @returns {Promise<void>} - Resolves when the Benefit is deleted.
|
|
146
|
+
* @throws {Error} - If `BenefitNum` is not valid or the API returns an error.
|
|
147
|
+
*/
|
|
148
|
+
public async deletePatPlan(BenefitNum: number): Promise<void> {
|
|
149
|
+
if (!BenefitNum || typeof BenefitNum !== "number") {
|
|
150
|
+
throw new Error("Invalid parameter: BenefitNum must be a valid number.");
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return this.httpClient.delete<void>(`/benefits/${BenefitNum}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
InsPlan,
|
|
4
|
+
GetInsPlansParams,
|
|
5
|
+
CreateInsPlanParams,
|
|
6
|
+
UpdateInsPlanParams,
|
|
7
|
+
} from "../types/insPlanTypes";
|
|
8
|
+
|
|
9
|
+
export default class InsPlans {
|
|
10
|
+
private httpClient: HttpClient;
|
|
11
|
+
|
|
12
|
+
constructor(httpClient: HttpClient) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch a single insplan by its ID.
|
|
18
|
+
* @param {number} PlanNum - The ID of the insplan.
|
|
19
|
+
* @returns {Promise<InsPlan>} - The insplan data.
|
|
20
|
+
* @throws {Error} - If `InsPlan` is not valid or the API returns an error.
|
|
21
|
+
*/
|
|
22
|
+
public async getInsPlan(PlanNum: number): Promise<InsPlan> {
|
|
23
|
+
if (!PlanNum || typeof PlanNum !== "number") {
|
|
24
|
+
throw new Error("Invalid parameter: PlanNum must be a valid number.");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return await this.httpClient.get<InsPlan>(`/insplans/${PlanNum}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Fetch multiple insplans with optional filtering and pagination.
|
|
33
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
34
|
+
* @param {"percentage" | "p" | "f" | "c" } [params.PlanType] - Must be one of the following: "percentage" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c" (Capitation). Percentage PlanTypes are stored as blank in the database.
|
|
35
|
+
* @param {number} [params.CarrierNum] - FK to carrier.CarrierNum.
|
|
36
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
37
|
+
* @returns {Promise<InsPlan[]>} - A list of InsPlans.
|
|
38
|
+
*/
|
|
39
|
+
public async getInsPlans({
|
|
40
|
+
PlanType,
|
|
41
|
+
CarrierNum,
|
|
42
|
+
Offset,
|
|
43
|
+
}: GetInsPlansParams = {}): Promise<InsPlan[]> {
|
|
44
|
+
const params = {
|
|
45
|
+
PlanType,
|
|
46
|
+
CarrierNum,
|
|
47
|
+
Offset,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return this.httpClient.get<InsPlan[]>("/insplans", params);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* This adds an InsPlan row to the database.
|
|
55
|
+
* @param {Object} data - The details of the insplan to create.
|
|
56
|
+
* @param {number} data.CarrierNum - Required. FK to carrier.CarrierNum.
|
|
57
|
+
* @param {string} [data.GroupName] - Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
58
|
+
* @param {string} [data.GroupNum] - Optional. The carrier assigned identifier, unique for each plan.
|
|
59
|
+
* @param {string} [data.PlanNote] - Optional. Note for this plan. Same for all subscribers.
|
|
60
|
+
* @param {number} [data.FeeSched] - Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
61
|
+
* @param {"" | "p" | "f" | "c"} [data.PlanType] - Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
62
|
+
* @param {number} [data.CopayFeeSched] - Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
63
|
+
* @param {number} [data.EmployerNum] - Optional. FK to employer.EmployerNum. Default 0.
|
|
64
|
+
* @param {"true" | "false"} [data.CodeSubstNone] - Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
65
|
+
* @param {"true" | "false"} [data.IsHidden] - ?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
66
|
+
* @param {number} [data.MonthRenew] - Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
67
|
+
* @param {"true" | "false"} [data.IsBlueBookEnabled] - Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
68
|
+
* @returns {Promise<InsPlan>} - The created insplan.
|
|
69
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
70
|
+
*/
|
|
71
|
+
public async createInsPlan({
|
|
72
|
+
CarrierNum,
|
|
73
|
+
GroupName,
|
|
74
|
+
GroupNum,
|
|
75
|
+
PlanNote,
|
|
76
|
+
FeeSched,
|
|
77
|
+
PlanType,
|
|
78
|
+
CopayFeeSched,
|
|
79
|
+
EmployerNum,
|
|
80
|
+
CodeSubstNone,
|
|
81
|
+
IsHidden,
|
|
82
|
+
MonthRenew,
|
|
83
|
+
IsBlueBookEnabled,
|
|
84
|
+
} : CreateInsPlanParams): Promise<InsPlan> {
|
|
85
|
+
if (!CarrierNum) {
|
|
86
|
+
throw new Error("Invalid data: CarrierNum is required.");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return this.httpClient.post<InsPlan>("/insplans", {
|
|
90
|
+
CarrierNum,
|
|
91
|
+
GroupName,
|
|
92
|
+
GroupNum,
|
|
93
|
+
PlanNote,
|
|
94
|
+
FeeSched,
|
|
95
|
+
PlanType,
|
|
96
|
+
CopayFeeSched,
|
|
97
|
+
EmployerNum,
|
|
98
|
+
CodeSubstNone,
|
|
99
|
+
IsHidden,
|
|
100
|
+
MonthRenew,
|
|
101
|
+
IsBlueBookEnabled,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Update a InsPlan.
|
|
107
|
+
* @param {Object} data - The details of InsPlan to update.
|
|
108
|
+
* @param {number} data.PlanNum - Required. Primary key.
|
|
109
|
+
* @param {string} [data.GroupName] - Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
110
|
+
* @param {string} [data.GroupNum] - Optional. The carrier assigned identifier, unique for each plan.
|
|
111
|
+
* @param {string} [data.PlanNote] - Optional. Note for this plan. Same for all subscribers.
|
|
112
|
+
* @param {number} [data.FeeSched] - Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
113
|
+
* @param {"" | "p" | "f" | "c"} [data.PlanType] - Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
114
|
+
* @param {number} [data.CopayFeeSched] - Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
115
|
+
* @param {number} [data.EmployerNum] - Optional. FK to employer.EmployerNum. Default 0.
|
|
116
|
+
* @param {number} [data.CarrierNum] - Optional. FK to carrier.CarrierNum.
|
|
117
|
+
* @param {"true" | "false"} [data.CodeSubstNone] - Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
118
|
+
* @param {"true" | "false"} [data.IsHidden] - ?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
119
|
+
* @param {number} [data.MonthRenew] - Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
120
|
+
* @param {"true" | "false"} [data.IsBlueBookEnabled] - Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
121
|
+
* @returns {Promise<InsPlan>} - The updated InsPlan.
|
|
122
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
123
|
+
*/
|
|
124
|
+
public async updateInsPlan({
|
|
125
|
+
PlanNum,
|
|
126
|
+
GroupName,
|
|
127
|
+
GroupNum,
|
|
128
|
+
PlanNote,
|
|
129
|
+
FeeSched,
|
|
130
|
+
PlanType,
|
|
131
|
+
CopayFeeSched,
|
|
132
|
+
EmployerNum,
|
|
133
|
+
CarrierNum,
|
|
134
|
+
CodeSubstNone,
|
|
135
|
+
IsHidden,
|
|
136
|
+
MonthRenew,
|
|
137
|
+
IsBlueBookEnabled,
|
|
138
|
+
} : UpdateInsPlanParams): Promise<InsPlan> {
|
|
139
|
+
if (!PlanNum || typeof PlanNum !== "number") {
|
|
140
|
+
throw new Error("Invalid data: A Valid PlanNum is required.");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return this.httpClient.put<InsPlan>(`/insplans/${PlanNum}`, {
|
|
144
|
+
GroupName,
|
|
145
|
+
GroupNum,
|
|
146
|
+
PlanNote,
|
|
147
|
+
FeeSched,
|
|
148
|
+
PlanType,
|
|
149
|
+
CopayFeeSched,
|
|
150
|
+
EmployerNum,
|
|
151
|
+
CarrierNum,
|
|
152
|
+
CodeSubstNone,
|
|
153
|
+
IsHidden,
|
|
154
|
+
MonthRenew,
|
|
155
|
+
IsBlueBookEnabled,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
package/src/api/patPlans.ts
CHANGED
|
@@ -97,10 +97,10 @@ export default class PatPlans {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* Delete
|
|
100
|
+
* Delete a PatPlan entry.
|
|
101
101
|
* This is called "Drop" in the Open Dental UI. This removes a PatPlan row from the database, indicating no coverage, but does not affect the InsPlan itself.
|
|
102
102
|
* @param {number} PatPlanNum - Required: The unique identifier of the inssub to delete.
|
|
103
|
-
* @returns {Promise<void>} - Resolves when the
|
|
103
|
+
* @returns {Promise<void>} - Resolves when the PatPlan is deleted.
|
|
104
104
|
* @throws {Error} - If `PatPlanNum` is not valid or the API returns an error.
|
|
105
105
|
*/
|
|
106
106
|
public async deletePatPlan(PatPlanNum: number): Promise<void> {
|
package/src/openDental.ts
CHANGED
|
@@ -19,6 +19,8 @@ import PatPlans from "./api/patPlans";
|
|
|
19
19
|
import LabCases from "./api/labCases";
|
|
20
20
|
import Referrals from "./api/referrals";
|
|
21
21
|
import RefAttaches from "./api/refAttaches";
|
|
22
|
+
import InsPlans from "./api/insPlans";
|
|
23
|
+
import Benefits from "./api/benefits";
|
|
22
24
|
|
|
23
25
|
class OpenDental {
|
|
24
26
|
private static httpClient: HttpClient;
|
|
@@ -237,6 +239,26 @@ class OpenDental {
|
|
|
237
239
|
}
|
|
238
240
|
return new RefAttaches(this.httpClient);
|
|
239
241
|
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Create a new instance of the LabCases API.
|
|
245
|
+
*/
|
|
246
|
+
public static InsPlans() {
|
|
247
|
+
if (!this.httpClient) {
|
|
248
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
249
|
+
}
|
|
250
|
+
return new InsPlans(this.httpClient);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Create a new instance of the LabCases API.
|
|
255
|
+
*/
|
|
256
|
+
public static Benefits() {
|
|
257
|
+
if (!this.httpClient) {
|
|
258
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
259
|
+
}
|
|
260
|
+
return new Benefits(this.httpClient);
|
|
261
|
+
}
|
|
240
262
|
}
|
|
241
263
|
|
|
242
264
|
export { OpenDental };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
3
|
+
*/
|
|
4
|
+
export interface Benefit {
|
|
5
|
+
BenefitNum?: number; // Primary Key
|
|
6
|
+
PlanNum?: number; // FK to InsPlan.PlanNum.
|
|
7
|
+
PatPlanNum?: number; // FK to PatPlan.PlanNum.
|
|
8
|
+
CovCatNum?: number; // FK to covcat.CovCatNum.
|
|
9
|
+
BenefitType?: "ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"; // Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
10
|
+
Percent?: number; // Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
11
|
+
MonetaryAmt?: number; // Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
12
|
+
TimePeriod?: "None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"; // Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
13
|
+
QuantityQualifier?: "None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"; // Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
14
|
+
Quantity?: number; // Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
15
|
+
CodeNum?: number; // FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified. Default 0.
|
|
16
|
+
procCode?: string; // FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0. Default empty string.
|
|
17
|
+
CoverageLevel?: "None" | "Individual" | "Family"; // Either "None", "Individual", or "Family".
|
|
18
|
+
SecDateTEntry?: string; // String in "yyyy-MM-dd HH:mm:ss" format
|
|
19
|
+
SecDateTEdit?: string; // String in "yyyy-MM-dd HH:mm:ss" format
|
|
20
|
+
CodeGroupNum?: number; // (Added in version 23.2.62) FK to codegroup.CodeGroupNum. The group of procedure codes that apply to this Frequency Limitation benefit.
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Gets a list of PatPlans that meet a set of search criteria.
|
|
25
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
26
|
+
*/
|
|
27
|
+
export interface GetBenefitsParams {
|
|
28
|
+
PlanNum?: number; // FK to InsPlan.PlanNum.
|
|
29
|
+
PatPlanNum?: number; // FK to PatPlan.PatPlanNum.
|
|
30
|
+
Offset?: number; // Pagination offset for results
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Parameters for creating a new insplan.
|
|
35
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
36
|
+
*/
|
|
37
|
+
export interface CreateBenefitParams {
|
|
38
|
+
PlanNum?: number; // This or PatPlanNum is required. FK to InsPlan.PlanNum.
|
|
39
|
+
PatPlanNum?: number; // This or PlanNum is required. FK to PatPlan.PlanNum.
|
|
40
|
+
BenefitType: "ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"; // Required. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
41
|
+
CoverageLevel: "None" | "Individual" | "Family"; // Required. Either "None", "Individual", or "Family".
|
|
42
|
+
CovCatNum?: number; // Optional. FK to covcat.CovCatNum.
|
|
43
|
+
Percent?: number; // Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
44
|
+
MonetaryAmt?: number; // Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
45
|
+
TimePeriod?: "None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"; // Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
46
|
+
QuantityQualifier?: "None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"; // Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
47
|
+
Quantity?: number; // Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
48
|
+
CodeNum?: number; // Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified. Default 0.
|
|
49
|
+
procCode?: string; // Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0. Default empty string.
|
|
50
|
+
CodeGroupNum?: number; // Optional. (Added in version 23.2.62) FK to codegroup.CodeGroupNum. The group of procedure codes that apply to this Frequency Limitation benefit.
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Parameters to update an insplan.
|
|
55
|
+
* @see https://www.opendental.com/site/apibenefits.html
|
|
56
|
+
*/
|
|
57
|
+
export interface UpdateBenefitParams {
|
|
58
|
+
BenefitNum: number; // Required in URL. Primary Key.
|
|
59
|
+
CovCatNum?: number; // Optional. FK to covcat.CovCatNum.
|
|
60
|
+
BenefitType?: "ActiveCoverage" | "CoInsurance" | "Deductible" | "CoPayment" | "Exclusions" | "Limitations" | "WaitingPeriod"; // Optional. Either "ActiveCoverage", "CoInsurance", "Deductible", "CoPayment", "Exclusions", "Limitations", or "WaitingPeriod".
|
|
61
|
+
Percent?: number; // Optional. Only allowed if BenefitType is "CoInsurance". Must be a value between 0 and 100. Default -1 (Indicating empty).
|
|
62
|
+
MonetaryAmt?: number; // Optional. Only used if BenefitType is "CoPayment", "Limitations", or "Deductible". Default -1.0 (Indicating empty).
|
|
63
|
+
TimePeriod?: "None" | "ServiceYear" | "CalendarYear" | "Lifetime" | "Years" | "NumberInLast12Months"; // Optional. Either "None", "ServiceYear", "CalendarYear", "Lifetime", "Years", or "NumberInLast12Months". Default "CalendarYear".
|
|
64
|
+
QuantityQualifier?: "None" | "NumberOfServices" | "AgeLimit" | "Visits" | "Years" | "Months"; // Optional. Either "None", "NumberOfServices", "AgeLimit", "Visits", "Years", or "Months". Default "None". Must be "Months" or "Years" if BenefitType is "WaitingPeriod".
|
|
65
|
+
Quantity?: number; // Optional. Must be a value between 0 and 100. Default 0. Must be a value greater than 0 if QuantityQualifier is "AgeLimit".
|
|
66
|
+
CodeNum?: number; // Optional. FK to procedurecode.CodeNum. Only allowed if CovCatNum is 0. Will be used over procCode if both are specified.
|
|
67
|
+
procCode?: string; // Optional. FK to procedurecode.ProcCode. Only allowed if CovCatNum is 0. Default empty string.
|
|
68
|
+
CoverageLevel?: "None" | "Individual" | "Family"; // Optional. Either "None", "Individual", or "Family".
|
|
69
|
+
}
|
|
70
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
3
|
+
*/
|
|
4
|
+
export interface InsPlan {
|
|
5
|
+
PlanNum?: number; // PK
|
|
6
|
+
GroupName?: string; // Typically the same as the employer. Used to identify difference in plans.
|
|
7
|
+
GroupNum?: string; //
|
|
8
|
+
PlanNote?: string; // Note for this plan. Same for all subscribers.
|
|
9
|
+
FeeSched?: number; // FK to feesched.FeeSchedNum. Default 0.
|
|
10
|
+
PlanType?: "" | "p" | "f" | "c"; // Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c".
|
|
11
|
+
ClaimFormNum?: number; // A patient ID which will override the subscriber ID on eclaims. Also used for Canada.
|
|
12
|
+
CopayFeeSched?: number; // FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
13
|
+
EmployerNum?: number; // FK to employer.EmployerNum. Default 0.
|
|
14
|
+
CarrierNum?: number; // FK to carrier.CarrierNum.
|
|
15
|
+
CodeSubstNone?: "true" | "false"; // Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
16
|
+
IsHidden?: "true" | "false"; // Either "true" or "false". Default "false".
|
|
17
|
+
MonthRenew?: number; // The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
18
|
+
SecUserNumEntry?: number; //
|
|
19
|
+
SecDateEntry?: string; // String in "yyyy-MM-dd" format
|
|
20
|
+
SecDateTEdit?: string; // String in "yyyy-MM-dd HH:mm:ss" format
|
|
21
|
+
IsBlueBookEnabled?: "true" | "false"; // Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Gets a list of PatPlans that meet a set of search criteria.
|
|
26
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
27
|
+
*/
|
|
28
|
+
export interface GetInsPlansParams {
|
|
29
|
+
PlanType?: "percentage" | "p" | "f" | "c"; // Must be one of the following: "percentage" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c" (Capitation). Percentage PlanTypes are stored as blank in the database.
|
|
30
|
+
CarrierNum?: number; // FK to carrier.CarrierNum.
|
|
31
|
+
Offset?: number; // Pagination offset for results
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Parameters for creating a new insplan.
|
|
36
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
37
|
+
*/
|
|
38
|
+
export interface CreateInsPlanParams {
|
|
39
|
+
CarrierNum: number; // Required. FK to carrier.CarrierNum.
|
|
40
|
+
GroupName?: string; // Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
41
|
+
GroupNum?: string; // Optional. The carrier assigned identifier, unique for each plan.
|
|
42
|
+
PlanNote?: string; // Optional. Note for this plan. Same for all subscribers.
|
|
43
|
+
FeeSched?: number; // Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
44
|
+
PlanType?: "" | "p" | "f" | "c"; // Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
45
|
+
CopayFeeSched?: number; // Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
46
|
+
EmployerNum?: number; // Optional. FK to employer.EmployerNum. Default 0.
|
|
47
|
+
CodeSubstNone?: "true" | "false"; // Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
48
|
+
IsHidden?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
49
|
+
MonthRenew?: number; // Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
50
|
+
IsBlueBookEnabled?: "true" | "false"; // Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Parameters to update an insplan.
|
|
55
|
+
* @see https://www.opendental.com/site/apiinsplans.html
|
|
56
|
+
*/
|
|
57
|
+
export interface UpdateInsPlanParams {
|
|
58
|
+
PlanNum: number; // Required. PK
|
|
59
|
+
GroupName?: string; // Optional. Typically the same as the employer. Used to identify difference in plans.
|
|
60
|
+
GroupNum?: string; // Optional. The carrier assigned identifier, unique for each plan.
|
|
61
|
+
PlanNote?: string; // Optional. Note for this plan. Same for all subscribers.
|
|
62
|
+
FeeSched?: number; // Optional. FK to feesched.FeeSchedNum. Default 0.
|
|
63
|
+
PlanType?: "" | "p" | "f" | "c"; // Optional. Either "" (Percentage), "p" (PPO Percentage), "f" (Flat Copay), or "c". Default is "" (Percentage).
|
|
64
|
+
CopayFeeSched?: number; // Optional. FK to feesched.FeeSchedNum when FeeSchedType is CoPay. Typically only used for capitation or copay plans. Default 0.
|
|
65
|
+
EmployerNum?: number; // Optional. FK to employer.EmployerNum. Default 0.
|
|
66
|
+
CarrierNum: number; // Optional. FK to carrier.CarrierNum.
|
|
67
|
+
CodeSubstNone?: "true" | "false"; // Optional. Either "true" or "false". Set "true" if this Insurance Plan should ignore any Substitution Codes. Default "false".
|
|
68
|
+
IsHidden?: "true" | "false"; // Optional. Either "true" or "false". Default "false".
|
|
69
|
+
MonthRenew?: number; // Optional. The month, 1-12, when the insurance plan renews. It will renew on the first of the month. Default 0 to indicate calendar year.
|
|
70
|
+
IsBlueBookEnabled?: "true" | "false"; // Optional. Determines if the plan utilizes BlueBook or not. Cannot be set to true if PlanType is set to anything other than "" (Percentage). Defaults to true if AllowedFeeSchedsAutomate is set to BlueBook, otherwise defaults to false.
|
|
71
|
+
}
|
|
72
|
+
|