@rinse-dental/open-dental 1.4.0 → 1.5.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/adjustments.d.ts +48 -0
- package/dist/api/adjustments.d.ts.map +1 -0
- package/dist/api/adjustments.js +89 -0
- package/dist/types/adjustmentTypes.d.ts +60 -0
- package/dist/types/adjustmentTypes.d.ts.map +1 -0
- package/dist/types/adjustmentTypes.js +2 -0
- package/package.json +1 -1
- package/src/api/adjustments.ts +126 -0
- package/src/types/adjustmentTypes.ts +63 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import { Adjustment, GetAdjustmentsParams, CreateAdjustmentParams, UpdateAdjustmentParams } from "../types/adjustmentTypes";
|
|
3
|
+
export default class Adjustments {
|
|
4
|
+
private httpClient;
|
|
5
|
+
constructor(httpClient: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Fetch multiple adjustments with filtering and pagination.
|
|
8
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
9
|
+
* @param {number} params.PatNum - Required. FK to patient.PatNum.
|
|
10
|
+
* @param {number} [params.AdjType] - Optional. definition.DefNum where definition.Category=1.
|
|
11
|
+
* @param {number} [params.ProcNum] - Optional. FK to procedure.ProcNum.
|
|
12
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
13
|
+
* @returns {Promise<Adjustment[]>} - A list of adjustments.
|
|
14
|
+
*/
|
|
15
|
+
getAdjustments({ PatNum, AdjType, ProcNum, Offset, }: GetAdjustmentsParams): Promise<Adjustment>;
|
|
16
|
+
/**
|
|
17
|
+
* This adds an adjustments to a patient's account.
|
|
18
|
+
* @param {Object} data - The details of the adjustment to create.
|
|
19
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum
|
|
20
|
+
* @param {number} data.AdjType - Required. definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
21
|
+
* @param {number} data.AdjAmt - Required. Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
22
|
+
* @param {string} data.AdjDate - Required. Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
23
|
+
* @param {string} [data.ProvNum] - Optional. FK to provider.ProvNum
|
|
24
|
+
* @param {string} [data.ProcNum] - Optional. Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
25
|
+
* @param {string} [data.ClinicNum] - Optional. Default patient.ClinicNum.
|
|
26
|
+
* @param {string} [data.ProcDate] - Optional. String in "yyyy-MM-dd" format. If attaching to a procedure then this will default to the procedure's ProcDate. Otherwise, defaults to today's date.
|
|
27
|
+
* @param {string} [data.AdjNote] - Optional. Note for the adjustment.
|
|
28
|
+
* @returns {Promise<Adjustment>} - The created adjustment.
|
|
29
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
30
|
+
*/
|
|
31
|
+
createAdjustment({ PatNum, AdjType, AdjAmt, AdjDate, ProvNum, ProcNum, ClinicNum, ProcDate, AdjNote, }: CreateAdjustmentParams): Promise<Adjustment>;
|
|
32
|
+
/**
|
|
33
|
+
* Update an adjustment.
|
|
34
|
+
* @param {Object} data - The details of adjustment to update.
|
|
35
|
+
* @param {number} data.AdjNum - Required. Primary key.
|
|
36
|
+
* @param {string} data.AdjDate - Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
37
|
+
* @param {number} data.AdjAmt - Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
38
|
+
* @param {number} data.AdjType - definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
39
|
+
* @param {string} [data.ProvNum] - Optional. FK to provider.ProvNum
|
|
40
|
+
* @param {string} [data.AdjNote] - Optional. Note for the adjustment.
|
|
41
|
+
* @param {string} [data.ProcNum] - Optional. Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
42
|
+
* @param {string} [data.ClinicNum] - Optional. Default patient.ClinicNum.
|
|
43
|
+
* @returns {Promise<Adjustment>} - The updated adjustment.
|
|
44
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
45
|
+
*/
|
|
46
|
+
updateAdjustment({ AdjNum, AdjDate, AdjAmt, AdjType, ProvNum, AdjNote, ProcNum, ClinicNum, }: UpdateAdjustmentParams): Promise<Adjustment>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=adjustments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustments.d.ts","sourceRoot":"","sources":["../../src/api/adjustments.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;;;;QAQI;IACS,cAAc,CAAC,EAC1B,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,GAEP,EAAG,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;IAa9C;;;;;;;;;;;;;;OAcG;IACU,gBAAgB,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,OAAO,GACR,EAAG,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;IAkBhD;;;;;;;;;;;;;OAaG;IACU,gBAAgB,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,SAAS,GACV,EAAG,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;CAgBjD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Adjustments {
|
|
4
|
+
httpClient;
|
|
5
|
+
constructor(httpClient) {
|
|
6
|
+
this.httpClient = httpClient;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch multiple adjustments with filtering and pagination.
|
|
10
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
11
|
+
* @param {number} params.PatNum - Required. FK to patient.PatNum.
|
|
12
|
+
* @param {number} [params.AdjType] - Optional. definition.DefNum where definition.Category=1.
|
|
13
|
+
* @param {number} [params.ProcNum] - Optional. FK to procedure.ProcNum.
|
|
14
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
15
|
+
* @returns {Promise<Adjustment[]>} - A list of adjustments.
|
|
16
|
+
*/
|
|
17
|
+
async getAdjustments({ PatNum, AdjType, ProcNum, Offset, }) {
|
|
18
|
+
if (!PatNum || typeof PatNum !== "number") {
|
|
19
|
+
throw new Error("Invalid data: A Valid PatNum is required.");
|
|
20
|
+
}
|
|
21
|
+
return this.httpClient.get("/adjustments", {
|
|
22
|
+
PatNum,
|
|
23
|
+
AdjType,
|
|
24
|
+
ProcNum,
|
|
25
|
+
Offset,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* This adds an adjustments to a patient's account.
|
|
30
|
+
* @param {Object} data - The details of the adjustment to create.
|
|
31
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum
|
|
32
|
+
* @param {number} data.AdjType - Required. definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
33
|
+
* @param {number} data.AdjAmt - Required. Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
34
|
+
* @param {string} data.AdjDate - Required. Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
35
|
+
* @param {string} [data.ProvNum] - Optional. FK to provider.ProvNum
|
|
36
|
+
* @param {string} [data.ProcNum] - Optional. Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
37
|
+
* @param {string} [data.ClinicNum] - Optional. Default patient.ClinicNum.
|
|
38
|
+
* @param {string} [data.ProcDate] - Optional. String in "yyyy-MM-dd" format. If attaching to a procedure then this will default to the procedure's ProcDate. Otherwise, defaults to today's date.
|
|
39
|
+
* @param {string} [data.AdjNote] - Optional. Note for the adjustment.
|
|
40
|
+
* @returns {Promise<Adjustment>} - The created adjustment.
|
|
41
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
42
|
+
*/
|
|
43
|
+
async createAdjustment({ PatNum, AdjType, AdjAmt, AdjDate, ProvNum, ProcNum, ClinicNum, ProcDate, AdjNote, }) {
|
|
44
|
+
if (!PatNum || !AdjType || !AdjAmt || !AdjDate) {
|
|
45
|
+
throw new Error("Invalid data: PatNum, AdjType, AdjAmt, and AdjDate are required.");
|
|
46
|
+
}
|
|
47
|
+
return this.httpClient.post("/adjustments", {
|
|
48
|
+
PatNum,
|
|
49
|
+
AdjType,
|
|
50
|
+
AdjAmt,
|
|
51
|
+
AdjDate,
|
|
52
|
+
ProvNum,
|
|
53
|
+
ProcNum,
|
|
54
|
+
ClinicNum,
|
|
55
|
+
ProcDate,
|
|
56
|
+
AdjNote,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Update an adjustment.
|
|
61
|
+
* @param {Object} data - The details of adjustment to update.
|
|
62
|
+
* @param {number} data.AdjNum - Required. Primary key.
|
|
63
|
+
* @param {string} data.AdjDate - Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
64
|
+
* @param {number} data.AdjAmt - Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
65
|
+
* @param {number} data.AdjType - definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
66
|
+
* @param {string} [data.ProvNum] - Optional. FK to provider.ProvNum
|
|
67
|
+
* @param {string} [data.AdjNote] - Optional. Note for the adjustment.
|
|
68
|
+
* @param {string} [data.ProcNum] - Optional. Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
69
|
+
* @param {string} [data.ClinicNum] - Optional. Default patient.ClinicNum.
|
|
70
|
+
* @returns {Promise<Adjustment>} - The updated adjustment.
|
|
71
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
72
|
+
*/
|
|
73
|
+
async updateAdjustment({ AdjNum, AdjDate, AdjAmt, AdjType, ProvNum, AdjNote, ProcNum, ClinicNum, }) {
|
|
74
|
+
if (!AdjNum || typeof AdjNum !== "number") {
|
|
75
|
+
throw new Error("Invalid data: A valid AdjNum is required.");
|
|
76
|
+
}
|
|
77
|
+
return this.httpClient.put(`/adjustments/${AdjNum}`, {
|
|
78
|
+
AdjNum,
|
|
79
|
+
AdjDate,
|
|
80
|
+
AdjAmt,
|
|
81
|
+
AdjType,
|
|
82
|
+
ProvNum,
|
|
83
|
+
AdjNote,
|
|
84
|
+
ProcNum,
|
|
85
|
+
ClinicNum,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.default = Adjustments;
|
|
@@ -0,0 +1,60 @@
|
|
|
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/apiadjustments.html
|
|
4
|
+
*/
|
|
5
|
+
export interface Adjustment {
|
|
6
|
+
AdjNum?: number;
|
|
7
|
+
AdjDate?: string;
|
|
8
|
+
AdjAmt?: number;
|
|
9
|
+
PatNum?: number;
|
|
10
|
+
AdjType?: number;
|
|
11
|
+
adjType?: string;
|
|
12
|
+
ProvNum?: number;
|
|
13
|
+
AdjNote?: string;
|
|
14
|
+
ProcDate?: string;
|
|
15
|
+
ProcNum?: number;
|
|
16
|
+
DateEntry?: string;
|
|
17
|
+
ClinicNum?: number;
|
|
18
|
+
SecUserNumEntry?: number;
|
|
19
|
+
SecDateTEdit?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets adjustments based on PatNum and provided parameters.
|
|
23
|
+
* @see https://www.opendental.com/site/apiadjustments.html
|
|
24
|
+
*/
|
|
25
|
+
export interface GetAdjustmentsParams {
|
|
26
|
+
PatNum: number;
|
|
27
|
+
AdjType?: number;
|
|
28
|
+
ProcNum?: number;
|
|
29
|
+
Offset?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parameters for creating an adjustment for a patient.
|
|
33
|
+
* @see https://www.opendental.com/site/apiadjustments.html
|
|
34
|
+
*/
|
|
35
|
+
export interface CreateAdjustmentParams {
|
|
36
|
+
PatNum: number;
|
|
37
|
+
AdjType: number;
|
|
38
|
+
AdjAmt: number;
|
|
39
|
+
AdjDate: string;
|
|
40
|
+
ProvNum?: number;
|
|
41
|
+
ProcNum?: number;
|
|
42
|
+
ClinicNum?: number;
|
|
43
|
+
ProcDate?: string;
|
|
44
|
+
AdjNote?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parameters for updating an adjustment for a patient.
|
|
48
|
+
* @see https://www.opendental.com/site/apiadjustments.html
|
|
49
|
+
*/
|
|
50
|
+
export interface UpdateAdjustmentParams {
|
|
51
|
+
AdjNum: number;
|
|
52
|
+
AdjDate?: string;
|
|
53
|
+
AdjAmt?: number;
|
|
54
|
+
AdjType?: number;
|
|
55
|
+
ProvNum?: number;
|
|
56
|
+
AdjNote?: string;
|
|
57
|
+
ProcNum?: number;
|
|
58
|
+
ClinicNum?: number;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=adjustmentTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustmentTypes.d.ts","sourceRoot":"","sources":["../../src/types/adjustmentTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Adjustment,
|
|
4
|
+
GetAdjustmentsParams,
|
|
5
|
+
CreateAdjustmentParams,
|
|
6
|
+
UpdateAdjustmentParams,
|
|
7
|
+
} from "../types/adjustmentTypes";
|
|
8
|
+
|
|
9
|
+
export default class Adjustments {
|
|
10
|
+
private httpClient: HttpClient;
|
|
11
|
+
|
|
12
|
+
constructor(httpClient: HttpClient) {
|
|
13
|
+
this.httpClient = httpClient;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch multiple adjustments with filtering and pagination.
|
|
18
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
19
|
+
* @param {number} params.PatNum - Required. FK to patient.PatNum.
|
|
20
|
+
* @param {number} [params.AdjType] - Optional. definition.DefNum where definition.Category=1.
|
|
21
|
+
* @param {number} [params.ProcNum] - Optional. FK to procedure.ProcNum.
|
|
22
|
+
* @param {number} [params.Offset] - Pagination offset for results.
|
|
23
|
+
* @returns {Promise<Adjustment[]>} - A list of adjustments.
|
|
24
|
+
*/
|
|
25
|
+
public async getAdjustments({
|
|
26
|
+
PatNum,
|
|
27
|
+
AdjType,
|
|
28
|
+
ProcNum,
|
|
29
|
+
Offset,
|
|
30
|
+
|
|
31
|
+
} : GetAdjustmentsParams): Promise<Adjustment> {
|
|
32
|
+
if (!PatNum || typeof PatNum !== "number") {
|
|
33
|
+
throw new Error("Invalid data: A Valid PatNum is required.");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return this.httpClient.get<Adjustment>("/adjustments", {
|
|
37
|
+
PatNum,
|
|
38
|
+
AdjType,
|
|
39
|
+
ProcNum,
|
|
40
|
+
Offset,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This adds an adjustments to a patient's account.
|
|
46
|
+
* @param {Object} data - The details of the adjustment to create.
|
|
47
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum
|
|
48
|
+
* @param {number} data.AdjType - Required. definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
49
|
+
* @param {number} data.AdjAmt - Required. Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
50
|
+
* @param {string} data.AdjDate - Required. Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
51
|
+
* @param {string} [data.ProvNum] - Optional. FK to provider.ProvNum
|
|
52
|
+
* @param {string} [data.ProcNum] - Optional. Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
53
|
+
* @param {string} [data.ClinicNum] - Optional. Default patient.ClinicNum.
|
|
54
|
+
* @param {string} [data.ProcDate] - Optional. String in "yyyy-MM-dd" format. If attaching to a procedure then this will default to the procedure's ProcDate. Otherwise, defaults to today's date.
|
|
55
|
+
* @param {string} [data.AdjNote] - Optional. Note for the adjustment.
|
|
56
|
+
* @returns {Promise<Adjustment>} - The created adjustment.
|
|
57
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
58
|
+
*/
|
|
59
|
+
public async createAdjustment({
|
|
60
|
+
PatNum,
|
|
61
|
+
AdjType,
|
|
62
|
+
AdjAmt,
|
|
63
|
+
AdjDate,
|
|
64
|
+
ProvNum,
|
|
65
|
+
ProcNum,
|
|
66
|
+
ClinicNum,
|
|
67
|
+
ProcDate,
|
|
68
|
+
AdjNote,
|
|
69
|
+
} : CreateAdjustmentParams): Promise<Adjustment> {
|
|
70
|
+
if (!PatNum || !AdjType || !AdjAmt || !AdjDate) {
|
|
71
|
+
throw new Error("Invalid data: PatNum, AdjType, AdjAmt, and AdjDate are required.");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return this.httpClient.post<Adjustment>("/adjustments", {
|
|
75
|
+
PatNum,
|
|
76
|
+
AdjType,
|
|
77
|
+
AdjAmt,
|
|
78
|
+
AdjDate,
|
|
79
|
+
ProvNum,
|
|
80
|
+
ProcNum,
|
|
81
|
+
ClinicNum,
|
|
82
|
+
ProcDate,
|
|
83
|
+
AdjNote,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Update an adjustment.
|
|
89
|
+
* @param {Object} data - The details of adjustment to update.
|
|
90
|
+
* @param {number} data.AdjNum - Required. Primary key.
|
|
91
|
+
* @param {string} data.AdjDate - Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
92
|
+
* @param {number} data.AdjAmt - Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
93
|
+
* @param {number} data.AdjType - definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
94
|
+
* @param {string} [data.ProvNum] - Optional. FK to provider.ProvNum
|
|
95
|
+
* @param {string} [data.AdjNote] - Optional. Note for the adjustment.
|
|
96
|
+
* @param {string} [data.ProcNum] - Optional. Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
97
|
+
* @param {string} [data.ClinicNum] - Optional. Default patient.ClinicNum.
|
|
98
|
+
* @returns {Promise<Adjustment>} - The updated adjustment.
|
|
99
|
+
* @throws {Error} - If required fields are missing or the API returns an error.
|
|
100
|
+
*/
|
|
101
|
+
public async updateAdjustment({
|
|
102
|
+
AdjNum,
|
|
103
|
+
AdjDate,
|
|
104
|
+
AdjAmt,
|
|
105
|
+
AdjType,
|
|
106
|
+
ProvNum,
|
|
107
|
+
AdjNote,
|
|
108
|
+
ProcNum,
|
|
109
|
+
ClinicNum,
|
|
110
|
+
} : UpdateAdjustmentParams): Promise<Adjustment> {
|
|
111
|
+
if (!AdjNum || typeof AdjNum !== "number") {
|
|
112
|
+
throw new Error("Invalid data: A valid AdjNum is required.");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return this.httpClient.put<Adjustment>(`/adjustments/${AdjNum}`, {
|
|
116
|
+
AdjNum,
|
|
117
|
+
AdjDate,
|
|
118
|
+
AdjAmt,
|
|
119
|
+
AdjType,
|
|
120
|
+
ProvNum,
|
|
121
|
+
AdjNote,
|
|
122
|
+
ProcNum,
|
|
123
|
+
ClinicNum,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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/apiadjustments.html
|
|
4
|
+
*/
|
|
5
|
+
export interface Adjustment {
|
|
6
|
+
AdjNum?: number; // Primary Key
|
|
7
|
+
AdjDate?: string; // Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
8
|
+
AdjAmt?: number; // Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
9
|
+
PatNum?: number; // FK to patient.PatNum
|
|
10
|
+
AdjType?: number; // definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
11
|
+
adjType?: string; // definition.ItemName where AdjType == definition.DefNum && definition.Category == 1.
|
|
12
|
+
ProvNum?: number; // FK to provider.ProvNum
|
|
13
|
+
AdjNote?: string; // Note for the adjustment.
|
|
14
|
+
ProcDate?: string; // String in "yyyy-MM-dd" format. If attaching to a procedure then this will default to the procedure's ProcDate. Otherwise, defaults to today's date.
|
|
15
|
+
ProcNum?: number; // Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
16
|
+
DateEntry?: string; // String in "yyyy-MM-dd" format.
|
|
17
|
+
ClinicNum?: number; // Default patient.ClinicNum.
|
|
18
|
+
SecUserNumEntry?: number; //
|
|
19
|
+
SecDateTEdit?: string; // String in "yyyy-MM-dd HH:mm:ss" format
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Gets adjustments based on PatNum and provided parameters.
|
|
24
|
+
* @see https://www.opendental.com/site/apiadjustments.html
|
|
25
|
+
*/
|
|
26
|
+
export interface GetAdjustmentsParams {
|
|
27
|
+
PatNum: number; // Required. FK to patient.PatNum
|
|
28
|
+
AdjType?: number; // Optional. definition.DefNum where definition.Category=1.
|
|
29
|
+
ProcNum?: number; // Optional. FK to procedure.ProcNum.
|
|
30
|
+
Offset?: number; // Pagination offset for results.
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Parameters for creating an adjustment for a patient.
|
|
35
|
+
* @see https://www.opendental.com/site/apiadjustments.html
|
|
36
|
+
*/
|
|
37
|
+
export interface CreateAdjustmentParams {
|
|
38
|
+
PatNum: number; // Required. FK to patient.PatNum
|
|
39
|
+
AdjType: number; // Required. definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
40
|
+
AdjAmt: number; // Required. Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
41
|
+
AdjDate: string; // Required. Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
42
|
+
ProvNum?: number; // FK to provider.ProvNum
|
|
43
|
+
ProcNum?: number; // Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
44
|
+
ClinicNum?: number; // Default patient.ClinicNum.
|
|
45
|
+
ProcDate?: string; // String in "yyyy-MM-dd" format. If attaching to a procedure then this will default to the procedure's ProcDate. Otherwise, defaults to today's date.
|
|
46
|
+
AdjNote?: string; // Note for the adjustment.
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Parameters for updating an adjustment for a patient.
|
|
51
|
+
* @see https://www.opendental.com/site/apiadjustments.html
|
|
52
|
+
*/
|
|
53
|
+
export interface UpdateAdjustmentParams {
|
|
54
|
+
AdjNum: number; // Required. Primary Key
|
|
55
|
+
AdjDate?: string; // Cannot be a future date. String in "yyyy-MM-dd" format.
|
|
56
|
+
AdjAmt?: number; // Must be positive if AdjType has an ItemValue of "+", or negative if it has an ItemValue of "-".
|
|
57
|
+
AdjType?: number; // definition.DefNum where definition.Category=1, and definition.ItemValue="+" or "-".
|
|
58
|
+
ProvNum?: number; // FK to provider.ProvNum
|
|
59
|
+
AdjNote?: string; // Note for the adjustment.
|
|
60
|
+
ProcNum?: number; // Only used if attaching this adjustment to a procedure. The procedure must be associated to the patient. Default 0.
|
|
61
|
+
ClinicNum?: number; // Default patient.ClinicNum.
|
|
62
|
+
}
|
|
63
|
+
|