@rinse-dental/open-dental 1.1.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.
Files changed (41) hide show
  1. package/dist/api/benefits.d.ts +62 -0
  2. package/dist/api/benefits.d.ts.map +1 -0
  3. package/dist/api/benefits.js +111 -0
  4. package/dist/api/insPlans.d.ts +62 -0
  5. package/dist/api/insPlans.d.ts.map +1 -0
  6. package/dist/api/insPlans.js +112 -0
  7. package/dist/api/patPlans.d.ts +2 -2
  8. package/dist/api/patPlans.js +2 -2
  9. package/dist/api/refAttaches.d.ts +57 -0
  10. package/dist/api/refAttaches.d.ts.map +1 -0
  11. package/dist/api/refAttaches.js +102 -0
  12. package/dist/api/referrals.d.ts +84 -0
  13. package/dist/api/referrals.d.ts.map +1 -0
  14. package/dist/api/referrals.js +156 -0
  15. package/dist/openDental.d.ts +22 -1
  16. package/dist/openDental.d.ts.map +1 -1
  17. package/dist/openDental.js +42 -1
  18. package/dist/types/benefitTypes.d.ts +67 -0
  19. package/dist/types/benefitTypes.d.ts.map +1 -0
  20. package/dist/types/benefitTypes.js +2 -0
  21. package/dist/types/insPlanTypes.d.ts +69 -0
  22. package/dist/types/insPlanTypes.d.ts.map +1 -0
  23. package/dist/types/insPlanTypes.js +2 -0
  24. package/dist/types/refAttachTypes.d.ts +59 -0
  25. package/dist/types/refAttachTypes.d.ts.map +1 -0
  26. package/dist/types/refAttachTypes.js +2 -0
  27. package/dist/types/referralTypes.d.ts +98 -0
  28. package/dist/types/referralTypes.d.ts.map +1 -0
  29. package/dist/types/referralTypes.js +2 -0
  30. package/package.json +1 -1
  31. package/release.sh +1 -1
  32. package/src/api/benefits.ts +155 -0
  33. package/src/api/insPlans.ts +158 -0
  34. package/src/api/patPlans.ts +2 -2
  35. package/src/api/refAttaches.ts +142 -0
  36. package/src/api/referrals.ts +222 -0
  37. package/src/openDental.ts +45 -1
  38. package/src/types/benefitTypes.ts +70 -0
  39. package/src/types/insPlanTypes.ts +72 -0
  40. package/src/types/refAttachTypes.ts +63 -0
  41. package/src/types/referralTypes.ts +102 -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;
@@ -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 an PatPlan entry.
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 discount plan sub is deleted.
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>;
@@ -67,10 +67,10 @@ class PatPlans {
67
67
  });
68
68
  }
