@rinse-dental/open-dental 1.0.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy_notes.txt +1 -1
- package/dist/api/labCases.d.ts +66 -0
- package/dist/api/labCases.d.ts.map +1 -0
- package/dist/api/labCases.js +119 -0
- 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 +15 -0
- package/dist/openDental.d.ts.map +1 -1
- package/dist/openDental.js +30 -0
- package/dist/types/labCaseTypes.d.ts +68 -0
- package/dist/types/labCaseTypes.d.ts.map +1 -0
- package/dist/types/labCaseTypes.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/src/api/labCases.ts +183 -0
- package/src/api/refAttaches.ts +142 -0
- package/src/api/referrals.ts +222 -0
- package/src/openDental.ts +33 -0
- package/src/types/labCaseTypes.ts +71 -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
|
@@ -16,6 +16,9 @@ import DiscountPlanSubs from "./api/discountPlanSubs";
|
|
|
16
16
|
import FamilyModules from "./api/familyModules";
|
|
17
17
|
import InsSubs from "./api/insSubs";
|
|
18
18
|
import PatPlans from "./api/patPlans";
|
|
19
|
+
import LabCases from "./api/labCases";
|
|
20
|
+
import Referrals from "./api/referrals";
|
|
21
|
+
import RefAttaches from "./api/refAttaches";
|
|
19
22
|
|
|
20
23
|
class OpenDental {
|
|
21
24
|
private static httpClient: HttpClient;
|
|
@@ -204,6 +207,36 @@ class OpenDental {
|
|
|
204
207
|
}
|
|
205
208
|
return new PatPlans(this.httpClient);
|
|
206
209
|
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Create a new instance of the LabCases API.
|
|
213
|
+
*/
|
|
214
|
+
public static LabCases() {
|
|
215
|
+
if (!this.httpClient) {
|
|
216
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
217
|
+
}
|
|
218
|
+
return new LabCases(this.httpClient);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Create a new instance of the Referrals API.
|
|
223
|
+
*/
|
|
224
|
+
public static Referrals() {
|
|
225
|
+
if (!this.httpClient) {
|
|
226
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
227
|
+
}
|
|
228
|
+
return new Referrals(this.httpClient);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Create a new instance of the LabCases API.
|
|
233
|
+
*/
|
|
234
|
+
public static RefAttaches() {
|
|
235
|
+
if (!this.httpClient) {
|
|
236
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
237
|
+
}
|
|
238
|
+
return new RefAttaches(this.httpClient);
|
|
239
|
+
}
|
|
207
240
|
}
|
|
208
241
|
|
|
209
242
|
export { OpenDental };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an InsSub in the Open Dental system. Links an InsPlan to a Subscriber (patient.PatNum). Also, see PatPlans to indicate coverage.
|
|
3
|
+
* @see https://www.opendental.com/site/apilabcases.html
|
|
4
|
+
*/
|
|
5
|
+
export interface LabCase {
|
|
6
|
+
LabCaseNum?: number; //PK
|
|
7
|
+
PatNum?: number; //FK to patient.PatNum.
|
|
8
|
+
LaboratoryNum?: number; //FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
9
|
+
AptNum?: number; //FK to appointment.AptNum.
|
|
10
|
+
PlannedAptNum?: number; //FK to appointment.AptNum.
|
|
11
|
+
DateTimeDue?: string; //The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
12
|
+
DateTimeCreated?: string; // When the labcase was created. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
13
|
+
DateTimeSent?: string; //The time that the labcase actually went out to the lab. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
14
|
+
DateTimeRecd?: string; //Date/time received back from the lab. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
15
|
+
DateTimeChecked?: string; //Date/time that quality was checked. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
16
|
+
ProvNum?: number; //FK to provider.ProvNum.
|
|
17
|
+
Instructions?: string; //The text instructions for this labcase.
|
|
18
|
+
LabFee?: number; //This is used for tracking and informational purposes only. The fee is not used in any calculation.
|
|
19
|
+
DateTStamp?: string; //String in "yyyy-MM-dd HH:mm:ss" format
|
|
20
|
+
InvoiceNum?: string; //This is an optional invoice number used for tracking and informational purposes only.
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Gets a list of labcases.
|
|
25
|
+
*/
|
|
26
|
+
export interface GetLabCasesParams {
|
|
27
|
+
PatNum?: number; //FK to patient.PatNum.
|
|
28
|
+
LaboratoryNum?: number; //FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
29
|
+
AptNum?: number; //FK to appointment.AptNum.
|
|
30
|
+
PlannedAptNum?: number; //FK to appointment.AptNum.
|
|
31
|
+
ProvNum?: number; //FK to provider.ProvNum.
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Creates a labcase.
|
|
36
|
+
*/
|
|
37
|
+
export interface CreateLabCaseParams {
|
|
38
|
+
PatNum?: number; //Required. FK to patient.PatNum.
|
|
39
|
+
LaboratoryNum?: number; //Required. FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
40
|
+
ProvNum?: number; //Required. FK to provider.ProvNum.
|
|
41
|
+
AptNum?: number; //Optional. FK to appointment.AptNum.
|
|
42
|
+
PlannedAptNum?: number; //Optional. FK to appointment.AptNum.
|
|
43
|
+
DateTimeDue?: string; //Optional. The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
44
|
+
DateTimeCreated?: string; //Optional. When the labcase was created. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
45
|
+
DateTimeSent?: string; //Optional. The time that the labcase actually went out to the lab. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
46
|
+
DateTimeRecd?: string; //Optional. Date/time received back from the lab. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
47
|
+
DateTimeChecked?: string; //Optional. Date/time that quality was checked. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
48
|
+
Instructions?: string; //Optional. The text instructions for this labcase.
|
|
49
|
+
LabFee?: number; //Optional. This is used for tracking and informational purposes only. The fee is not used in any calculation.
|
|
50
|
+
InvoiceNum?: string; //Optional. This is an optional invoice number used for tracking and informational purposes only.
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Updates a labcase.
|
|
55
|
+
*/
|
|
56
|
+
export interface UpdateLabCaseParams {
|
|
57
|
+
LabCaseNum?: number; //Required in the URL.
|
|
58
|
+
LaboratoryNum?: number; //Required. FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
59
|
+
ProvNum?: number; //Required. FK to provider.ProvNum.
|
|
60
|
+
AptNum?: number; //Optional. FK to appointment.AptNum.
|
|
61
|
+
PlannedAptNum?: number; //Optional. FK to appointment.AptNum.
|
|
62
|
+
DateTimeDue?: string; //Optional. The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
63
|
+
DateTimeCreated?: string; //Optional. When the labcase was created. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
64
|
+
DateTimeSent?: string; //Optional. The time that the labcase actually went out to the lab. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
65
|
+
DateTimeRecd?: string; //Optional. Date/time received back from the lab. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
66
|
+
DateTimeChecked?: string; //Optional. Date/time that quality was checked. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
67
|
+
Instructions?: string; //Optional. The text instructions for this labcase.
|
|
68
|
+
LabFee?: number; //Optional. This is used for tracking and informational purposes only. The fee is not used in any calculation.
|
|
69
|
+
InvoiceNum?: string; //Optional. This is an optional invoice number used for tracking and informational purposes only.
|
|
70
|
+
}
|
|
71
|
+
|
|
@@ -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
|
+
|