@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.
@@ -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
  /**
@@ -89,6 +92,18 @@ declare class OpenDental {
89
92
  * Create a new instance of the PatPlan API.
90
93
  */
91
94
  static PatPlans(): PatPlans;
95
+ /**
96
+ * Create a new instance of the LabCases API.
97
+ */
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;
92
107
  }
93
108
  export { OpenDental };
94
109
  //# sourceMappingURL=openDental.d.ts.map
@@ -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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Modules_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
  /**
@@ -188,5 +191,32 @@ class OpenDental {
188
191
  }
189
192
  return new patPlans_1.default(this.httpClient);
190
193
  }
194
+ /**
195
+ * Create a new instance of the LabCases API.
196
+ */
197
+ static LabCases() {
198
+ if (!this.httpClient) {
199
+ throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
200
+ }
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);
220
+ }
191
221
  }
192
222
  exports.OpenDental = OpenDental;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Represents an InsSub in the Open Dental system. Links an InsPlan to a Subscriber (patient.PatNum). Also, see PatPlans to indicate coverage.
3
+ * @see https://www.opendental.com/site/apilabcases.html
4
+ */
5
+ export interface LabCase {
6
+ LabCaseNum?: number;
7
+ PatNum?: number;
8
+ LaboratoryNum?: number;
9
+ AptNum?: number;
10
+ PlannedAptNum?: number;
11
+ DateTimeDue?: string;
12
+ DateTimeCreated?: string;
13
+ DateTimeSent?: string;
14
+ DateTimeRecd?: string;
15
+ DateTimeChecked?: string;
16
+ ProvNum?: number;
17
+ Instructions?: string;
18
+ LabFee?: number;
19
+ DateTStamp?: string;
20
+ InvoiceNum?: string;
21
+ }
22
+ /**
23
+ * Gets a list of labcases.
24
+ */
25
+ export interface GetLabCasesParams {
26
+ PatNum?: number;
27
+ LaboratoryNum?: number;
28
+ AptNum?: number;
29
+ PlannedAptNum?: number;
30
+ ProvNum?: number;
31
+ }
32
+ /**
33
+ * Creates a labcase.
34
+ */
35
+ export interface CreateLabCaseParams {
36
+ PatNum?: number;
37
+ LaboratoryNum?: number;
38
+ ProvNum?: number;
39
+ AptNum?: number;
40
+ PlannedAptNum?: number;
41
+ DateTimeDue?: string;
42
+ DateTimeCreated?: string;
43
+ DateTimeSent?: string;
44
+ DateTimeRecd?: string;
45
+ DateTimeChecked?: string;
46
+ Instructions?: string;
47
+ LabFee?: number;
48
+ InvoiceNum?: string;
49
+ }
50
+ /**
51
+ * Updates a labcase.
52
+ */
53
+ export interface UpdateLabCaseParams {
54
+ LabCaseNum?: number;
55
+ LaboratoryNum?: number;
56
+ ProvNum?: number;
57
+ AptNum?: number;
58
+ PlannedAptNum?: number;
59
+ DateTimeDue?: string;
60
+ DateTimeCreated?: string;
61
+ DateTimeSent?: string;
62
+ DateTimeRecd?: string;
63
+ DateTimeChecked?: string;
64
+ Instructions?: string;
65
+ LabFee?: number;
66
+ InvoiceNum?: string;
67
+ }
68
+ //# sourceMappingURL=labCaseTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labCaseTypes.d.ts","sourceRoot":"","sources":["../../src/types/labCaseTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,OAAO;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAA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,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,C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+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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M,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rinse-dental/open-dental",
3
- "version": "1.0.9",
3
+ "version": "1.2.0",
4
4
  "description": "A TypeScript library for easily accessing Open Dental APIs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,183 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import {
