@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
package/deploy_notes.txt
CHANGED
|
@@ -10,7 +10,7 @@ git tag //confirm tag
|
|
|
10
10
|
git push origin vX.Y.Z
|
|
11
11
|
gh release create vX.Y.Z --title "Release vX.Y.Z" --notes ""
|
|
12
12
|
|
|
13
|
-
gh release create v1.0.
|
|
13
|
+
gh release create v1.0.4 --title "Release v1.0.4" --notes "addition of patplan, insplan, familymodule apis"
|
|
14
14
|
|
|
15
15
|
if the tag doesn't exist locally:
|
|
16
16
|
git tag vX.Y.Z
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { LabCase, GetLabCasesParams, CreateLabCaseParams, UpdateLabCaseParams } from "../types/labCaseTypes";
|
|
3
|
+
export default class LabCases {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch a single lab case by its ID.
|
|
8
|
+
* @param {number} LabCaseNum - The unique identifier for the LabCase.
|
|
9
|
+
* @returns {Promise<LabCase>} - The LabCase object.
|
|
10
|
+
* @throws {Error} - If `LabCaseNum` is not provided.
|
|
11
|
+
*/
|
|
12
|
+
getLabCase(LabCaseNum: number): Promise<LabCase>;
|
|
13
|
+
/**
|
|
14
|
+
* Fetch multiple lab cases with optional filtering and pagination.
|
|
15
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
16
|
+
* @param {number} [params.PatNum] - FK to patient.PatNum.
|
|
17
|
+
* @param {number} [params.LaboratoryNum] - FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
18
|
+
* @param {number} [params.AptNum] - FK to appointment.AptNum.
|
|
19
|
+
* @param {number} [params.PlannedAptNum] - FK to appointment.AptNum.
|
|
20
|
+
* @param {number} [params.ProvNum] - FK to provider.ProvNum.
|
|
21
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
22
|
+
* @returns {Promise<LabCase[]>} - A list of lab cases.
|
|
23
|
+
*/
|
|
24
|
+
getLabCases({ PatNum, LaboratoryNum, AptNum, PlannedAptNum, ProvNum }?: GetLabCasesParams): Promise<LabCase[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a new inssub.
|
|
27
|
+
* @param {Object} data - The details of InsSub to create.
|
|
28
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum.
|
|
29
|
+
* @param {number} data.LaboratoryNum - Required. FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
30
|
+
* @param {number} data.ProvNum - Required. FK to provider.ProvNum.
|
|
31
|
+
* @param {number} [data.AptNum] - Optional. FK to appointment.AptNum where appointment.AptStatus=Scheduled.
|
|
32
|
+
* @param {number} [data.PlannedAptNum] - Optional. FK to appointment.AptNum where appointment.AptStatus=Planned.
|
|
33
|
+
* @param {string} [data.DateTimeDue] - Optional. The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
34
|
+
* @param {string} [data.DateTimeCreated] - Optional. The created date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
35
|
+
* @param {string} [data.DateTimeSent] - Optional. The sent date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
36
|
+
* @param {string} [data.DateTimeRecd] - Optional. The received date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
37
|
+
* @param {string} [data.DateTimeChecked] - Optional. The checked date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
38
|
+
* @param {string} [data.Instructions] - Optional. The text instructions for this labcase.
|
|
39
|
+
* @param {number} [data.LabFee] - Optional. This is used for tracking and informational purposes only. The fee is not used in any calculation.
|
|
40
|
+
* @param {string} [data.InvoiceNum] - Optional. This is an optional invoice number used for tracking and informational purposes only.
|
|
41
|
+
* @returns {Promise<LabCase>} - The created lab case.
|
|
42
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
43
|
+
*/
|
|
44
|
+
createLabCase({ PatNum, LaboratoryNum, ProvNum, AptNum, PlannedAptNum, DateTimeDue, DateTimeCreated, DateTimeSent, DateTimeRecd, DateTimeChecked, Instructions, LabFee, InvoiceNum, }: CreateLabCaseParams): Promise<LabCase>;
|
|
45
|
+
/**
|
|
46
|
+
* Update an inssub.
|
|
47
|
+
* @param {Object} data - The details of lab case to update.
|
|
48
|
+
* @param {number} data.LabCaseNum - Required in the URL. The PK of the lab case.
|
|
49
|
+
* @param {number} [data.LaboratoryNum] - FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
50
|
+
* @param {number} [data.AptNum] - FK to appointment.AptNum where appointment.AptStatus=Scheduled.
|
|
51
|
+
* @param {number} [data.PlannedAptNum] - FK to appointment.AptNum where appointment.AptStatus=Planned.
|
|
52
|
+
* @param {string} [data.DateTimeDue] - The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
53
|
+
* @param {string} [data.DateTimeCreated] - The created date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
54
|
+
* @param {string} [data.DateTimeSent] - The sent date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
55
|
+
* @param {string} [data.DateTimeRecd] - The received date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
56
|
+
* @param {string} [data.DateTimeChecked] - The checked date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
57
|
+
* @param {number} [data.ProvNum] - FK to provider.ProvNum.
|
|
58
|
+
* @param {string} [data.Instructions] - The text instructions for this labcase.
|
|
59
|
+
* @param {number} [data.LabFee] - This is used for tracking and informational purposes only. The fee is not used in any calculation.
|
|
60
|
+
* @param {string} [data.InvoiceNum] - This is an optional invoice number used for tracking and informational purposes only.
|
|
61
|
+
* @returns {Promise<LabCase>} - The updated lab case.
|
|
62
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
63
|
+
*/
|
|
64
|
+
updateLabCase({ LabCaseNum, LaboratoryNum, ProvNum, AptNum, PlannedAptNum, DateTimeDue, DateTimeCreated, DateTimeSent, DateTimeRecd, DateTimeChecked, Instructions, LabFee, InvoiceNum, }: UpdateLabCaseParams): Promise<LabCase>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=labCases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labCases.d.ts","sourceRoot":"","sources":["../../src/api/labCases.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;OAKG;IACU,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO7D;;;;;;;;;;QAUI;IACS,WAAW,CAAC,EACvB,MAAM,EACN,aAAa,EACb,MAAM,EACN,aAAa,EACb,OAAO,EACR,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAY9C;;;;;;;;;;;;;;;;;;OAkBG;IACU,aAAa,CAAC,EACzB,MAAM,EACN,aAAa,EACb,OAAO,EACP,MAAM,EACN,aAAa,EACb,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,MAAM,EACN,UAAU,GACX,EAAG,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAsB1C;;;;;;;;;;;;;;;;;;OAkBG;IACU,aAAa,CAAC,EACzB,UAAU,EACV,aAAa,EACb,OAAO,EACP,MAAM,EACN,aAAa,EACb,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,MAAM,EACN,UAAU,GACX,EAAG,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAqC3C"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class LabCases {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch a single lab case by its ID.
|
|
10
|
+
* @param {number} LabCaseNum - The unique identifier for the LabCase.
|
|
11
|
+
* @returns {Promise<LabCase>} - The LabCase object.
|
|
12
|
+
* @throws {Error} - If `LabCaseNum` is not provided.
|
|
13
|
+
*/
|
|
14
|
+
async getLabCase(LabCaseNum) {
|
|
15
|
+
if (!LabCaseNum) {
|
|
16
|
+
throw new Error("LabCaseNum is required.");
|
|
17
|
+
}
|
|
18
|
+
return this.httpClient.get(`/labcases/${LabCaseNum}`);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Fetch multiple lab cases with optional filtering and pagination.
|
|
22
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
23
|
+
* @param {number} [params.PatNum] - FK to patient.PatNum.
|
|
24
|
+
* @param {number} [params.LaboratoryNum] - FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
25
|
+
* @param {number} [params.AptNum] - FK to appointment.AptNum.
|
|
26
|
+
* @param {number} [params.PlannedAptNum] - FK to appointment.AptNum.
|
|
27
|
+
* @param {number} [params.ProvNum] - FK to provider.ProvNum.
|
|
28
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
29
|
+
* @returns {Promise<LabCase[]>} - A list of lab cases.
|
|
30
|
+
*/
|
|
31
|
+
async getLabCases({ PatNum, LaboratoryNum, AptNum, PlannedAptNum, ProvNum } = {}) {
|
|
32
|
+
const params = {
|
|
33
|
+
PatNum,
|
|
34
|
+
LaboratoryNum,
|
|
35
|
+
AptNum,
|
|
36
|
+
PlannedAptNum,
|
|
37
|
+
ProvNum
|
|
38
|
+
};
|
|
39
|
+
return this.httpClient.get("/labcases", params);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a new inssub.
|
|
43
|
+
* @param {Object} data - The details of InsSub to create.
|
|
44
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum.
|
|
45
|
+
* @param {number} data.LaboratoryNum - Required. FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
46
|
+
* @param {number} data.ProvNum - Required. FK to provider.ProvNum.
|
|
47
|
+
* @param {number} [data.AptNum] - Optional. FK to appointment.AptNum where appointment.AptStatus=Scheduled.
|
|
48
|
+
* @param {number} [data.PlannedAptNum] - Optional. FK to appointment.AptNum where appointment.AptStatus=Planned.
|
|
49
|
+
* @param {string} [data.DateTimeDue] - Optional. The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
50
|
+
* @param {string} [data.DateTimeCreated] - Optional. The created date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
51
|
+
* @param {string} [data.DateTimeSent] - Optional. The sent date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
52
|
+
* @param {string} [data.DateTimeRecd] - Optional. The received date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
53
|
+
* @param {string} [data.DateTimeChecked] - Optional. The checked date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
54
|
+
* @param {string} [data.Instructions] - Optional. The text instructions for this labcase.
|
|
55
|
+
* @param {number} [data.LabFee] - Optional. This is used for tracking and informational purposes only. The fee is not used in any calculation.
|
|
56
|
+
* @param {string} [data.InvoiceNum] - Optional. This is an optional invoice number used for tracking and informational purposes only.
|
|
57
|
+
* @returns {Promise<LabCase>} - The created lab case.
|
|
58
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
59
|
+
*/
|
|
60
|
+
async createLabCase({ PatNum, LaboratoryNum, ProvNum, AptNum, PlannedAptNum, DateTimeDue, DateTimeCreated, DateTimeSent, DateTimeRecd, DateTimeChecked, Instructions, LabFee, InvoiceNum, }) {
|
|
61
|
+
if (!PatNum || !LaboratoryNum || !ProvNum) {
|
|
62
|
+
throw new Error("Invalid data: PatNum, LaboratoryNum, and ProvNum are required.");
|
|
63
|
+
}
|
|
64
|
+
return this.httpClient.post("/labcases", {
|
|
65
|
+
PatNum,
|
|
66
|
+
LaboratoryNum,
|
|
67
|
+
ProvNum,
|
|
68
|
+
AptNum,
|
|
69
|
+
PlannedAptNum,
|
|
70
|
+
DateTimeDue,
|
|
71
|
+
DateTimeCreated,
|
|
72
|
+
DateTimeSent,
|
|
73
|
+
DateTimeRecd,
|
|
74
|
+
DateTimeChecked,
|
|
75
|
+
Instructions,
|
|
76
|
+
LabFee,
|
|
77
|
+
InvoiceNum,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Update an inssub.
|
|
82
|
+
* @param {Object} data - The details of lab case to update.
|
|
83
|
+
* @param {number} data.LabCaseNum - Required in the URL. The PK of the lab case.
|
|
84
|
+
* @param {number} [data.LaboratoryNum] - FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
|
|
85
|
+
* @param {number} [data.AptNum] - FK to appointment.AptNum where appointment.AptStatus=Scheduled.
|
|
86
|
+
* @param {number} [data.PlannedAptNum] - FK to appointment.AptNum where appointment.AptStatus=Planned.
|
|
87
|
+
* @param {string} [data.DateTimeDue] - The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
88
|
+
* @param {string} [data.DateTimeCreated] - The created date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
89
|
+
* @param {string} [data.DateTimeSent] - The sent date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
90
|
+
* @param {string} [data.DateTimeRecd] - The received date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
91
|
+
* @param {string} [data.DateTimeChecked] - The checked date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
92
|
+
* @param {number} [data.ProvNum] - FK to provider.ProvNum.
|
|
93
|
+
* @param {string} [data.Instructions] - The text instructions for this labcase.
|
|
94
|
+
* @param {number} [data.LabFee] - This is used for tracking and informational purposes only. The fee is not used in any calculation.
|
|
95
|
+
* @param {string} [data.InvoiceNum] - This is an optional invoice number used for tracking and informational purposes only.
|
|
96
|
+
* @returns {Promise<LabCase>} - The updated lab case.
|
|
97
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
98
|
+
*/
|
|
99
|
+
async updateLabCase({ LabCaseNum, LaboratoryNum, ProvNum, AptNum, PlannedAptNum, DateTimeDue, DateTimeCreated, DateTimeSent, DateTimeRecd, DateTimeChecked, Instructions, LabFee, InvoiceNum, }) {
|
|
100
|
+
if (!LabCaseNum || typeof LabCaseNum !== "number") {
|
|
101
|
+
throw new Error("Invalid data: A Valid LabCaseNum is required.");
|
|
102
|
+
}
|
|
103
|
+
return this.httpClient.put(`/labcases/${LabCaseNum}`, {
|
|
104
|
+
LaboratoryNum,
|
|
105
|
+
ProvNum,
|
|
106
|
+
AptNum,
|
|
107
|
+
PlannedAptNum,
|
|
108
|
+
DateTimeDue,
|
|
109
|
+
DateTimeCreated,
|
|
110
|
+
DateTimeSent,
|
|
111
|
+
DateTimeRecd,
|
|
112
|
+
DateTimeChecked,
|
|
113
|
+
Instructions,
|
|
114
|
+
LabFee,
|
|
115
|
+
InvoiceNum,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.default = LabCases;
|
|
@@ -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;
|