69
69
  /**
70
- * Delete an PatPlan entry.
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 discount plan sub is deleted.
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) {
@@ -0,0 +1,57 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import { RefAttach, GetRefAttachesParams, CreateRefAttachParams, UpdateRefAttachParams } from "../types/refAttachTypes";
3
+ export default class RefAttaches {
4
+ private httpClient;
5
+ constructor(httpClient: HttpClient);
6
+ /**
7
+ * Fetch multiple refattaches with optional filtering and pagination.
8
+ * @param {Object} params - The parameters for filtering and pagination.
9
+ * @param {number} [params.PatNum] - The PatNum of the RefAttaches.
10
+ * @param {number} [params.Offset] - Pagination offset for results.
11
+ * @returns {Promise<RefAttach[]>} - A list of inssubs.
12
+ */
13
+ getRefAttaches({ PatNum, Offset, }?: GetRefAttachesParams): Promise<RefAttach[]>;
14
+ /**
15
+ * Attach a referral to a patient.
16
+ * @param {Object} data - The details of RefAttach to create.
17
+ * @param {number} data.PatNum - Required. FK to patient.PatNum.
18
+ * @param {number} [data.ReferralNum] - Required. The PatNum of the patient who is subscribed to this plan.
19
+ * @param {string} [data.referralName] - Required. Number assigned by insurance company.
20
+ * @param {string} [data.RefDate] - Optional. The date this InsPlan became effective.
21
+ * @param {"RefTo" | "RefFrom" | "RefCustom"} [data.ReferralType] - Optional. Not usually used. The date this InsPlan was terminated.
22
+ * @param {"None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete"} [data.RefToStatus] - Optional. BenefitNotes are specifically designed to store automated notes. For example, when automatically requesting benefits through Trojan. Benefits are stored here in text form for later reference. Not at plan level because might be specific to subscriber. If blank, it may display a benefitNote for another subscriber to the plan.
23
+ * @param {string} [data.Note] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
24
+ * @param {"true" | "false"} [data.IsTransitionOfCare] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
25
+ * @param {number} [data.ProcNum] - Optional. Use to store any other info that affects coverage.
26
+ * @param {string} [data.DateProcComplete] - Optional. Use to store any other info that affects coverage.
27
+ * @param {number} [data.ProvNum] - Optional. Use to store any other info that affects coverage.
28
+ * @returns {Promise<RefAttach>} - The created refattaches.
29
+ * @throws {Error} - If required fields are missing or the API returns an error.
30
+ */
31
+ createRefAttach({ PatNum, ReferralNum, referralName, RefDate, ReferralType, RefToStatus, Note, IsTransitionOfCare, ProcNum, DateProcComplete, ProvNum, }: CreateRefAttachParams): Promise<RefAttach>;
32
+ /**
33
+ * Update a refattach.
34
+ * @param {Object} data - The details of RefAttach to create.
35
+ * @param {number} data.RefAttachNum - Required. FK to patient.PatNum.
36
+ * @param {number} [data.ReferralNum] - Required. The PatNum of the patient who is subscribed to this plan.
37
+ * @param {string} [data.RefDate] - Optional. The date this InsPlan became effective.
38
+ * @param {"RefTo" | "RefFrom" | "RefCustom"} [data.ReferralType] - Optional. Not usually used. The date this InsPlan was terminated.
39
+ * @param {"None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete"} [data.RefToStatus] - Optional. BenefitNotes are specifically designed to store automated notes. For example, when automatically requesting benefits through Trojan. Benefits are stored here in text form for later reference. Not at plan level because might be specific to subscriber. If blank, it may display a benefitNote for another subscriber to the plan.
40
+ * @param {string} [data.Note] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
41
+ * @param {"true" | "false"} [data.IsTransitionOfCare] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
42
+ * @param {number} [data.ProcNum] - Optional. Use to store any other info that affects coverage.
43
+ * @param {string} [data.DateProcComplete] - Optional. Use to store any other info that affects coverage.
44
+ * @param {number} [data.ProvNum] - Optional. Use to store any other info that affects coverage.
45
+ * @returns {Promise<RefAttach>} - The created refattaches.
46
+ * @throws {Error} - If required fields are missing or the API returns an error.
47
+ */
48
+ updateRefAttach({ RefAttachNum, ReferralNum, RefDate, ReferralType, RefToStatus, Note, IsTransitionOfCare, ProcNum, DateProcComplete, ProvNum, }: UpdateRefAttachParams): Promise<RefAttach>;
49
+ /**
50
+ * Delete a refattach.
51
+ * @param {number} RefAttachNum - Required: The unique identifier of the RefAttach to delete.
52
+ * @returns {Promise<void>} - Resolves when the discount plan sub is deleted.
53
+ * @throws {Error} - If `RefAttachNum` is not valid or the API returns an error.
54
+ */
55
+ deleteInsSub(RefAttachNum: number): Promise<void>;
56
+ }
57
+ //# sourceMappingURL=refAttaches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refAttaches.d.ts","sourceRoot":"","sources":["../../src/api/refAttaches.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAA;AAEhC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;;QAMI;IACS,cAAc,CAAC,EAC1B,MAAM,EACN,MAAM,GACP,GAAE,oBAAyB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IASnD;;;;;;;;;;;;;;;;OAgBG;IACU,eAAe,CAAC,EAC3B,MAAM,EACN,WAAW,EACX,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,OAAO,EACP,gBAAgB,EAChB,OAAO,GACR,EAAG,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAoB9C;;;;;;;;;;;;;;;OAeG;IACU,eAAe,CAAC,EAC3B,YAAY,EACZ,WAAW,EACX,OAAO,EACP,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,OAAO,EACP,gBAAgB,EAChB,OAAO,GACR,EAAG,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAkB9C;;;;;OAKG;IACU,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO/D"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class RefAttaches {
4
+ httpClient;
5
+ constructor(httpClient) {
6
+ this.httpClient = httpClient;
7
+ }
8
+ /**
9
+ * Fetch multiple refattaches with optional filtering and pagination.
10
+ * @param {Object} params - The parameters for filtering and pagination.
11
+ * @param {number} [params.PatNum] - The PatNum of the RefAttaches.
12
+ * @param {number} [params.Offset] - Pagination offset for results.
13
+ * @returns {Promise<RefAttach[]>} - A list of inssubs.
14
+ */
15
+ async getRefAttaches({ PatNum, Offset, } = {}) {
16
+ const params = {
17
+ PatNum,
18
+ Offset,
19
+ };
20
+ return this.httpClient.get("/refattaches", params);
21
+ }
22
+ /**
23
+ * Attach a referral to a patient.
24
+ * @param {Object} data - The details of RefAttach to create.
25
+ * @param {number} data.PatNum - Required. FK to patient.PatNum.
26
+ * @param {number} [data.ReferralNum] - Required. The PatNum of the patient who is subscribed to this plan.
27
+ * @param {string} [data.referralName] - Required. Number assigned by insurance company.
28
+ * @param {string} [data.RefDate] - Optional. The date this InsPlan became effective.
29
+ * @param {"RefTo" | "RefFrom" | "RefCustom"} [data.ReferralType] - Optional. Not usually used. The date this InsPlan was terminated.
30
+ * @param {"None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete"} [data.RefToStatus] - Optional. BenefitNotes are specifically designed to store automated notes. For example, when automatically requesting benefits through Trojan. Benefits are stored here in text form for later reference. Not at plan level because might be specific to subscriber. If blank, it may display a benefitNote for another subscriber to the plan.
31
+ * @param {string} [data.Note] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
32
+ * @param {"true" | "false"} [data.IsTransitionOfCare] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
33
+ * @param {number} [data.ProcNum] - Optional. Use to store any other info that affects coverage.
34
+ * @param {string} [data.DateProcComplete] - Optional. Use to store any other info that affects coverage.
35
+ * @param {number} [data.ProvNum] - Optional. Use to store any other info that affects coverage.
36
+ * @returns {Promise<RefAttach>} - The created refattaches.
37
+ * @throws {Error} - If required fields are missing or the API returns an error.
38
+ */
39
+ async createRefAttach({ PatNum, ReferralNum, referralName, RefDate, ReferralType, RefToStatus, Note, IsTransitionOfCare, ProcNum, DateProcComplete, ProvNum, }) {
40
+ if (!PatNum || (!ReferralNum && !referralName)) {
41
+ throw new Error("Invalid data: PatNum and either ReferralNum or referralName are required.");
42
+ }
43
+ return this.httpClient.post("/refattaches", {
44
+ PatNum,
45
+ ReferralNum,
46
+ referralName,
47
+ RefDate,
48
+ ReferralType,
49
+ RefToStatus,
50
+ Note,
51
+ IsTransitionOfCare,
52
+ ProcNum,
53
+ DateProcComplete,
54
+ ProvNum,
55
+ });
56
+ }
57
+ /**
58
+ * Update a refattach.
59
+ * @param {Object} data - The details of RefAttach to create.
60
+ * @param {number} data.RefAttachNum - Required. FK to patient.PatNum.
61
+ * @param {number} [data.ReferralNum] - Required. The PatNum of the patient who is subscribed to this plan.
62
+ * @param {string} [data.RefDate] - Optional. The date this InsPlan became effective.
63
+ * @param {"RefTo" | "RefFrom" | "RefCustom"} [data.ReferralType] - Optional. Not usually used. The date this InsPlan was terminated.
64
+ * @param {"None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete"} [data.RefToStatus] - Optional. BenefitNotes are specifically designed to store automated notes. For example, when automatically requesting benefits through Trojan. Benefits are stored here in text form for later reference. Not at plan level because might be specific to subscriber. If blank, it may display a benefitNote for another subscriber to the plan.
65
+ * @param {string} [data.Note] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
66
+ * @param {"true" | "false"} [data.IsTransitionOfCare] - Optional. This is set to either "true" or "false". Default "true". This authorizes the release of information based on if there is a signature on file.
67
+ * @param {number} [data.ProcNum] - Optional. Use to store any other info that affects coverage.
68
+ * @param {string} [data.DateProcComplete] - Optional. Use to store any other info that affects coverage.
69
+ * @param {number} [data.ProvNum] - Optional. Use to store any other info that affects coverage.
70
+ * @returns {Promise<RefAttach>} - The created refattaches.
71
+ * @throws {Error} - If required fields are missing or the API returns an error.
72
+ */
73
+ async updateRefAttach({ RefAttachNum, ReferralNum, RefDate, ReferralType, RefToStatus, Note, IsTransitionOfCare, ProcNum, DateProcComplete, ProvNum, }) {
74
+ if (!RefAttachNum) {
75
+ throw new Error("Invalid data: RefAttachNum is required.");
76
+ }
77
+ return this.httpClient.put(`/refattaches/${RefAttachNum}`, {
78
+ ReferralNum,
79
+ RefDate,
80
+ ReferralType,
81
+ RefToStatus,
82
+ Note,
83
+ IsTransitionOfCare,
84
+ ProcNum,
85
+ DateProcComplete,
86
+ ProvNum,
87
+ });
88
+ }
89
+ /**
90
+ * Delete a refattach.
91
+ * @param {number} RefAttachNum - Required: The unique identifier of the RefAttach to delete.
92
+ * @returns {Promise<void>} - Resolves when the discount plan sub is deleted.
93
+ * @throws {Error} - If `RefAttachNum` is not valid or the API returns an error.
94
+ */
95
+ async deleteInsSub(RefAttachNum) {
96
+ if (!RefAttachNum || typeof RefAttachNum !== "number") {
97
+ throw new Error("Invalid parameter: RefAttachNum must be a valid number.");
98
+ }
99
+ return this.httpClient.delete(`/refattaches/${RefAttachNum}`);
100
+ }
101
+ }
102
+ exports.default = RefAttaches;