3
+ LabCase,
4
+ GetLabCasesParams,
5
+ CreateLabCaseParams,
6
+ UpdateLabCaseParams,
7
+ } from "../types/labCaseTypes";
8
+
9
+ export default class LabCases {
10
+ private httpClient: HttpClient;
11
+
12
+ constructor(httpClient: HttpClient) {
13
+ this.httpClient = httpClient;
14
+ }
15
+
16
+ /**
17
+ * Fetch a single lab case by its ID.
18
+ * @param {number} LabCaseNum - The unique identifier for the LabCase.
19
+ * @returns {Promise<LabCase>} - The LabCase object.
20
+ * @throws {Error} - If `LabCaseNum` is not provided.
21
+ */
22
+ public async getLabCase(LabCaseNum: number): Promise<LabCase> {
23
+ if (!LabCaseNum) {
24
+ throw new Error("LabCaseNum is required.");
25
+ }
26
+ return this.httpClient.get<LabCase>(`/labcases/${LabCaseNum}`);
27
+ }
28
+
29
+ /**
30
+ * Fetch multiple lab cases with optional filtering and pagination.
31
+ * @param {Object} params - The parameters for filtering and pagination.
32
+ * @param {number} [params.PatNum] - FK to patient.PatNum.
33
+ * @param {number} [params.LaboratoryNum] - FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
34
+ * @param {number} [params.AptNum] - FK to appointment.AptNum.
35
+ * @param {number} [params.PlannedAptNum] - FK to appointment.AptNum.
36
+ * @param {number} [params.ProvNum] - FK to provider.ProvNum.
37
+ * @param {number} [params.Offset] - Pagination offset for results.
38
+ * @returns {Promise<LabCase[]>} - A list of lab cases.
39
+ */
40
+ public async getLabCases({
41
+ PatNum,
42
+ LaboratoryNum,
43
+ AptNum,
44
+ PlannedAptNum,
45
+ ProvNum
46
+ }: GetLabCasesParams = {}): Promise<LabCase[]> {
47
+ const params = {
48
+ PatNum,
49
+ LaboratoryNum,
50
+ AptNum,
51
+ PlannedAptNum,
52
+ ProvNum
53
+ };
54
+
55
+ return this.httpClient.get<LabCase[]>("/labcases", params);
56
+ }
57
+
58
+ /**
59
+ * Create a new inssub.
60
+ * @param {Object} data - The details of InsSub to create.
61
+ * @param {number} data.PatNum - Required. FK to patient.PatNum.
62
+ * @param {number} data.LaboratoryNum - Required. FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
63
+ * @param {number} data.ProvNum - Required. FK to provider.ProvNum.
64
+ * @param {number} [data.AptNum] - Optional. FK to appointment.AptNum where appointment.AptStatus=Scheduled.
65
+ * @param {number} [data.PlannedAptNum] - Optional. FK to appointment.AptNum where appointment.AptStatus=Planned.
66
+ * @param {string} [data.DateTimeDue] - Optional. The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
67
+ * @param {string} [data.DateTimeCreated] - Optional. The created date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
68
+ * @param {string} [data.DateTimeSent] - Optional. The sent date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
69
+ * @param {string} [data.DateTimeRecd] - Optional. The received date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
70
+ * @param {string} [data.DateTimeChecked] - Optional. The checked date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
71
+ * @param {string} [data.Instructions] - Optional. The text instructions for this labcase.
72
+ * @param {number} [data.LabFee] - Optional. This is used for tracking and informational purposes only. The fee is not used in any calculation.
73
+ * @param {string} [data.InvoiceNum] - Optional. This is an optional invoice number used for tracking and informational purposes only.
74
+ * @returns {Promise<LabCase>} - The created lab case.
75
+ * @throws {Error} - If required fields are missing or the API returns an error.
76
+ */
77
+ public async createLabCase({
78
+ PatNum,
79
+ LaboratoryNum,
80
+ ProvNum,
81
+ AptNum,
82
+ PlannedAptNum,
83
+ DateTimeDue,
84
+ DateTimeCreated,
85
+ DateTimeSent,
86
+ DateTimeRecd,
87
+ DateTimeChecked,
88
+ Instructions,
89
+ LabFee,
90
+ InvoiceNum,
91
+ } : CreateLabCaseParams): Promise<LabCase> {
92
+ if (!PatNum || !LaboratoryNum || !ProvNum) {
93
+ throw new Error("Invalid data: PatNum, LaboratoryNum, and ProvNum are required.");
94
+ }
95
+
96
+ return this.httpClient.post<LabCase>("/labcases", {
97
+ PatNum,
98
+ LaboratoryNum,
99
+ ProvNum,
100
+ AptNum,
101
+ PlannedAptNum,
102
+ DateTimeDue,
103
+ DateTimeCreated,
104
+ DateTimeSent,
105
+ DateTimeRecd,
106
+ DateTimeChecked,
107
+ Instructions,
108
+ LabFee,
109
+ InvoiceNum,
110
+ });
111
+ }
112
+
113
+ /**
114
+ * Update an inssub.
115
+ * @param {Object} data - The details of lab case to update.
116
+ * @param {number} data.LabCaseNum - Required in the URL. The PK of the lab case.
117
+ * @param {number} [data.LaboratoryNum] - FK to laboratory.LaboratoryNum. The lab that the case gets sent to.
118
+ * @param {number} [data.AptNum] - FK to appointment.AptNum where appointment.AptStatus=Scheduled.
119
+ * @param {number} [data.PlannedAptNum] - FK to appointment.AptNum where appointment.AptStatus=Planned.
120
+ * @param {string} [data.DateTimeDue] - The due date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
121
+ * @param {string} [data.DateTimeCreated] - The created date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
122
+ * @param {string} [data.DateTimeSent] - The sent date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
123
+ * @param {string} [data.DateTimeRecd] - The received date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
124
+ * @param {string} [data.DateTimeChecked] - The checked date that is put on the labslip. String in "yyyy-MM-dd HH:mm:ss" format.
125
+ * @param {number} [data.ProvNum] - FK to provider.ProvNum.
126
+ * @param {string} [data.Instructions] - The text instructions for this labcase.
127
+ * @param {number} [data.LabFee] - This is used for tracking and informational purposes only. The fee is not used in any calculation.
128
+ * @param {string} [data.InvoiceNum] - This is an optional invoice number used for tracking and informational purposes only.
129
+ * @returns {Promise<LabCase>} - The updated lab case.
130
+ * @throws {Error} - If required fields are missing or the API returns an error.
131
+ */
132
+ public async updateLabCase({
133
+ LabCaseNum,
134
+ LaboratoryNum,
135
+ ProvNum,
136
+ AptNum,
137
+ PlannedAptNum,
138
+ DateTimeDue,
139
+ DateTimeCreated,
140
+ DateTimeSent,
141
+ DateTimeRecd,
142
+ DateTimeChecked,
143
+ Instructions,
144
+ LabFee,
145
+ InvoiceNum,
146
+ } : UpdateLabCaseParams): Promise<LabCase> {
147
+ if (!LabCaseNum || typeof LabCaseNum !== "number") {
148
+ throw new Error("Invalid data: A Valid LabCaseNum is required.");
149
+ }
150
+
151
+ return this.httpClient.put<LabCase>(`/labcases/${LabCaseNum}`, {
152
+ LaboratoryNum,
153
+ ProvNum,
154
+ AptNum,
155
+ PlannedAptNum,
156
+ DateTimeDue,
157
+ DateTimeCreated,
158
+ DateTimeSent,
159
+ DateTimeRecd,
160
+ DateTimeChecked,
161
+ Instructions,
162
+ LabFee,
163
+ InvoiceNum,
164
+ });
165
+ }
166
+
167
+
168
+ /**
169
+ * Delete an inssub entry. Will fail if any PatPlans exist. You can obtain the InsSubNum from FamilyModules GET Insurance.
170
+ * @param {number} LabCaseNum - Required: The unique identifier of the inssub to delete.
171
+ * @returns {Promise<void>} - Resolves when the discount plan sub is deleted.
172
+ * @throws {Error} - If `LabCaseNum` is not valid or the API returns an error.
173
+ */
174
+ /*
175
+ public async deleteLabCase(LabCaseNum: number): Promise<void> {
176
+ if (!LabCaseNum || typeof LabCaseNum !== "number") {
177
+ throw new Error("Invalid parameter: LabCaseNum must be a valid number.");
178
+ }
179
+
180
+ return this.httpClient.delete<void>(`/labcases/${LabCaseNum}`);
181
+ }
182
+ */
183
+ }
@@ -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
+ }