@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.
- 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/api/refAttaches.d.ts +57 -0
- package/dist/api/refAttaches.d.ts.map +1 -0
- package/dist/api/refAttaches.js +102 -0
- package/dist/api/referrals.d.ts +84 -0
- package/dist/api/referrals.d.ts.map +1 -0
- package/dist/api/referrals.js +156 -0
- package/dist/openDental.d.ts +22 -1
- package/dist/openDental.d.ts.map +1 -1
- package/dist/openDental.js +42 -1
- 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/dist/types/refAttachTypes.d.ts +59 -0
- package/dist/types/refAttachTypes.d.ts.map +1 -0
- package/dist/types/refAttachTypes.js +2 -0
- package/dist/types/referralTypes.d.ts +98 -0
- package/dist/types/referralTypes.d.ts.map +1 -0
- package/dist/types/referralTypes.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/api/refAttaches.ts +142 -0
- package/src/api/referrals.ts +222 -0
- package/src/openDental.ts +45 -1
- package/src/types/benefitTypes.ts +70 -0
- package/src/types/insPlanTypes.ts +72 -0
- package/src/types/refAttachTypes.ts +63 -0
- package/src/types/referralTypes.ts +102 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Referral,
|
|
4
|
+
GetReferralsParams,
|
|
5
|
+
CreateReferralParams,
|
|
6
|
+
UpdateReferralParams,
|
|
7
|
+
} from "../types/referralTypes";
|
|
8
|
+
|
|
9
|
+
export default class Referrals {
|
|
10
|
+
private httpClient: HttpClient;
|
|
11
|
+
|
|
12
|
+
constructor(httpClient: HttpClient) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch a single referral by its ID.
|
|
18
|
+
* @param {number} ReferralNum - The unique identifier for the referal.
|
|
19
|
+
* @returns {Promise<Referral>} - The referral object.
|
|
20
|
+
* @throws {Error} - If `ReferralNum` is not provided.
|
|
21
|
+
*/
|
|
22
|
+
public async getReferral(ReferralNum: number): Promise<Referral> {
|
|
23
|
+
if (!ReferralNum || typeof ReferralNum !== "number") {
|
|
24
|
+
throw new Error("Invalid data: ReferralNum is required.");
|
|
25
|
+
}
|
|
26
|
+
return this.httpClient.get<Referral>(`/referrals/${ReferralNum}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fetch multiple referrals with optional filtering and pagination.
|
|
31
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
32
|
+
* @param {"true" | "false"} [data.IsHidden] - Optional.
|
|
33
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional.
|
|
34
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional.
|
|
35
|
+
* @param {"true" | "false"} [data.IsPreferred] - Optional.
|
|
36
|
+
* @param {"true" | "false"} [data.isPatient] - Optional.
|
|
37
|
+
* @param {string} [data.BusinessName] - Optional. Filter referrals by business name. Supports partial string matching.
|
|
38
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
39
|
+
* @returns {Promise<Referral[]>} - A list of referrals.
|
|
40
|
+
*/
|
|
41
|
+
public async getReferrals({
|
|
42
|
+
IsHidden,
|
|
43
|
+
NotPerson,
|
|
44
|
+
IsDoctor,
|
|
45
|
+
IsPreferred,
|
|
46
|
+
isPatient,
|
|
47
|
+
BusinessName,
|
|
48
|
+
Offset,
|
|
49
|
+
}: GetReferralsParams = {}): Promise<Referral[]> {
|
|
50
|
+
const params = {
|
|
51
|
+
IsHidden,
|
|
52
|
+
NotPerson,
|
|
53
|
+
IsDoctor,
|
|
54
|
+
IsPreferred,
|
|
55
|
+
isPatient,
|
|
56
|
+
BusinessName,
|
|
57
|
+
Offset,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return this.httpClient.get<Referral[]>("/referrals", params);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Create a new referral.
|
|
65
|
+
* @param {Object} data - The details of referral to create.
|
|
66
|
+
* @param {string} data.LName - Required. The last name of a referral source or referral source description.
|
|
67
|
+
* @param {number} [data.PatNum] - Optional. Only set this if the referral source is a patient. The provided LName must match the patient for whom the PatNum is given. This automatically populates the rest of the referral based on the given patient. If this is set, IsDoctor and NotPerson are set to "false", while isPatient will be true.
|
|
68
|
+
* @param {string} [data.FName] - Optional. The referral source's first name.
|
|
69
|
+
* @param {string} [data.MName] - Optional. The referral source's middle name or initial.
|
|
70
|
+
* @param {string} [data.SSN] - Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
71
|
+
* @param {"true" | "false"} [data.UsingTIN] - Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
72
|
+
* @param {number} [data.Specialty] - Optional. definition.DefNum where definition.Category=35 (ProviderSpecialty). If set, NotPerson will default to "false", IsDoctor will default to "true", and isPatient will be false.
|
|
73
|
+
* @param {string} [data.specialty] - Optional. Only set this if the Referral source is a Provider. This is a definition.ItemName where the DefCat is ProviderSpecialty(35). If this is set, IsDoctor will default to "true", NotPerson will default to "false", and isPatient will be false.
|
|
74
|
+
* @param {string} [data.ST] - Optional. The referral source's state. Two characters maximum.
|
|
75
|
+
* @param {string} [data.Telephone] - Optional. The referral source's phone number. Must be ten digits.
|
|
76
|
+
* @param {string} [data.Address] - Optional. The referral source's mailing address.
|
|
77
|
+
* @param {string} [data.Address2] - Optional. Additional info regarding the referral source's mailing address.
|
|
78
|
+
* @param {string} [data.City] - Optional. The referral source's city.
|
|
79
|
+
* @param {string} [data.Zip] - Optional. The referral source's ZIP code.
|
|
80
|
+
* @param {string} [data.Note] - Optional.
|
|
81
|
+
* @param {string} [data.Phone2] - Optional. Additional phone.
|
|
82
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
83
|
+
* @param {string} [data.Title] - Optional. The referral source's title.
|
|
84
|
+
* @param {string} [data.EMail] - Optional. The email address for the referral.
|
|
85
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
86
|
+
* @param {string} [data.BusinessName] - Optional. Name of the business that the referral works for.
|
|
87
|
+
* @param {string} [data.DisplayNote] - Optional. Shows in the Family Module's Patient Info grid.
|
|
88
|
+
* @returns {Promise<Referral>} - The created referral.
|
|
89
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
90
|
+
*/
|
|
91
|
+
public async createReferral({
|
|
92
|
+
LName,
|
|
93
|
+
PatNum,
|
|
94
|
+
FName,
|
|
95
|
+
MName,
|
|
96
|
+
SSN,
|
|
97
|
+
UsingTIN,
|
|
98
|
+
Specialty,
|
|
99
|
+
specialty,
|
|
100
|
+
ST,
|
|
101
|
+
Telephone,
|
|
102
|
+
Address,
|
|
103
|
+
Address2,
|
|
104
|
+
City,
|
|
105
|
+
Zip,
|
|
106
|
+
Note,
|
|
107
|
+
Phone2,
|
|
108
|
+
NotPerson,
|
|
109
|
+
Title,
|
|
110
|
+
EMail,
|
|
111
|
+
IsDoctor,
|
|
112
|
+
BusinessName,
|
|
113
|
+
DisplayNote,
|
|
114
|
+
} : CreateReferralParams): Promise<Referral> {
|
|
115
|
+
if (!LName) {
|
|
116
|
+
throw new Error("Invalid data: LName is required.");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return this.httpClient.post<Referral>("/referrals", {
|
|
120
|
+
LName,
|
|
121
|
+
PatNum,
|
|
122
|
+
FName,
|
|
123
|
+
MName,
|
|
124
|
+
SSN,
|
|
125
|
+
UsingTIN,
|
|
126
|
+
Specialty,
|
|
127
|
+
specialty,
|
|
128
|
+
ST,
|
|
129
|
+
Telephone,
|
|
130
|
+
Address,
|
|
131
|
+
Address2,
|
|
132
|
+
City,
|
|
133
|
+
Zip,
|
|
134
|
+
Note,
|
|
135
|
+
Phone2,
|
|
136
|
+
NotPerson,
|
|
137
|
+
Title,
|
|
138
|
+
EMail,
|
|
139
|
+
IsDoctor,
|
|
140
|
+
BusinessName,
|
|
141
|
+
DisplayNote,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Update a referral.
|
|
147
|
+
* @param {Object} data - The details of referral to update.
|
|
148
|
+
* @param {number} data.ReferralNum - Required. PK of the referral to update.
|
|
149
|
+
* @param {string} data.LName - Required. The last name of a referral source or referral source description.
|
|
150
|
+
* @param {string} [data.FName] - Optional. The referral source's first name.
|
|
151
|
+
* @param {string} [data.MName] - Optional. The referral source's middle name or initial.
|
|
152
|
+
* @param {string} [data.SSN] - Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
153
|
+
* @param {"true" | "false"} [data.UsingTIN] - Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
154
|
+
* @param {number} [data.Specialty] - Optional. definition.DefNum where definition.Category=35 (ProviderSpecialty). If set, NotPerson will default to "false", IsDoctor will default to "true", and isPatient will be false.
|
|
155
|
+
* @param {string} [data.ST] - Optional. The referral source's state. Two characters maximum.
|
|
156
|
+
* @param {string} [data.Telephone] - Optional. The referral source's phone number. Must be ten digits.
|
|
157
|
+
* @param {string} [data.Address] - Optional. The referral source's mailing address.
|
|
158
|
+
* @param {string} [data.Address2] - Optional. Additional info regarding the referral source's mailing address.
|
|
159
|
+
* @param {string} [data.City] - Optional. The referral source's city.
|
|
160
|
+
* @param {string} [data.Zip] - Optional. The referral source's ZIP code.
|
|
161
|
+
* @param {string} [data.Note] - Optional.
|
|
162
|
+
* @param {string} [data.Phone2] - Optional. Additional phone.
|
|
163
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
164
|
+
* @param {string} [data.Title] - Optional. The referral source's title.
|
|
165
|
+
* @param {string} [data.EMail] - Optional. The email address for the referral.
|
|
166
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
167
|
+
* @param {string} [data.BusinessName] - Optional. Name of the business that the referral works for.
|
|
168
|
+
* @param {string} [data.DisplayNote] - Optional. Shows in the Family Module's Patient Info grid.
|
|
169
|
+
* @returns {Promise<Referral>} - The updated referral.
|
|
170
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
171
|
+
*/
|
|
172
|
+
public async updateReferral({
|
|
173
|
+
ReferralNum,
|
|
174
|
+
LName,
|
|
175
|
+
FName,
|
|
176
|
+
MName,
|
|
177
|
+
SSN,
|
|
178
|
+
UsingTIN,
|
|
179
|
+
Specialty,
|
|
180
|
+
ST,
|
|
181
|
+
Telephone,
|
|
182
|
+
Address,
|
|
183
|
+
Address2,
|
|
184
|
+
City,
|
|
185
|
+
Zip,
|
|
186
|
+
Note,
|
|
187
|
+
Phone2,
|
|
188
|
+
NotPerson,
|
|
189
|
+
Title,
|
|
190
|
+
EMail,
|
|
191
|
+
IsDoctor,
|
|
192
|
+
BusinessName,
|
|
193
|
+
DisplayNote,
|
|
194
|
+
} : UpdateReferralParams): Promise<Referral> {
|
|
195
|
+
if (!ReferralNum || typeof ReferralNum !== "number") {
|
|
196
|
+
throw new Error("Invalid data: ReferralNum is required.");
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return this.httpClient.put<Referral>(`/referrals/${ReferralNum}`, {
|
|
200
|
+
LName,
|
|
201
|
+
FName,
|
|
202
|
+
MName,
|
|
203
|
+
SSN,
|
|
204
|
+
UsingTIN,
|
|
205
|
+
Specialty,
|
|
206
|
+
ST,
|
|
207
|
+
Telephone,
|
|
208
|
+
Address,
|
|
209
|
+
Address2,
|
|
210
|
+
City,
|
|
211
|
+
Zip,
|
|
212
|
+
Note,
|
|
213
|
+
Phone2,
|
|
214
|
+
NotPerson,
|
|
215
|
+
Title,
|
|
216
|
+
EMail,
|
|
217
|
+
IsDoctor,
|
|
218
|
+
BusinessName,
|
|
219
|
+
DisplayNote,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
package/src/openDental.ts
CHANGED
|
@@ -17,6 +17,10 @@ import FamilyModules from "./api/familyModules";
|
|
|
17
17
|
import InsSubs from "./api/insSubs";
|
|
18
18
|
import PatPlans from "./api/patPlans";
|
|
19
19
|
import LabCases from "./api/labCases";
|
|
20
|
+
import Referrals from "./api/referrals";
|
|
21
|
+
import RefAttaches from "./api/refAttaches";
|
|
22
|
+
import InsPlans from "./api/insPlans";
|
|
23
|
+
import Benefits from "./api/benefits";
|
|
20
24
|
|
|
21
25
|
class OpenDental {
|
|
22
26
|
private static httpClient: HttpClient;
|
|
@@ -213,7 +217,47 @@ class OpenDental {
|
|
|
213
217
|
if (!this.httpClient) {
|
|
214
218
|
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
215
219
|
}
|
|
216
|
-
return new
|
|
220
|
+
return new LabCases(this.httpClient);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Create a new instance of the Referrals API.
|
|
225
|
+
*/
|
|
226
|
+
public static Referrals() {
|
|
227
|
+
if (!this.httpClient) {
|
|
228
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
229
|
+
}
|
|
230
|
+
return new Referrals(this.httpClient);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Create a new instance of the LabCases API.
|
|
235
|
+
*/
|
|
236
|
+
public static RefAttaches() {
|
|
237
|
+
if (!this.httpClient) {
|
|
238
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
239
|
+
}
|
|
240
|
+
return new RefAttaches(this.httpClient);
|
|
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);
|
|
217
261
|
}
|
|
218
262
|
}
|
|
219
263
|
|
|
@@ -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
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an RefAttaches in the Open Dental system. Attaches a patient to a referral source.
|
|
3
|
+
* @see https://www.opendental.com/site/apirefattaches.html
|
|
4
|
+
*/
|
|
5
|
+
export interface RefAttach {
|
|
6
|
+
RefAttachNum?: number; //PK
|
|
7
|
+
ReferralNum?: number; //This or referralName is required. FK to referral.ReferralNum.
|
|
8
|
+
referralName?: string; //This or ReferralNum is required.
|
|
9
|
+
PatNum?: number; //FK to patient.PatNum.
|
|
10
|
+
ItemOrder?: number; //
|
|
11
|
+
RefDate?: string; //String in "yyyy-MM-dd" format.
|
|
12
|
+
ReferralType?: "RefTo" | "RefFrom" | "RefCustom"; //Either "RefTo", "RefFrom", or "RefCustom". Default "RefFrom".
|
|
13
|
+
RefToStatus?: "None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete"; //Typically only used with outgoing referrals. Either "None", "Declined", "Scheduled", "Consulted", "InTreatment", or "Complete". Default "None".
|
|
14
|
+
Note?: string; //Referral note specific to this patient.
|
|
15
|
+
IsTransitionOfCare?: "true" | "false"; //Either "true" or "false". Used to track EHR events. Default "false".
|
|
16
|
+
ProcNum?: number; //FK to procedurelog.ProcNum. Default 0.
|
|
17
|
+
DateProcComplete?: string; //String in "yyyy-MM-dd HH:mm:ss" format
|
|
18
|
+
ProvNum?: number; //FK to provider.ProvNum. Can only be specified when ReferralType is "RefTo". Default 0.
|
|
19
|
+
DateTStamp?: string; //String in "yyyy-MM-dd HH:mm:ss" format
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export interface GetRefAttachesParams {
|
|
24
|
+
PatNum?: number; // Optional. FK to patient.
|
|
25
|
+
Offset?: number; // Pagination offset for results.
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Attaches a patient to a referral source. The referral source must be specified by either ReferralNum or referralName.
|
|
30
|
+
* Before calling this method, use Referrals GET to find the ReferralNum of an existing referral source.
|
|
31
|
+
* Alternatively, specify a referralName to search the LName of existing referrals for an exact match.
|
|
32
|
+
* If a match is not found, a new referral with that name is created and used.
|
|
33
|
+
*/
|
|
34
|
+
export interface CreateRefAttachParams {
|
|
35
|
+
PatNum: number; //Required. FK to patient.PatNum.
|
|
36
|
+
ReferralNum?: number; //This or referralName is required. FK to referral.ReferralNum.
|
|
37
|
+
referralName?: string; //This or ReferralNum is required.
|
|
38
|
+
RefDate?: string; //Optional. String in "yyyy-MM-dd" format. The date the referral source is attached to the patient. Default to today's date.
|
|
39
|
+
ReferralType?: "RefTo" | "RefFrom" | "RefCustom"; //Optional. Either "RefTo", "RefFrom", or "RefCustom". Default "RefFrom".
|
|
40
|
+
RefToStatus?: "None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete"; //Optional. Typically only used with outgoing referrals. Either "None", "Declined", "Scheduled", "Consulted", "InTreatment", or "Complete". Default "None".
|
|
41
|
+
Note?: string; //Optional. Referral note specific to this patient.
|
|
42
|
+
IsTransitionOfCare?: "true" | "false"; //Optional. Either "true" or "false". Used to track EHR events. Default "false".
|
|
43
|
+
ProcNum?: number; //Optional. FK to procedurelog.ProcNum. Default 0.
|
|
44
|
+
DateProcComplete?: string; //Optional. String in "yyyy-MM-dd HH:mm:ss" format
|
|
45
|
+
ProvNum?: number; //Optional. FK to provider.ProvNum. Can only be specified when ReferralType is "RefTo". Default 0.
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Updates an existing refattach.
|
|
50
|
+
*/
|
|
51
|
+
export interface UpdateRefAttachParams {
|
|
52
|
+
RefAttachNum: number; //PK
|
|
53
|
+
ReferralNum?: number; //This or referralName is required. FK to referral.ReferralNum.
|
|
54
|
+
RefDate?: string; //Optional. String in "yyyy-MM-dd" format. The date the referral source is attached to the patient. Default to today's date.
|
|
55
|
+
ReferralType?: "RefTo" | "RefFrom" | "RefCustom"; //Optional. Either "RefTo", "RefFrom", or "RefCustom". Default "RefFrom".
|
|
56
|
+
RefToStatus?: "None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete"; //Optional. Typically only used with outgoing referrals. Either "None", "Declined", "Scheduled", "Consulted", "InTreatment", or "Complete". Default "None".
|
|
57
|
+
Note?: string; //Optional. Referral note specific to this patient.
|
|
58
|
+
IsTransitionOfCare?: "true" | "false"; //Optional. Either "true" or "false". Used to track EHR events. Default "false".
|
|
59
|
+
ProcNum?: number; //Optional. FK to procedurelog.ProcNum. Default 0.
|
|
60
|
+
DateProcComplete?: string; //Optional. String in "yyyy-MM-dd HH:mm:ss" format
|
|
61
|
+
ProvNum?: number; //Optional. FK to provider.ProvNum. Can only be specified when ReferralType is "RefTo". Default 0.
|
|
62
|
+
}
|
|
63
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an Referral in the Open Dental system. These can be either a provider, patient, or non-person. The description of non-patient sources is stored in the LName field.
|
|
3
|
+
* @see https://www.opendental.com/site/apireferrals.html
|
|
4
|
+
*/
|
|
5
|
+
export interface Referral {
|
|
6
|
+
ReferralNum?: number; //PK
|
|
7
|
+
LName?: string; //
|
|
8
|
+
FName?: string; //
|
|
9
|
+
MName?: string; //
|
|
10
|
+
SSN?: string; //
|
|
11
|
+
UsingTIN?: "true" | "false"; //Either "true" or "false".
|
|
12
|
+
Specialty?: number; //definition.DefNum where definition.Category=35 (ProviderSpecialty). If set, NotPerson will default to "false", IsDoctor will default to "true", and isPatient will be false.
|
|
13
|
+
specialty?: string; //Only set this if the Referral source is a Provider. This is a definition.ItemName where the DefCat is ProviderSpecialty(35). If this is set, IsDoctor will default to "true", NotPerson will default to "false", and isPatient will be false.
|
|
14
|
+
ST?: string; // 2 char max
|
|
15
|
+
Telephone?: string; // must be 10 digits
|
|
16
|
+
Address?: string; //
|
|
17
|
+
Address2?: string; //
|
|
18
|
+
City?: number; //
|
|
19
|
+
Zip?: string; //
|
|
20
|
+
Note?: string; //
|
|
21
|
+
Phone2?: string; //
|
|
22
|
+
IsHidden?: "true" | "false"; //Either "true" or "false".
|
|
23
|
+
NotPerson?: string; //
|
|
24
|
+
Title?: string; //
|
|
25
|
+
EMail?: string; //
|
|
26
|
+
PatNum?: string; //
|
|
27
|
+
IsDoctor?: "true" | "false"; //Either "true" or "false".
|
|
28
|
+
DateTStamp?: string; //String in "yyyy-MM-dd HH:mm:ss" format
|
|
29
|
+
IsPreferred?: "true" | "false"; //Either "true" or "false".
|
|
30
|
+
BusinessName?: string; //
|
|
31
|
+
DisplayNote?: string; //
|
|
32
|
+
isPatient?: "true" | "false"; //Either "true" or "false".
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export interface GetReferralsParams {
|
|
37
|
+
IsHidden?: "true" | "false"; //Optional. Filter hidden responses. Either "true" or "false"
|
|
38
|
+
NotPerson?: "true" | "false"; //Optional. Filter referrals that are marked NotPerson. Either "true" or "false".
|
|
39
|
+
IsDoctor?: "true" | "false"; //Optional. Filter referrals that are marked IsDoctor. Either "true" or "false".
|
|
40
|
+
IsPreferred?: "true" | "false"; //Optional. Filter referrals that are marked IsPreferred. Either "true" or "false".
|
|
41
|
+
isPatient?: "true" | "false"; //Optional. Filter referrals that are marked isPatient. Either "true" or "false".
|
|
42
|
+
BusinessName?: string; //Optional. Filter referrals by business name. Supports partial string matching.
|
|
43
|
+
Offset?: number; // Pagination offset for results.
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new Referral. Referrals can be for patients (provide PatNum), providers (provide specialty) or non-persons (provide neither PatNum or specialty).
|
|
48
|
+
* In the last case, isPatient and IsDoctor will be set false automatically while NotPerson will be set to true.
|
|
49
|
+
* If you wish to create an associated RefAttach please see RefAttaches POST.
|
|
50
|
+
*/
|
|
51
|
+
export interface CreateReferralParams {
|
|
52
|
+
LName?: string; //Required. The last name of a referral source or referral source description.
|
|
53
|
+
PatNum?: string; //Optional. Only set this if the referral source is a patient. The provided LName must match the patient for whom the PatNum is given. This automatically populates the rest of the referral based on the given patient. If this is set, IsDoctor and NotPerson are set to "false", while isPatient will be true.
|
|
54
|
+
FName?: string; //Optional. The referral source's first name.
|
|
55
|
+
MName?: string; //Optional. The referral source's middle name or initial.
|
|
56
|
+
SSN?: string; //Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
57
|
+
UsingTIN?: "true" | "false"; //Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
58
|
+
Specialty?: number; //Optional. definition.DefNum where definition.Category=35 (ProviderSpecialty). If set, NotPerson will default to "false", IsDoctor will default to "true", and isPatient will be false.
|
|
59
|
+
specialty?: string; //Optional. Only set this if the Referral source is a Provider. This is a definition.ItemName where the DefCat is ProviderSpecialty(35). If this is set, IsDoctor will default to "true", NotPerson will default to "false", and isPatient will be false.
|
|
60
|
+
ST?: string; //Optional. The referral source's state. Two characters maximum.
|
|
61
|
+
Telephone?: string; //Optional. The referral source's phone number. Must be ten digits.
|
|
62
|
+
Address?: string; //Optional. The referral source's mailing address.
|
|
63
|
+
Address2?: string; //Optional. Additional info regarding the referral source's mailing address.
|
|
64
|
+
City?: string; //Optional. The referral source's city.
|
|
65
|
+
Zip?: string; //Optional. The referral source's ZIP code.
|
|
66
|
+
Note?: string; //Optional.
|
|
67
|
+
Phone2?: string; //Optional. Additional phone.
|
|
68
|
+
NotPerson?: string; //Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
69
|
+
Title?: string; //Optional. The referral source's title.
|
|
70
|
+
EMail?: string; //Optional. The email address for the referral.
|
|
71
|
+
IsDoctor?: "true" | "false"; //Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
72
|
+
BusinessName?: string; //Optional. Name of the business that the referral works for.
|
|
73
|
+
DisplayNote?: string; //Optional. Shows in the Family Module's Patient Info grid.
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Updates an existing Referral. All fields are optional. Referrals for a patient can only have the Note and DisplayNote fields modified.
|
|
78
|
+
*/
|
|
79
|
+
export interface UpdateReferralParams {
|
|
80
|
+
ReferralNum?: number; //PK of the referral
|
|
81
|
+
LName?: string; //Required. The last name of a referral source or referral source description.
|
|
82
|
+
FName?: string; //Optional. The referral source's first name.
|
|
83
|
+
MName?: string; //Optional. The referral source's middle name or initial.
|
|
84
|
+
SSN?: string; //Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
85
|
+
UsingTIN?: "true" | "false"; //Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
86
|
+
Specialty?: number; //Optional. definition.DefNum where definition.Category=35 (ProviderSpecialty). If set, NotPerson will default to "false", IsDoctor will default to "true", and isPatient will be false.
|
|
87
|
+
ST?: string; //Optional. The referral source's state. Two characters maximum.
|
|
88
|
+
Telephone?: string; //Optional. The referral source's phone number. Must be ten digits.
|
|
89
|
+
Address?: string; //Optional. The referral source's mailing address.
|
|
90
|
+
Address2?: string; //Optional. Additional info regarding the referral source's mailing address.
|
|
91
|
+
City?: number; //Optional. The referral source's city.
|
|
92
|
+
Zip?: string; //Optional. The referral source's ZIP code.
|
|
93
|
+
Note?: string; //Optional.
|
|
94
|
+
Phone2?: string; //Optional. Additional phone.
|
|
95
|
+
NotPerson?: string; //Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
96
|
+
Title?: string; //Optional. The referral source's title.
|
|
97
|
+
EMail?: string; //Optional. The email address for the referral.
|
|
98
|
+
IsDoctor?: "true" | "false"; //Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
99
|
+
BusinessName?: string; //Optional. Name of the business that the referral works for.
|
|
100
|
+
DisplayNote?: string; //Optional. Shows in the Family Module's Patient Info grid.
|
|
101
|
+
}
|
|
102
|
+
|