@rinse-dental/open-dental 1.1.0 → 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/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 +12 -1
- package/dist/openDental.d.ts.map +1 -1
- package/dist/openDental.js +22 -1
- 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/refAttaches.ts +142 -0
- package/src/api/referrals.ts +222 -0
- package/src/openDental.ts +23 -1
- package/src/types/refAttachTypes.ts +63 -0
- package/src/types/referralTypes.ts +102 -0
|
@@ -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;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { Referral, GetReferralsParams, CreateReferralParams, UpdateReferralParams } from "../types/referralTypes";
|
|
3
|
+
export default class Referrals {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch a single referral by its ID.
|
|
8
|
+
* @param {number} ReferralNum - The unique identifier for the referal.
|
|
9
|
+
* @returns {Promise<Referral>} - The referral object.
|
|
10
|
+
* @throws {Error} - If `ReferralNum` is not provided.
|
|
11
|
+
*/
|
|
12
|
+
getReferral(ReferralNum: number): Promise<Referral>;
|
|
13
|
+
/**
|
|
14
|
+
* Fetch multiple referrals with optional filtering and pagination.
|
|
15
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
16
|
+
* @param {"true" | "false"} [data.IsHidden] - Optional.
|
|
17
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional.
|
|
18
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional.
|
|
19
|
+
* @param {"true" | "false"} [data.IsPreferred] - Optional.
|
|
20
|
+
* @param {"true" | "false"} [data.isPatient] - Optional.
|
|
21
|
+
* @param {string} [data.BusinessName] - Optional. Filter referrals by business name. Supports partial string matching.
|
|
22
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
23
|
+
* @returns {Promise<Referral[]>} - A list of referrals.
|
|
24
|
+
*/
|
|
25
|
+
getReferrals({ IsHidden, NotPerson, IsDoctor, IsPreferred, isPatient, BusinessName, Offset, }?: GetReferralsParams): Promise<Referral[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new referral.
|
|
28
|
+
* @param {Object} data - The details of referral to create.
|
|
29
|
+
* @param {string} data.LName - Required. The last name of a referral source or referral source description.
|
|
30
|
+
* @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.
|
|
31
|
+
* @param {string} [data.FName] - Optional. The referral source's first name.
|
|
32
|
+
* @param {string} [data.MName] - Optional. The referral source's middle name or initial.
|
|
33
|
+
* @param {string} [data.SSN] - Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
34
|
+
* @param {"true" | "false"} [data.UsingTIN] - Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
35
|
+
* @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.
|
|
36
|
+
* @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.
|
|
37
|
+
* @param {string} [data.ST] - Optional. The referral source's state. Two characters maximum.
|
|
38
|
+
* @param {string} [data.Telephone] - Optional. The referral source's phone number. Must be ten digits.
|
|
39
|
+
* @param {string} [data.Address] - Optional. The referral source's mailing address.
|
|
40
|
+
* @param {string} [data.Address2] - Optional. Additional info regarding the referral source's mailing address.
|
|
41
|
+
* @param {string} [data.City] - Optional. The referral source's city.
|
|
42
|
+
* @param {string} [data.Zip] - Optional. The referral source's ZIP code.
|
|
43
|
+
* @param {string} [data.Note] - Optional.
|
|
44
|
+
* @param {string} [data.Phone2] - Optional. Additional phone.
|
|
45
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
46
|
+
* @param {string} [data.Title] - Optional. The referral source's title.
|
|
47
|
+
* @param {string} [data.EMail] - Optional. The email address for the referral.
|
|
48
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
49
|
+
* @param {string} [data.BusinessName] - Optional. Name of the business that the referral works for.
|
|
50
|
+
* @param {string} [data.DisplayNote] - Optional. Shows in the Family Module's Patient Info grid.
|
|
51
|
+
* @returns {Promise<Referral>} - The created referral.
|
|
52
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
53
|
+
*/
|
|
54
|
+
createReferral({ LName, PatNum, FName, MName, SSN, UsingTIN, Specialty, specialty, ST, Telephone, Address, Address2, City, Zip, Note, Phone2, NotPerson, Title, EMail, IsDoctor, BusinessName, DisplayNote, }: CreateReferralParams): Promise<Referral>;
|
|
55
|
+
/**
|
|
56
|
+
* Update a referral.
|
|
57
|
+
* @param {Object} data - The details of referral to update.
|
|
58
|
+
* @param {number} data.ReferralNum - Required. PK of the referral to update.
|
|
59
|
+
* @param {string} data.LName - Required. The last name of a referral source or referral source description.
|
|
60
|
+
* @param {string} [data.FName] - Optional. The referral source's first name.
|
|
61
|
+
* @param {string} [data.MName] - Optional. The referral source's middle name or initial.
|
|
62
|
+
* @param {string} [data.SSN] - Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
63
|
+
* @param {"true" | "false"} [data.UsingTIN] - Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
64
|
+
* @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.
|
|
65
|
+
* @param {string} [data.ST] - Optional. The referral source's state. Two characters maximum.
|
|
66
|
+
* @param {string} [data.Telephone] - Optional. The referral source's phone number. Must be ten digits.
|
|
67
|
+
* @param {string} [data.Address] - Optional. The referral source's mailing address.
|
|
68
|
+
* @param {string} [data.Address2] - Optional. Additional info regarding the referral source's mailing address.
|
|
69
|
+
* @param {string} [data.City] - Optional. The referral source's city.
|
|
70
|
+
* @param {string} [data.Zip] - Optional. The referral source's ZIP code.
|
|
71
|
+
* @param {string} [data.Note] - Optional.
|
|
72
|
+
* @param {string} [data.Phone2] - Optional. Additional phone.
|
|
73
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
74
|
+
* @param {string} [data.Title] - Optional. The referral source's title.
|
|
75
|
+
* @param {string} [data.EMail] - Optional. The email address for the referral.
|
|
76
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
77
|
+
* @param {string} [data.BusinessName] - Optional. Name of the business that the referral works for.
|
|
78
|
+
* @param {string} [data.DisplayNote] - Optional. Shows in the Family Module's Patient Info grid.
|
|
79
|
+
* @returns {Promise<Referral>} - The updated referral.
|
|
80
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
81
|
+
*/
|
|
82
|
+
updateReferral({ ReferralNum, LName, FName, MName, SSN, UsingTIN, Specialty, ST, Telephone, Address, Address2, City, Zip, Note, Phone2, NotPerson, Title, EMail, IsDoctor, BusinessName, DisplayNote, }: UpdateReferralParams): Promise<Referral>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=referrals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referrals.d.ts","sourceRoot":"","sources":["../../src/api/referrals.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;OAKG;IACU,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOhE;;;;;;;;;;;QAWI;IACS,YAAY,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,EACT,YAAY,EACZ,MAAM,GACP,GAAE,kBAAuB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAchD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACU,cAAc,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,GAAG,EACH,QAAQ,EACR,SAAS,EACT,SAAS,EACT,EAAE,EACF,SAAS,EACT,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,GACZ,EAAG,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC;IA+B5C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACU,cAAc,CAAC,EAC1B,WAAW,EACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,QAAQ,EACR,SAAS,EACT,EAAE,EACF,SAAS,EACT,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,GACZ,EAAG,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC;CA4B7C"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Referrals {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch a single referral by its ID.
|
|
10
|
+
* @param {number} ReferralNum - The unique identifier for the referal.
|
|
11
|
+
* @returns {Promise<Referral>} - The referral object.
|
|
12
|
+
* @throws {Error} - If `ReferralNum` is not provided.
|
|
13
|
+
*/
|
|
14
|
+
async getReferral(ReferralNum) {
|
|
15
|
+
if (!ReferralNum || typeof ReferralNum !== "number") {
|
|
16
|
+
throw new Error("Invalid data: ReferralNum is required.");
|
|
17
|
+
}
|
|
18
|
+
return this.httpClient.get(`/referrals/${ReferralNum}`);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Fetch multiple referrals with optional filtering and pagination.
|
|
22
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
23
|
+
* @param {"true" | "false"} [data.IsHidden] - Optional.
|
|
24
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional.
|
|
25
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional.
|
|
26
|
+
* @param {"true" | "false"} [data.IsPreferred] - Optional.
|
|
27
|
+
* @param {"true" | "false"} [data.isPatient] - Optional.
|
|
28
|
+
* @param {string} [data.BusinessName] - Optional. Filter referrals by business name. Supports partial string matching.
|
|
29
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
30
|
+
* @returns {Promise<Referral[]>} - A list of referrals.
|
|
31
|
+
*/
|
|
32
|
+
async getReferrals({ IsHidden, NotPerson, IsDoctor, IsPreferred, isPatient, BusinessName, Offset, } = {}) {
|
|
33
|
+
const params = {
|
|
34
|
+
IsHidden,
|
|
35
|
+
NotPerson,
|
|
36
|
+
IsDoctor,
|
|
37
|
+
IsPreferred,
|
|
38
|
+
isPatient,
|
|
39
|
+
BusinessName,
|
|
40
|
+
Offset,
|
|
41
|
+
};
|
|
42
|
+
return this.httpClient.get("/referrals", params);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a new referral.
|
|
46
|
+
* @param {Object} data - The details of referral to create.
|
|
47
|
+
* @param {string} data.LName - Required. The last name of a referral source or referral source description.
|
|
48
|
+
* @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.
|
|
49
|
+
* @param {string} [data.FName] - Optional. The referral source's first name.
|
|
50
|
+
* @param {string} [data.MName] - Optional. The referral source's middle name or initial.
|
|
51
|
+
* @param {string} [data.SSN] - Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
52
|
+
* @param {"true" | "false"} [data.UsingTIN] - Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
53
|
+
* @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.
|
|
54
|
+
* @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.
|
|
55
|
+
* @param {string} [data.ST] - Optional. The referral source's state. Two characters maximum.
|
|
56
|
+
* @param {string} [data.Telephone] - Optional. The referral source's phone number. Must be ten digits.
|
|
57
|
+
* @param {string} [data.Address] - Optional. The referral source's mailing address.
|
|
58
|
+
* @param {string} [data.Address2] - Optional. Additional info regarding the referral source's mailing address.
|
|
59
|
+
* @param {string} [data.City] - Optional. The referral source's city.
|
|
60
|
+
* @param {string} [data.Zip] - Optional. The referral source's ZIP code.
|
|
61
|
+
* @param {string} [data.Note] - Optional.
|
|
62
|
+
* @param {string} [data.Phone2] - Optional. Additional phone.
|
|
63
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
64
|
+
* @param {string} [data.Title] - Optional. The referral source's title.
|
|
65
|
+
* @param {string} [data.EMail] - Optional. The email address for the referral.
|
|
66
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
67
|
+
* @param {string} [data.BusinessName] - Optional. Name of the business that the referral works for.
|
|
68
|
+
* @param {string} [data.DisplayNote] - Optional. Shows in the Family Module's Patient Info grid.
|
|
69
|
+
* @returns {Promise<Referral>} - The created referral.
|
|
70
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
71
|
+
*/
|
|
72
|
+
async createReferral({ LName, PatNum, FName, MName, SSN, UsingTIN, Specialty, specialty, ST, Telephone, Address, Address2, City, Zip, Note, Phone2, NotPerson, Title, EMail, IsDoctor, BusinessName, DisplayNote, }) {
|
|
73
|
+
if (!LName) {
|
|
74
|
+
throw new Error("Invalid data: LName is required.");
|
|
75
|
+
}
|
|
76
|
+
return this.httpClient.post("/referrals", {
|
|
77
|
+
LName,
|
|
78
|
+
PatNum,
|
|
79
|
+
FName,
|
|
80
|
+
MName,
|
|
81
|
+
SSN,
|
|
82
|
+
UsingTIN,
|
|
83
|
+
Specialty,
|
|
84
|
+
specialty,
|
|
85
|
+
ST,
|
|
86
|
+
Telephone,
|
|
87
|
+
Address,
|
|
88
|
+
Address2,
|
|
89
|
+
City,
|
|
90
|
+
Zip,
|
|
91
|
+
Note,
|
|
92
|
+
Phone2,
|
|
93
|
+
NotPerson,
|
|
94
|
+
Title,
|
|
95
|
+
EMail,
|
|
96
|
+
IsDoctor,
|
|
97
|
+
BusinessName,
|
|
98
|
+
DisplayNote,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Update a referral.
|
|
103
|
+
* @param {Object} data - The details of referral to update.
|
|
104
|
+
* @param {number} data.ReferralNum - Required. PK of the referral to update.
|
|
105
|
+
* @param {string} data.LName - Required. The last name of a referral source or referral source description.
|
|
106
|
+
* @param {string} [data.FName] - Optional. The referral source's first name.
|
|
107
|
+
* @param {string} [data.MName] - Optional. The referral source's middle name or initial.
|
|
108
|
+
* @param {string} [data.SSN] - Optional. SSN, or TIN if UsingTIN is true. No punctuation.
|
|
109
|
+
* @param {"true" | "false"} [data.UsingTIN] - Optional. Either "true" or "false". Dictates whether SSN contains an SSN or TIN. Default "false".
|
|
110
|
+
* @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.
|
|
111
|
+
* @param {string} [data.ST] - Optional. The referral source's state. Two characters maximum.
|
|
112
|
+
* @param {string} [data.Telephone] - Optional. The referral source's phone number. Must be ten digits.
|
|
113
|
+
* @param {string} [data.Address] - Optional. The referral source's mailing address.
|
|
114
|
+
* @param {string} [data.Address2] - Optional. Additional info regarding the referral source's mailing address.
|
|
115
|
+
* @param {string} [data.City] - Optional. The referral source's city.
|
|
116
|
+
* @param {string} [data.Zip] - Optional. The referral source's ZIP code.
|
|
117
|
+
* @param {string} [data.Note] - Optional.
|
|
118
|
+
* @param {string} [data.Phone2] - Optional. Additional phone.
|
|
119
|
+
* @param {"true" | "false"} [data.NotPerson] - Optional. Either "true" or "false". Default "false", unless neither PatNum nor Specialty were supplied.
|
|
120
|
+
* @param {string} [data.Title] - Optional. The referral source's title.
|
|
121
|
+
* @param {string} [data.EMail] - Optional. The email address for the referral.
|
|
122
|
+
* @param {"true" | "false"} [data.IsDoctor] - Optional. Either "true" or "false". Default "false", unless a Specialty was supplied.
|
|
123
|
+
* @param {string} [data.BusinessName] - Optional. Name of the business that the referral works for.
|
|
124
|
+
* @param {string} [data.DisplayNote] - Optional. Shows in the Family Module's Patient Info grid.
|
|
125
|
+
* @returns {Promise<Referral>} - The updated referral.
|
|
126
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
127
|
+
*/
|
|
128
|
+
async updateReferral({ ReferralNum, LName, FName, MName, SSN, UsingTIN, Specialty, ST, Telephone, Address, Address2, City, Zip, Note, Phone2, NotPerson, Title, EMail, IsDoctor, BusinessName, DisplayNote, }) {
|
|
129
|
+
if (!ReferralNum || typeof ReferralNum !== "number") {
|
|
130
|
+
throw new Error("Invalid data: ReferralNum is required.");
|
|
131
|
+
}
|
|
132
|
+
return this.httpClient.put(`/referrals/${ReferralNum}`, {
|
|
133
|
+
LName,
|
|
134
|
+
FName,
|
|
135
|
+
MName,
|
|
136
|
+
SSN,
|
|
137
|
+
UsingTIN,
|
|
138
|
+
Specialty,
|
|
139
|
+
ST,
|
|
140
|
+
Telephone,
|
|
141
|
+
Address,
|
|
142
|
+
Address2,
|
|
143
|
+
City,
|
|
144
|
+
Zip,
|
|
145
|
+
Note,
|
|
146
|
+
Phone2,
|
|
147
|
+
NotPerson,
|
|
148
|
+
Title,
|
|
149
|
+
EMail,
|
|
150
|
+
IsDoctor,
|
|
151
|
+
BusinessName,
|
|
152
|
+
DisplayNote,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.default = Referrals;
|
package/dist/openDental.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ import DiscountPlanSubs from "./api/discountPlanSubs";
|
|
|
15
15
|
import FamilyModules from "./api/familyModules";
|
|
16
16
|
import InsSubs from "./api/insSubs";
|
|
17
17
|
import PatPlans from "./api/patPlans";
|
|
18
|
+
import LabCases from "./api/labCases";
|
|
19
|
+
import Referrals from "./api/referrals";
|
|
20
|
+
import RefAttaches from "./api/refAttaches";
|
|
18
21
|
declare class OpenDental {
|
|
19
22
|
private static httpClient;
|
|
20
23
|
/**
|
|
@@ -92,7 +95,15 @@ declare class OpenDental {
|
|
|
92
95
|
/**
|
|
93
96
|
* Create a new instance of the LabCases API.
|
|
94
97
|
*/
|
|
95
|
-
static LabCases():
|
|
98
|
+
static LabCases(): LabCases;
|
|
99
|
+
/**
|
|
100
|
+
* Create a new instance of the Referrals API.
|
|
101
|
+
*/
|
|
102
|
+
static Referrals(): Referrals;
|
|
103
|
+
/**
|
|
104
|
+
* Create a new instance of the LabCases API.
|
|
105
|
+
*/
|
|
106
|
+
static RefAttaches(): RefAttaches;
|
|
96
107
|
}
|
|
97
108
|
export { OpenDental };
|
|
98
109
|
//# sourceMappingURL=openDental.d.ts.map
|
package/dist/openDental.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openDental.d.ts","sourceRoot":"","sources":["../src/openDental.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"openDental.d.ts","sourceRoot":"","sources":["../src/openDental.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAE5C,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAC,UAAU,CAAa;IAEtC;;OAEG;WACW,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAWlE;;OAEG;WACa,YAAY;IAQ5B;;OAEG;WACa,QAAQ;IAOxB;;OAEG;WACW,YAAY;IAO1B;;SAEK;WACS,SAAS;IAOvB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,aAAa;IAO3B;;OAEG;WACW,OAAO;IAOrB;;OAEG;WACW,cAAc;IAO5B;;OAEG;WACa,SAAS;IAOzB;;OAEG;WACa,SAAS;IAOzB;;OAEG;WACa,WAAW;IAO3B;;OAEG;WACa,QAAQ;IAOxB;;OAEG;WACW,WAAW;IAOzB;;OAEG;WACW,gBAAgB;IAO9B;;OAEG;WACW,aAAa;IAO3B;;OAEG;WACW,OAAO;IAOrB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,SAAS;IAOvB;;OAEG;WACW,WAAW;CAM1B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/openDental.js
CHANGED
|
@@ -22,6 +22,9 @@ const discountPlanSubs_1 = __importDefault(require("./api/discountPlanSubs"));
|
|
|
22
22
|
const familyModules_1 = __importDefault(require("./api/familyModules"));
|
|
23
23
|
const insSubs_1 = __importDefault(require("./api/insSubs"));
|
|
24
24
|
const patPlans_1 = __importDefault(require("./api/patPlans"));
|
|
25
|
+
const labCases_1 = __importDefault(require("./api/labCases"));
|
|
26
|
+
const referrals_1 = __importDefault(require("./api/referrals"));
|
|
27
|
+
const refAttaches_1 = __importDefault(require("./api/refAttaches"));
|
|
25
28
|
class OpenDental {
|
|
26
29
|
static httpClient;
|
|
27
30
|
/**
|
|
@@ -195,7 +198,25 @@ class OpenDental {
|
|
|
195
198
|
if (!this.httpClient) {
|
|
196
199
|
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
197
200
|
}
|
|
198
|
-
return new
|
|
201
|
+
return new labCases_1.default(this.httpClient);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Create a new instance of the Referrals API.
|
|
205
|
+
*/
|
|
206
|
+
static Referrals() {
|
|
207
|
+
if (!this.httpClient) {
|
|
208
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
209
|
+
}
|
|
210
|
+
return new referrals_1.default(this.httpClient);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Create a new instance of the LabCases API.
|
|
214
|
+
*/
|
|
215
|
+
static RefAttaches() {
|
|
216
|
+
if (!this.httpClient) {
|
|
217
|
+
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
218
|
+
}
|
|
219
|
+
return new refAttaches_1.default(this.httpClient);
|
|
199
220
|
}
|
|
200
221
|
}
|
|
201
222
|
exports.OpenDental = OpenDental;
|
|
@@ -0,0 +1,59 @@
|
|
|
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;
|
|
7
|
+
ReferralNum?: number;
|
|
8
|
+
referralName?: string;
|
|
9
|
+
PatNum?: number;
|
|
10
|
+
ItemOrder?: number;
|
|
11
|
+
RefDate?: string;
|
|
12
|
+
ReferralType?: "RefTo" | "RefFrom" | "RefCustom";
|
|
13
|
+
RefToStatus?: "None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete";
|
|
14
|
+
Note?: string;
|
|
15
|
+
IsTransitionOfCare?: "true" | "false";
|
|
16
|
+
ProcNum?: number;
|
|
17
|
+
DateProcComplete?: string;
|
|
18
|
+
ProvNum?: number;
|
|
19
|
+
DateTStamp?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GetRefAttachesParams {
|
|
22
|
+
PatNum?: number;
|
|
23
|
+
Offset?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Attaches a patient to a referral source. The referral source must be specified by either ReferralNum or referralName.
|
|
27
|
+
* Before calling this method, use Referrals GET to find the ReferralNum of an existing referral source.
|
|
28
|
+
* Alternatively, specify a referralName to search the LName of existing referrals for an exact match.
|
|
29
|
+
* If a match is not found, a new referral with that name is created and used.
|
|
30
|
+
*/
|
|
31
|
+
export interface CreateRefAttachParams {
|
|
32
|
+
PatNum: number;
|
|
33
|
+
ReferralNum?: number;
|
|
34
|
+
referralName?: string;
|
|
35
|
+
RefDate?: string;
|
|
36
|
+
ReferralType?: "RefTo" | "RefFrom" | "RefCustom";
|
|
37
|
+
RefToStatus?: "None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete";
|
|
38
|
+
Note?: string;
|
|
39
|
+
IsTransitionOfCare?: "true" | "false";
|
|
40
|
+
ProcNum?: number;
|
|
41
|
+
DateProcComplete?: string;
|
|
42
|
+
ProvNum?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Updates an existing refattach.
|
|
46
|
+
*/
|
|
47
|
+
export interface UpdateRefAttachParams {
|
|
48
|
+
RefAttachNum: number;
|
|
49
|
+
ReferralNum?: number;
|
|
50
|
+
RefDate?: string;
|
|
51
|
+
ReferralType?: "RefTo" | "RefFrom" | "RefCustom";
|
|
52
|
+
RefToStatus?: "None" | "Declined" | "Scheduled" | "Consulted" | "InTreatment" | "Complete";
|
|
53
|
+
Note?: string;
|
|
54
|
+
IsTransitionOfCare?: "true" | "false";
|
|
55
|
+
ProcNum?: number;
|
|
56
|
+
DateProcComplete?: string;
|
|
57
|
+
ProvNum?: number;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=refAttachTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refAttachTypes.d.ts","sourceRoot":"","sources":["../../src/types/refAttachTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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;
|
|
7
|
+
LName?: string;
|
|
8
|
+
FName?: string;
|
|
9
|
+
MName?: string;
|
|
10
|
+
SSN?: string;
|
|
11
|
+
UsingTIN?: "true" | "false";
|
|
12
|
+
Specialty?: number;
|
|
13
|
+
specialty?: string;
|
|
14
|
+
ST?: string;
|
|
15
|
+
Telephone?: string;
|
|
16
|
+
Address?: string;
|
|
17
|
+
Address2?: string;
|
|
18
|
+
City?: number;
|
|
19
|
+
Zip?: string;
|
|
20
|
+
Note?: string;
|
|
21
|
+
Phone2?: string;
|
|
22
|
+
IsHidden?: "true" | "false";
|
|
23
|
+
NotPerson?: string;
|
|
24
|
+
Title?: string;
|
|
25
|
+
EMail?: string;
|
|
26
|
+
PatNum?: string;
|
|
27
|
+
IsDoctor?: "true" | "false";
|
|
28
|
+
DateTStamp?: string;
|
|
29
|
+
IsPreferred?: "true" | "false";
|
|
30
|
+
BusinessName?: string;
|
|
31
|
+
DisplayNote?: string;
|
|
32
|
+
isPatient?: "true" | "false";
|
|
33
|
+
}
|
|
34
|
+
export interface GetReferralsParams {
|
|
35
|
+
IsHidden?: "true" | "false";
|
|
36
|
+
NotPerson?: "true" | "false";
|
|
37
|
+
IsDoctor?: "true" | "false";
|
|
38
|
+
IsPreferred?: "true" | "false";
|
|
39
|
+
isPatient?: "true" | "false";
|
|
40
|
+
BusinessName?: string;
|
|
41
|
+
Offset?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new Referral. Referrals can be for patients (provide PatNum), providers (provide specialty) or non-persons (provide neither PatNum or specialty).
|
|
45
|
+
* In the last case, isPatient and IsDoctor will be set false automatically while NotPerson will be set to true.
|
|
46
|
+
* If you wish to create an associated RefAttach please see RefAttaches POST.
|
|
47
|
+
*/
|
|
48
|
+
export interface CreateReferralParams {
|
|
49
|
+
LName?: string;
|
|
50
|
+
PatNum?: string;
|
|
51
|
+
FName?: string;
|
|
52
|
+
MName?: string;
|
|
53
|
+
SSN?: string;
|
|
54
|
+
UsingTIN?: "true" | "false";
|
|
55
|
+
Specialty?: number;
|
|
56
|
+
specialty?: string;
|
|
57
|
+
ST?: string;
|
|
58
|
+
Telephone?: string;
|
|
59
|
+
Address?: string;
|
|
60
|
+
Address2?: string;
|
|
61
|
+
City?: string;
|
|
62
|
+
Zip?: string;
|
|
63
|
+
Note?: string;
|
|
64
|
+
Phone2?: string;
|
|
65
|
+
NotPerson?: string;
|
|
66
|
+
Title?: string;
|
|
67
|
+
EMail?: string;
|
|
68
|
+
IsDoctor?: "true" | "false";
|
|
69
|
+
BusinessName?: string;
|
|
70
|
+
DisplayNote?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Updates an existing Referral. All fields are optional. Referrals for a patient can only have the Note and DisplayNote fields modified.
|
|
74
|
+
*/
|
|
75
|
+
export interface UpdateReferralParams {
|
|
76
|
+
ReferralNum?: number;
|
|
77
|
+
LName?: string;
|
|
78
|
+
FName?: string;
|
|
79
|
+
MName?: string;
|
|
80
|
+
SSN?: string;
|
|
81
|
+
UsingTIN?: "true" | "false";
|
|
82
|
+
Specialty?: number;
|
|
83
|
+
ST?: string;
|
|
84
|
+
Telephone?: string;
|
|
85
|
+
Address?: string;
|
|
86
|
+
Address2?: string;
|
|
87
|
+
City?: number;
|
|
88
|
+
Zip?: string;
|
|
89
|
+
Note?: string;
|
|
90
|
+
Phone2?: string;
|
|
91
|
+
NotPerson?: string;
|
|
92
|
+
Title?: string;
|
|
93
|
+
EMail?: string;
|
|
94
|
+
IsDoctor?: "true" | "false";
|
|
95
|
+
BusinessName?: string;
|
|
96
|
+
DisplayNote?: string;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=referralTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referralTypes.d.ts","sourceRoot":"","sources":["../../src/types/referralTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAGD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
RefAttach,
|
|
4
|
+
GetRefAttachesParams,
|
|
5
|
+
CreateRefAttachParams,
|
|
6
|
+
UpdateRefAttachParams,
|
|
7
|
+
} from "../types/refAttachTypes"
|
|
8
|
+
|
|
9
|
+
export default class RefAttaches {
|
|
10
|
+
private httpClient: HttpClient;
|
|
11
|
+
|
|
12
|
+
constructor(httpClient: HttpClient) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch multiple refattaches with optional filtering and pagination.
|
|
18
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
19
|
+
* @param {number} [params.PatNum] - The PatNum of the RefAttaches.
|
|
20
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
21
|
+
* @returns {Promise<RefAttach[]>} - A list of inssubs.
|
|
22
|
+
*/
|
|
23
|
+
public async getRefAttaches({
|
|
24
|
+
PatNum,
|
|
25
|
+
Offset,
|
|
26
|
+
}: GetRefAttachesParams = {}): Promise<RefAttach[]> {
|
|
27
|
+
const params = {
|
|
28
|
+
PatNum,
|
|
29
|
+
Offset,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return this.httpClient.get<RefAttach[]>("/refattaches", params);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Attach a referral to a patient.
|
|
37
|
+
* @param {Object} data - The details of RefAttach to create.
|
|
38
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum.
|
|
39
|
+
* @param {number} [data.ReferralNum] - Required. The PatNum of the patient who is subscribed to this plan.
|
|
40
|
+
* @param {string} [data.referralName] - Required. Number assigned by insurance company.
|
|
41
|
+
* @param {string} [data.RefDate] - Optional. The date this InsPlan became effective.
|
|
42
|
+
* @param {"RefTo" | "RefFrom" | "RefCustom"} [data.ReferralType] - Optional. Not usually used. The date this InsPlan was terminated.
|
|
43
|
+
* @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.
|
|
44
|
+
* @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.
|
|
45
|
+
* @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.
|
|
46
|
+
* @param {number} [data.ProcNum] - Optional. Use to store any other info that affects coverage.
|
|
47
|
+
* @param {string} [data.DateProcComplete] - Optional. Use to store any other info that affects coverage.
|
|
48
|
+
* @param {number} [data.ProvNum] - Optional. Use to store any other info that affects coverage.
|
|
49
|
+
* @returns {Promise<RefAttach>} - The created refattaches.
|
|
50
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
51
|
+
*/
|
|
52
|
+
public async createRefAttach({
|
|
53
|
+
PatNum,
|
|
54
|
+
ReferralNum,
|
|
55
|
+
referralName,
|
|
56
|
+
RefDate,
|
|
57
|
+
ReferralType,
|
|
58
|
+
RefToStatus,
|
|
59
|
+
Note,
|
|
60
|
+
IsTransitionOfCare,
|
|
61
|
+
ProcNum,
|
|
62
|
+
DateProcComplete,
|
|
63
|
+
ProvNum,
|
|
64
|
+
} : CreateRefAttachParams): Promise<RefAttach> {
|
|
65
|
+
if (!PatNum || (!ReferralNum && !referralName)) {
|
|
66
|
+
throw new Error("Invalid data: PatNum and either ReferralNum or referralName are required.");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return this.httpClient.post<RefAttach>("/refattaches", {
|
|
70
|
+
PatNum,
|
|
71
|
+
ReferralNum,
|
|
72
|
+
referralName,
|
|
73
|
+
RefDate,
|
|
74
|
+
ReferralType,
|
|
75
|
+
RefToStatus,
|
|
76
|
+
Note,
|
|
77
|
+
IsTransitionOfCare,
|
|
78
|
+
ProcNum,
|
|
79
|
+
DateProcComplete,
|
|
80
|
+
ProvNum,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Update a refattach.
|
|
86
|
+
* @param {Object} data - The details of RefAttach to create.
|
|
87
|
+
* @param {number} data.RefAttachNum - Required. FK to patient.PatNum.
|
|
88
|
+
* @param {number} [data.ReferralNum] - Required. The PatNum of the patient who is subscribed to this plan.
|
|
89
|
+
* @param {string} [data.RefDate] - Optional. The date this InsPlan became effective.
|
|
90
|
+
* @param {"RefTo" | "RefFrom" | "RefCustom"} [data.ReferralType] - Optional. Not usually used. The date this InsPlan was terminated.
|
|
91
|
+
* @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.
|
|
92
|
+
* @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.
|
|
93
|
+
* @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.
|
|
94
|
+
* @param {number} [data.ProcNum] - Optional. Use to store any other info that affects coverage.
|
|
95
|
+
* @param {string} [data.DateProcComplete] - Optional. Use to store any other info that affects coverage.
|
|
96
|
+
* @param {number} [data.ProvNum] - Optional. Use to store any other info that affects coverage.
|
|
97
|
+
* @returns {Promise<RefAttach>} - The created refattaches.
|
|
98
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
99
|
+
*/
|
|
100
|
+
public async updateRefAttach({
|
|
101
|
+
RefAttachNum,
|
|
102
|
+
ReferralNum,
|
|
103
|
+
RefDate,
|
|
104
|
+
ReferralType,
|
|
105
|
+
RefToStatus,
|
|
106
|
+
Note,
|
|
107
|
+
IsTransitionOfCare,
|
|
108
|
+
ProcNum,
|
|
109
|
+
DateProcComplete,
|
|
110
|
+
ProvNum,
|
|
111
|
+
} : UpdateRefAttachParams): Promise<RefAttach> {
|
|
112
|
+
if (!RefAttachNum) {
|
|
113
|
+
throw new Error("Invalid data: RefAttachNum is required.");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return this.httpClient.put<RefAttach>(`/refattaches/${RefAttachNum}`, {
|
|
117
|
+
ReferralNum,
|
|
118
|
+
RefDate,
|
|
119
|
+
ReferralType,
|
|
120
|
+
RefToStatus,
|
|
121
|
+
Note,
|
|
122
|
+
IsTransitionOfCare,
|
|
123
|
+
ProcNum,
|
|
124
|
+
DateProcComplete,
|
|
125
|
+
ProvNum,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Delete a refattach.
|
|
131
|
+
* @param {number} RefAttachNum - Required: The unique identifier of the RefAttach to delete.
|
|
132
|
+
* @returns {Promise<void>} - Resolves when the discount plan sub is deleted.
|
|
133
|
+
* @throws {Error} - If `RefAttachNum` is not valid or the API returns an error.
|
|
134
|
+
*/
|
|
135
|
+
public async deleteInsSub(RefAttachNum: number): Promise<void> {
|
|
136
|
+
if (!RefAttachNum || typeof RefAttachNum !== "number") {
|
|
137
|
+
throw new Error("Invalid parameter: RefAttachNum must be a valid number.");
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return this.httpClient.delete<void>(`/refattaches/${RefAttachNum}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -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,8 @@ 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";
|
|
20
22
|
|
|
21
23
|
class OpenDental {
|
|
22
24
|
private static httpClient: HttpClient;
|
|
@@ -213,7 +215,27 @@ class OpenDental {
|
|
|
213
215
|
if (!this.httpClient) {
|
|
214
216
|
throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
|
|
215
217
|
}
|
|
216
|
-
return new
|
|
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);
|
|
217
239
|
}
|
|
218
240
|
}
|
|
219
241
|
|
|
@@ -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
|
+
|