@rinse-dental/open-dental 0.1.1 → 0.1.4
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 +21 -0
- package/dist/api/appointments.d.ts +1 -1
- package/dist/api/appointments.d.ts.map +1 -1
- package/dist/api/chartModules.d.ts +14 -0
- package/dist/api/chartModules.d.ts.map +1 -0
- package/dist/api/chartModules.js +21 -0
- package/dist/api/commlogs.d.ts +1 -1
- package/dist/api/commlogs.d.ts.map +1 -1
- package/dist/api/index.d.ts +8 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +17 -4
- package/dist/api/patFields.d.ts +53 -0
- package/dist/api/patFields.d.ts.map +1 -0
- package/dist/api/patFields.js +87 -0
- package/dist/api/patients.d.ts +20 -1
- package/dist/api/patients.d.ts.map +1 -1
- package/dist/api/patients.js +34 -0
- package/dist/api/recalls.d.ts +84 -0
- package/dist/api/recalls.d.ts.map +1 -0
- package/dist/api/recalls.js +120 -0
- package/dist/api/schedules.d.ts +29 -0
- package/dist/api/schedules.d.ts.map +1 -0
- package/dist/api/schedules.js +47 -0
- package/dist/api/treatplans.d.ts +53 -0
- package/dist/api/treatplans.d.ts.map +1 -0
- package/dist/api/treatplans.js +77 -0
- package/dist/openDental.d.ts +38 -3
- package/dist/openDental.d.ts.map +1 -1
- package/dist/openDental.js +74 -4
- package/dist/types/{appointmentType.d.ts → appointmentTypes.d.ts} +1 -1
- package/dist/types/appointmentTypes.d.ts.map +1 -0
- package/dist/types/chartModuleTypes.d.ts +21 -0
- package/dist/types/chartModuleTypes.d.ts.map +1 -0
- package/dist/types/{commlogType.d.ts → commlogTypes.d.ts} +1 -1
- package/dist/types/commlogTypes.d.ts.map +1 -0
- package/dist/types/commlogTypes.js +2 -0
- package/dist/types/patFieldTypes.d.ts +23 -0
- package/dist/types/patFieldTypes.d.ts.map +1 -0
- package/dist/types/patFieldTypes.js +2 -0
- package/dist/types/recallTypes.d.ts +98 -0
- package/dist/types/recallTypes.d.ts.map +1 -0
- package/dist/types/recallTypes.js +2 -0
- package/dist/types/scheduleTypes.d.ts +28 -0
- package/dist/types/scheduleTypes.d.ts.map +1 -0
- package/dist/types/scheduleTypes.js +2 -0
- package/dist/types/treatPlanTypes.d.ts +72 -0
- package/dist/types/treatPlanTypes.d.ts.map +1 -0
- package/dist/types/treatPlanTypes.js +2 -0
- package/package.json +1 -1
- package/src/api/appointments.ts +1 -2
- package/src/api/chartModules.ts +25 -0
- package/src/api/commlogs.ts +1 -1
- package/src/api/index.ts +8 -2
- package/src/api/patFields.ts +112 -0
- package/src/api/patients.ts +50 -1
- package/src/api/recalls.ts +148 -0
- package/src/api/schedules.ts +65 -0
- package/src/api/treatplans.ts +97 -0
- package/src/openDental.ts +85 -4
- package/src/types/chartModuleTypes.ts +29 -0
- package/src/types/patFieldTypes.ts +24 -0
- package/src/types/recallTypes.ts +102 -0
- package/src/types/scheduleTypes.ts +28 -0
- package/src/types/treatPlanTypes.ts +75 -0
- package/dist/types/appointmentType.d.ts.map +0 -1
- package/dist/types/commlogType.d.ts.map +0 -1
- /package/dist/types/{appointmentType.js → appointmentTypes.js} +0 -0
- /package/dist/types/{commlogType.js → chartModuleTypes.js} +0 -0
- /package/src/types/{appointmentType.ts → appointmentTypes.ts} +0 -0
- /package/src/types/{commlogType.ts → commlogTypes.ts} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET TreatPlans object.
|
|
3
|
+
* @see https://www.opendental.com/site/apitreatplans.html
|
|
4
|
+
*/
|
|
5
|
+
export interface TreatmentPlan {
|
|
6
|
+
TreatPlanNum?: number;
|
|
7
|
+
PatNum?: number;
|
|
8
|
+
DateTP?: string;
|
|
9
|
+
Heading?: string;
|
|
10
|
+
Note?: string;
|
|
11
|
+
SigIsTopaz?: "true" | "false";
|
|
12
|
+
ResponsParty?: number;
|
|
13
|
+
DocNum?: number;
|
|
14
|
+
TPStatus?: string;
|
|
15
|
+
SecUserNumEntry?: number;
|
|
16
|
+
SecDateEntry?: string;
|
|
17
|
+
SecDateTEdit?: string;
|
|
18
|
+
UserNumPresenter?: number;
|
|
19
|
+
TPType?: "Insurance" | "Discount";
|
|
20
|
+
DateTSigned?: string;
|
|
21
|
+
DateTPracticeSigned?: string;
|
|
22
|
+
SignatureText?: string;
|
|
23
|
+
SignaturePracticeText?: string;
|
|
24
|
+
isSigned?: "true" | "false";
|
|
25
|
+
isSignedPractice?: "true" | "false";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get TreatPlans Params. Returns TreatPlan object
|
|
29
|
+
* @see https://www.opendental.com/site/apitreatplans.html
|
|
30
|
+
*/
|
|
31
|
+
export interface GetTreatmentPlanParams {
|
|
32
|
+
PatNum?: number;
|
|
33
|
+
SecDateTEdit?: string;
|
|
34
|
+
TPStatus?: "Saved" | "Active" | "Inactive";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* POST TreatPlans Params. Returns TreatPlan object
|
|
38
|
+
* @see https://www.opendental.com/site/apitreatplans.html
|
|
39
|
+
*/
|
|
40
|
+
export interface CreateTreatmentPlanParams {
|
|
41
|
+
PatNum: number;
|
|
42
|
+
Heading?: string;
|
|
43
|
+
Note?: string;
|
|
44
|
+
TPType?: "Insurance" | "Discount";
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* POST Save TreatPlans Params. Returns TreatPlan object.
|
|
48
|
+
* Creates an unsigned Saved TreatPlan from an existing Active or Inactive TreatPlan.
|
|
49
|
+
* @see https://www.opendental.com/site/apitreatplans.html
|
|
50
|
+
*/
|
|
51
|
+
export interface SaveTreatmentPlanParams {
|
|
52
|
+
TreatPlanNum: number;
|
|
53
|
+
Heading?: string;
|
|
54
|
+
UserNumPresenter?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* PUT TreatPlans object.
|
|
58
|
+
* @see https://www.opendental.com/site/apitreatplans.html
|
|
59
|
+
*/
|
|
60
|
+
export interface UpdateTreatmentPlanParams {
|
|
61
|
+
TreatPlanNum: number;
|
|
62
|
+
DateTP?: string;
|
|
63
|
+
Heading?: string;
|
|
64
|
+
Note?: string;
|
|
65
|
+
ResponsParty?: number;
|
|
66
|
+
TPType?: "Insurance" | "Discount";
|
|
67
|
+
SignatureText?: string;
|
|
68
|
+
SignaturePracticeText?: string;
|
|
69
|
+
isSigned?: "true" | "false";
|
|
70
|
+
isSignedPractice?: "true" | "false";
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=treatPlanTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treatPlanTypes.d.ts","sourceRoot":"","sources":["../../src/types/treatPlanTypes.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,MAAM,WAAW,aAAa;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;EAGE;AACF,MAAM,WAAW,yBAAyB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACvC"}
|
package/package.json
CHANGED
package/src/api/appointments.ts
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
UpdateAppointmentParams,
|
|
15
15
|
BreakAppointmentParams,
|
|
16
16
|
ConfirmAppointmentParams,
|
|
17
|
-
} from "../types/
|
|
17
|
+
} from "../types/appointmentTypes";
|
|
18
18
|
|
|
19
19
|
export default class Appointments {
|
|
20
20
|
private httpClient: HttpClient;
|
|
@@ -333,5 +333,4 @@ public async getAppointments({
|
|
|
333
333
|
|
|
334
334
|
return this.httpClient.put<void>(`/appointments/${data.AptNum}/confirm`, data);
|
|
335
335
|
}
|
|
336
|
-
|
|
337
336
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
PlannedAppointment,
|
|
4
|
+
} from "../types/chartModuleTypes"
|
|
5
|
+
|
|
6
|
+
export default class ChartModules {
|
|
7
|
+
private httpClient: HttpClient;
|
|
8
|
+
|
|
9
|
+
constructor(httpClient: HttpClient) {
|
|
10
|
+
this.httpClient = httpClient;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Gets Planned Appointments for a patient, similarly to how it shows in the Chart Module's Planned Appointments tab.
|
|
15
|
+
* @param {number} PatNum - The unique identifier for the patient.
|
|
16
|
+
* @returns {Promise<PlannedAppointment>} - The planned appts object.
|
|
17
|
+
* @throws {Error} - If `PatNum` is not provided.
|
|
18
|
+
*/
|
|
19
|
+
public async getPlannedAppts(PatNum: number): Promise<PlannedAppointment> {
|
|
20
|
+
if (!PatNum) {
|
|
21
|
+
throw new Error("PatNum is required.");
|
|
22
|
+
}
|
|
23
|
+
return this.httpClient.get<PlannedAppointment>(`/chartmodules/${PatNum}/PlannedAppts`);
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/api/commlogs.ts
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export { default as Patients } from "./patients";
|
|
2
1
|
export { default as Appointments } from "./appointments";
|
|
3
|
-
|
|
2
|
+
export { default as ChartModules } from "./chartModules";
|
|
3
|
+
export { default as CommLogs } from "./commlogs";
|
|
4
|
+
export { default as PatFields } from "./patFields";
|
|
5
|
+
export { default as Patients } from "./patients";
|
|
6
|
+
export { default as ProcedureLogs } from "./procedureLog";
|
|
7
|
+
export { default as Recalls } from "./recalls";
|
|
8
|
+
export { default as TreatmentPlans } from "./treatplans";
|
|
9
|
+
export { default as Schedule } from "./schedules";
|
|
4
10
|
// Add other APIs as needed
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
PatField,
|
|
4
|
+
GetPatFieldsParams,
|
|
5
|
+
AddUpdatePatFieldParams,
|
|
6
|
+
} from "../types/patFieldTypes";
|
|
7
|
+
|
|
8
|
+
export default class PatFields {
|
|
9
|
+
private httpClient: HttpClient;
|
|
10
|
+
|
|
11
|
+
constructor(httpClient: HttpClient) {
|
|
12
|
+
this.httpClient = httpClient;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fetch a single patfield by its ID.
|
|
17
|
+
* @param {number} PatFieldNum - The ID of the patfield.
|
|
18
|
+
* @returns {Promise<PatField>} - The patient data.
|
|
19
|
+
* @throws {Error} - If `PatNum` is not valid or the API returns an error.
|
|
20
|
+
*/
|
|
21
|
+
public async getPatField(PatFieldNum: number): Promise<PatField> {
|
|
22
|
+
if (!PatFieldNum || typeof PatFieldNum !== "number") {
|
|
23
|
+
throw new Error("Invalid parameter: PatNum must be a valid number.");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return await this.httpClient.get<PatField>(`/patfields/${PatFieldNum}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fetch multiple patients with optional filtering and pagination.
|
|
31
|
+
* @param {Object} params - Filtering and pagination parameters.
|
|
32
|
+
* @param {string} [params.PatNum] - Filter by last name (case-insensitive, partial match).
|
|
33
|
+
* @param {string} [params.FieldName] - Filter by last name (case-insensitive, partial match).
|
|
34
|
+
* @param {string} [params.SecDateTEdit] - Filter by last name (case-insensitive, partial match).
|
|
35
|
+
* @returns {Promise<PatField[]>} - A list of summarized patient data.
|
|
36
|
+
* @throws {Error} - If the API returns an error.
|
|
37
|
+
*/
|
|
38
|
+
public async getPatFields({
|
|
39
|
+
PatNum,
|
|
40
|
+
FieldName,
|
|
41
|
+
SecDateTEdit,
|
|
42
|
+
}: GetPatFieldsParams = {}): Promise<PatField[]> {
|
|
43
|
+
|
|
44
|
+
return await this.httpClient.get<PatField[]>("/patfields", {
|
|
45
|
+
PatNum,
|
|
46
|
+
FieldName,
|
|
47
|
+
SecDateTEdit,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Creates a patfield. Cannot create PatFields associated with hidden PatFieldDefs.
|
|
53
|
+
* @param {Object} data - The data for the new patfield.
|
|
54
|
+
* @param {number} data.PatNum - Required: The patient's PatNum.
|
|
55
|
+
* @param {string} data.FieldName - Required: FK to PatFieldDef.FieldName. Case sensitive.
|
|
56
|
+
* @param {string} data.FieldValue - Required: See the top of this page for more information. Relies on PatFieldDef.FieldType.
|
|
57
|
+
* @returns {Promise<PatField>} - The created PatField.
|
|
58
|
+
* @throws {Error} - If the data is invalid or the API returns an error.
|
|
59
|
+
*/
|
|
60
|
+
public async createPatField({
|
|
61
|
+
PatNum,
|
|
62
|
+
FieldName,
|
|
63
|
+
FieldValue,
|
|
64
|
+
}: AddUpdatePatFieldParams): Promise<PatField> {
|
|
65
|
+
if (!PatNum || !FieldName || !FieldValue) {
|
|
66
|
+
throw new Error("Invalid data: All fields are required.");
|
|
67
|
+
}
|
|
68
|
+
return await this.httpClient.post<PatField>("/patfields", {
|
|
69
|
+
PatNum,
|
|
70
|
+
FieldName,
|
|
71
|
+
FieldValue,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Updates an existing patfield.
|
|
77
|
+
* @param {Object} data - The data for the updated patfield.
|
|
78
|
+
* @param {number} data.PatNum - Required: The patient's PatNum.
|
|
79
|
+
* @param {string} data.FieldName - Required: FK to PatFieldDef.FieldName. Case sensitive.
|
|
80
|
+
* @param {string} data.FieldValue - Required: See the top of this page for more information. Relies on PatFieldDef.FieldType.
|
|
81
|
+
* @returns {Promise<PatField>} - The updated PatField.
|
|
82
|
+
* @throws {Error} - If the data is invalid or the API returns an error.
|
|
83
|
+
*/
|
|
84
|
+
public async editPatField({
|
|
85
|
+
PatNum,
|
|
86
|
+
FieldName,
|
|
87
|
+
FieldValue,
|
|
88
|
+
}: AddUpdatePatFieldParams): Promise<PatField> {
|
|
89
|
+
if (!PatNum || !FieldName || !FieldValue) {
|
|
90
|
+
throw new Error("Invalid data: All fields are required.");
|
|
91
|
+
}
|
|
92
|
+
return await this.httpClient.put<PatField>("/patfields", {
|
|
93
|
+
PatNum,
|
|
94
|
+
FieldName,
|
|
95
|
+
FieldValue,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Delete a single patfield by its ID.
|
|
101
|
+
* @param {number} PatFieldNum - The ID of the patField.
|
|
102
|
+
* @returns {Promise<{ status: number }>} - The API response containing the status code.
|
|
103
|
+
* @throws {Error} - If `PatFieldNum` is not valid or the API returns an error.
|
|
104
|
+
*/
|
|
105
|
+
public async deletePatField(PatFieldNum: number): Promise<{ status: number }> {
|
|
106
|
+
if (!PatFieldNum || typeof PatFieldNum !== "number") {
|
|
107
|
+
throw new Error("Invalid parameter: PatNum must be a valid number.");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return await this.httpClient.delete<{ status: number }>(`/patfields/${PatFieldNum}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
package/src/api/patients.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
1
|
import HttpClient from "../utils/httpClient";
|
|
3
2
|
import {
|
|
4
3
|
Patient,
|
|
5
4
|
PatientSummary,
|
|
6
5
|
GetPatientsParams,
|
|
6
|
+
GetPatientsSimpleParams,
|
|
7
7
|
CreatePatientParams,
|
|
8
8
|
UpdatePatientParams,
|
|
9
9
|
} from "../types/patientTypes";
|
|
@@ -103,6 +103,55 @@ export default class Patients {
|
|
|
103
103
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Fetch multiple patients with optional filtering and pagination.
|
|
108
|
+
* @param {Object} params - Filtering and pagination parameters.
|
|
109
|
+
* @param {string} [params.LName] - Filter by last name (case-insensitive, partial match).
|
|
110
|
+
* @param {string} [params.FName] - Filter by first name (case-insensitive, partial match).
|
|
111
|
+
* @param {string} [params.Birthdate] - Filter by birthdate in "yyyy-MM-dd" format.
|
|
112
|
+
* @param {number} [params.ClinicNum] - Filter by clinic number (comma-separated list).
|
|
113
|
+
* @param {"Patient" | "NonPatient" | "Inactive" | "Archived" | "Deceased" | "Prospective".} [params.PatStatus] - Filter by Patient Status.
|
|
114
|
+
* @param {string} [params.DateTStamp] - In "yyyy-mm-dd HH:mm:ss" format.
|
|
115
|
+
* @param {number} [params.PriProv] - A single ProvNum. Leave blank if you want results for all primary providers.
|
|
116
|
+
* @param {"Male" | "Female" | "Unknown" | "Other"} [params.Gender] - Either "Male", "Female", "Unknown", or "Other".
|
|
117
|
+
* @param {"Single" | "Married" | "Child" | "Widowed" | "Divorced"} [params.Position] - Either "Single", "Married", "Child", "Widowed", or "Divorced".
|
|
118
|
+
* @param {number} [params.Guarantor] - A single PatNum. The person responsible for the account.
|
|
119
|
+
* @param {number} [params.SuperFamily] - A single PatNum. The head of a SuperFamily.
|
|
120
|
+
* @param {number} [params.Offset] - Pagination offset.
|
|
121
|
+
* @returns {Promise<Patient[]>} - A list of summarized patient data.
|
|
122
|
+
* @throws {Error} - If the API returns an error.
|
|
123
|
+
*/
|
|
124
|
+
public async getPatientsSimple({
|
|
125
|
+
LName,
|
|
126
|
+
FName,
|
|
127
|
+
Birthdate,
|
|
128
|
+
ClinicNum,
|
|
129
|
+
PatStatus,
|
|
130
|
+
DateTStamp,
|
|
131
|
+
PriProv,
|
|
132
|
+
Gender,
|
|
133
|
+
Position,
|
|
134
|
+
Guarantor,
|
|
135
|
+
SuperFamily,
|
|
136
|
+
Offset,
|
|
137
|
+
}: GetPatientsSimpleParams = {}): Promise<Patient[]> {
|
|
138
|
+
|
|
139
|
+
return await this.httpClient.get<Patient[]>("/patients/Simple", {
|
|
140
|
+
LName,
|
|
141
|
+
FName,
|
|
142
|
+
Birthdate,
|
|
143
|
+
ClinicNum,
|
|
144
|
+
PatStatus,
|
|
145
|
+
DateTStamp,
|
|
146
|
+
PriProv,
|
|
147
|
+
Gender,
|
|
148
|
+
Position,
|
|
149
|
+
Guarantor,
|
|
150
|
+
SuperFamily,
|
|
151
|
+
Offset,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
106
155
|
/**
|
|
107
156
|
* Create a new patient.
|
|
108
157
|
* @param {Object} data - The data for the new patient.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Recall,
|
|
4
|
+
RecallListParams,
|
|
5
|
+
RecallList,
|
|
6
|
+
CreateRecallParams,
|
|
7
|
+
UpdateRecallParams,
|
|
8
|
+
UpdateRecallStatusParams
|
|
9
|
+
} from "../types/recallTypes";
|
|
10
|
+
|
|
11
|
+
export default class Recalls {
|
|
12
|
+
private httpClient: HttpClient;
|
|
13
|
+
|
|
14
|
+
constructor(httpClient: HttpClient) {
|
|
15
|
+
this.httpClient = httpClient;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Gets a list of recalls.
|
|
20
|
+
* @param {number} PatNum - Optional search by PatNum.
|
|
21
|
+
* @returns {Promise<Recall>} - An array of recall objects.
|
|
22
|
+
*/
|
|
23
|
+
public async getRecalls(PatNum: number): Promise<Recall> {
|
|
24
|
+
if (!PatNum) {
|
|
25
|
+
return this.httpClient.get<Recall>(`/recalls`);
|
|
26
|
+
} else {
|
|
27
|
+
return this.httpClient.get<Recall>(`/recalls?PatNum=${PatNum}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Gets the Recall List similar to how it's shown in the Appointment Module when you click on Lists and select Recall List.
|
|
33
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
34
|
+
* @param {string} [params.DateStart] - Due date range. String in "yyyy-mm-dd" format. Default is based on RecallDaysPast preference.
|
|
35
|
+
* @param {string} [params.DateEnd] - Due date range. String in "yyyy-mm-dd" format. Default is based on RecallDaysFuture preference.
|
|
36
|
+
* @param {number} [params.ProvNum] - Provider. Default is all providers. Will consider PriProv and SecProv.
|
|
37
|
+
* @param {number} [params.ClinicNum] - Clinic. Default is all clinics. Use 0 for "Unassigned".
|
|
38
|
+
* @param {string} [params.RecallType] - Typically either "Prophy" or "Perio". Default is all RecallTypes stored in the preference.
|
|
39
|
+
* @param {"true" | "false"} [params.IncludeReminded] - Show patients that have already received reminders. Either "true" or "false". Default is false.
|
|
40
|
+
* @returns {Promise<RecallList[]>} - An array of recall list objects.
|
|
41
|
+
*/
|
|
42
|
+
public async getRecallList({
|
|
43
|
+
DateStart,
|
|
44
|
+
DateEnd,
|
|
45
|
+
ProvNum,
|
|
46
|
+
ClinicNum,
|
|
47
|
+
RecallType,
|
|
48
|
+
IncludeReminded,
|
|
49
|
+
Offset,
|
|
50
|
+
}: RecallListParams = {}): Promise<RecallList[]> {
|
|
51
|
+
const params = {
|
|
52
|
+
DateStart,
|
|
53
|
+
DateEnd,
|
|
54
|
+
ProvNum,
|
|
55
|
+
ClinicNum,
|
|
56
|
+
RecallType,
|
|
57
|
+
IncludeReminded,
|
|
58
|
+
Offset,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return this.httpClient.get<RecallList[]>("/recalls/List", params);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Create a new recall.
|
|
66
|
+
* @param {Object} data - Data for the new appointment.
|
|
67
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum.
|
|
68
|
+
* @param {number} data.RecallTypeNum - Required. FK to recalltype.RecallTypeNum. A patient may only have one recall for each RecallType.
|
|
69
|
+
* @param {string} [data.DateDue] - Optional. This is the date that is actually used when doing reports for recall. String in "yyyy-MM-dd" format.
|
|
70
|
+
* @param {string} [data.RecallInterval] - Optional.The interval between recalls. String that contains a digit followed by 'y' for years, 'm' for months, 'w' for weeks, or 'd' for
|
|
71
|
+
* @param {number} [data.RecallStatus=0] - Optional. FK to definition.DefNum where definition.Category=13. Default 0.
|
|
72
|
+
* @param {string} [data.Note] - Optional: An administrative note for staff use.
|
|
73
|
+
* @param {"true" | "false"} [params.IsDisabled="false"] - Optional. Either "true" or "false". Default "false".
|
|
74
|
+
* @param {number} [data.DisableUntilBalance] - Optional: Hygienist provider number. Default is 0.
|
|
75
|
+
* @param {string} [data.DisableUntilDate] - Optional. Recall will be disabled until this date. String in "yyyy-MM-dd" format.
|
|
76
|
+
* @param {"Normal" | "ASAP"} [data.Priority="Normal"] - Optional. Either "Normal" or "ASAP". Default "Normal".
|
|
77
|
+
* @param {string} [data.TimePatternOverride] - Optional. Used to override recalltype.DefaultInterval. Time pattern in 5 minute increments. A string consisting of 'X' and '/' characters only.
|
|
78
|
+
* @returns {Promise<Recall>} - The created recall object.
|
|
79
|
+
* @throws {Error} - If required fields are missing.
|
|
80
|
+
*/
|
|
81
|
+
public async createRecall(data: CreateRecallParams): Promise<Recall> {
|
|
82
|
+
if (!data.PatNum || !data.RecallTypeNum) {
|
|
83
|
+
throw new Error("PatNum and RecallTypeNum are required.");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return this.httpClient.post<Recall>("/recalls", data);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Edit a recall.
|
|
91
|
+
* @param {Object} data - Data for the new appointment.
|
|
92
|
+
* @param {number} data.RecallNum - Required. Primary key of recall to edit.
|
|
93
|
+
* @param {string} [data.DateDue] - Optional. This is the date that is actually used when doing reports for recall. String in "yyyy-MM-dd" format.
|
|
94
|
+
* @param {string} [data.RecallInterval] - Optional.The interval between recalls. String that contains a digit followed by 'y' for years, 'm' for months, 'w' for weeks, or 'd' for
|
|
95
|
+
* @param {number} [data.RecallStatus=0] - Optional. FK to definition.DefNum where definition.Category=13. Default 0.
|
|
96
|
+
* @param {string} [data.Note] - Optional: An administrative note for staff use.
|
|
97
|
+
* @param {"true" | "false"} [params.IsDisabled="false"] - Optional. Either "true" or "false". Default "false".
|
|
98
|
+
* @param {number} [data.DisableUntilBalance] - Optional: Hygienist provider number. Default is 0.
|
|
99
|
+
* @param {string} [data.DisableUntilDate] - Optional. Recall will be disabled until this date. String in "yyyy-MM-dd" format.
|
|
100
|
+
* @param {"Normal" | "ASAP"} [data.Priority="Normal"] - Optional. Either "Normal" or "ASAP". Default "Normal".
|
|
101
|
+
* @param {string} [data.TimePatternOverride] - Optional. Used to override recalltype.DefaultInterval. Time pattern in 5 minute increments. A string consisting of 'X' and '/' characters only.
|
|
102
|
+
* @returns {Promise<Recall>} - The created recall object.
|
|
103
|
+
* @throws {Error} - If required fields are missing.
|
|
104
|
+
*/
|
|
105
|
+
public async updateRecall(data: UpdateRecallParams): Promise<Recall> {
|
|
106
|
+
if (!data.RecallNum) {
|
|
107
|
+
throw new Error("RecallNum is required.");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return this.httpClient.put<Recall>("/recalls", data);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Update recall status.
|
|
115
|
+
* @param {Object} data - Data for the new appointment.
|
|
116
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum.
|
|
117
|
+
* @param {string} data.recallType - Required. Typically either "Prophy" or "Perio". RecallType is dependent upon Setup Recall and Recall Types.
|
|
118
|
+
* @param {number} [data.RecallStatus=0] - Optional. FK to definition.DefNum where definition.Category=13. Default 0.
|
|
119
|
+
* @param {"None" | "Email" | "Mail" | "Phone" | "InPerson" | "Text" | "EmailAndText" | "PhoneAndText"} [data.commlogMode] - Optional: An administrative note for staff use.
|
|
120
|
+
* @param {string} [data.commlogNote] - Optional. This text will be used instead of the default commlog.Note.
|
|
121
|
+
* @returns {Promise<EditRecallStatusParams>} - The created recall object.
|
|
122
|
+
* @throws {Error} - If required fields are missing.
|
|
123
|
+
*/
|
|
124
|
+
public async updateRecallStatus(data: UpdateRecallStatusParams): Promise<UpdateRecallStatusParams> {
|
|
125
|
+
if (!data.PatNum || !data.recallType) {
|
|
126
|
+
throw new Error("PatNum and RecallNum are required.");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return this.httpClient.put<UpdateRecallStatusParams>("/recalls/Status", data);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Switches a Recall's type similiar to clicking the 'Set Perio' or 'Set Prophy' button found in the Recall window.
|
|
134
|
+
* @param {Object} data - Data for the new appointment.
|
|
135
|
+
* @param {number} data.PatNum - Patient to switch recall type.
|
|
136
|
+
* @returns {Promise<{ status: number }>} - The API response containing the status code.
|
|
137
|
+
* @throws {Error} - If required fields are missing.
|
|
138
|
+
*/
|
|
139
|
+
public async switchRecallType(data: { PatNum: number }): Promise<{ status: number }> {
|
|
140
|
+
if (!data.PatNum) {
|
|
141
|
+
throw new Error("PatNum is required.");
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return this.httpClient.put<{ status: number }>("/recalls/SwitchType", data);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
Schedule,
|
|
4
|
+
GetSchedulesParams,
|
|
5
|
+
} from "../types/scheduleTypes";
|
|
6
|
+
|
|
7
|
+
export default class Schedules {
|
|
8
|
+
private httpClient: HttpClient;
|
|
9
|
+
|
|
10
|
+
constructor(httpClient: HttpClient) {
|
|
11
|
+
this.httpClient = httpClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Fetch a single Schedule by its ID.
|
|
16
|
+
* @param {number} ScheduleNum - The ID of the patfield.
|
|
17
|
+
* @returns {Promise<Schedule>} - The patient data.
|
|
18
|
+
* @throws {Error} - If `PatNum` is not valid or the API returns an error.
|
|
19
|
+
*/
|
|
20
|
+
public async getSchedule(ScheduleNum: number): Promise<Schedule> {
|
|
21
|
+
if (!ScheduleNum || typeof ScheduleNum !== "number") {
|
|
22
|
+
throw new Error("Invalid parameter: PatNum must be a valid number.");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await this.httpClient.get<Schedule>(`/schedules/${ScheduleNum}`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Fetch multiple patients with optional filtering and pagination.
|
|
30
|
+
* @param {Object} params - Filtering and pagination parameters.
|
|
31
|
+
* @param {string} [params.date] - Optional: For a single day. Today's date by default.
|
|
32
|
+
* @param {string} [params.dateStart] - Optional: For a single day. Today's date by default.
|
|
33
|
+
* @param {string} [params.dateEnd] - Optional: For a single day. Today's date by default.
|
|
34
|
+
* @param {'Practice' | 'Provider' | 'Blockout' | 'Employee' | 'WebSchedASAP'} [params.SchedType] - Optional: Either "Practice", "Provider", "Blockout", "Employee", or "WebSchedASAP".
|
|
35
|
+
* @param {number} [params.BlockoutDefNum] - Definition.DefNum where definition.Category=25.
|
|
36
|
+
* @param {number} [params.ProvNum] - FK to provider.ProvNum.
|
|
37
|
+
* @param {number} [params.EmployeeNum] - FK to employee.EmployeeNum.
|
|
38
|
+
* @param {number} [params.Offset] - Pagination offset.
|
|
39
|
+
* @returns {Promise<Schedule[]>} - A list of summarized patient data.
|
|
40
|
+
* @throws {Error} - If the API returns an error.
|
|
41
|
+
*/
|
|
42
|
+
public async getSchedules({
|
|
43
|
+
date,
|
|
44
|
+
dateStart,
|
|
45
|
+
dateEnd,
|
|
46
|
+
SchedType,
|
|
47
|
+
BlockoutDefNum,
|
|
48
|
+
ProvNum,
|
|
49
|
+
EmployeeNum,
|
|
50
|
+
Offset,
|
|
51
|
+
|
|
52
|
+
}: GetSchedulesParams = {}): Promise<Schedule[]> {
|
|
53
|
+
|
|
54
|
+
return await this.httpClient.get<Schedule[]>("/schedules", {
|
|
55
|
+
date,
|
|
56
|
+
dateStart,
|
|
57
|
+
dateEnd,
|
|
58
|
+
SchedType,
|
|
59
|
+
BlockoutDefNum,
|
|
60
|
+
ProvNum,
|
|
61
|
+
EmployeeNum,
|
|
62
|
+
Offset,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import HttpClient from "../utils/httpClient";
|
|
2
|
+
import {
|
|
3
|
+
TreatmentPlan,
|
|
4
|
+
GetTreatmentPlanParams,
|
|
5
|
+
CreateTreatmentPlanParams,
|
|
6
|
+
UpdateTreatmentPlanParams,
|
|
7
|
+
SaveTreatmentPlanParams,
|
|
8
|
+
} from "../types/treatPlanTypes";
|
|
9
|
+
import { updateProcedureLogParams } from "../types/procedurelogTypes";
|
|
10
|
+
|
|
11
|
+
export default class TreatmentPlans {
|
|
12
|
+
private httpClient: HttpClient;
|
|
13
|
+
|
|
14
|
+
constructor(httpClient: HttpClient) {
|
|
15
|
+
this.httpClient = httpClient;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get a list of TreatPlans that meet a set of search criteria.
|
|
20
|
+
* @param {Object} params - The parameters for filtering and pagination.
|
|
21
|
+
* @param {string} [params.PatNum] - patient.PatNum.
|
|
22
|
+
* @param {string} [params.SecDateTEdit] - Only include TreatPlans with a SecDateTEdit altered after the specified date and time. String in "yyyy-MM-dd HH:mm:ss" format.
|
|
23
|
+
* @param {"Saved" | "Active" | "Inactive"} [params.TPStatus] - Either "Saved", "Active", or "Inactive". Default all.
|
|
24
|
+
* @returns {Promise<TreatmentPlan[]>} - An array of recall list objects.
|
|
25
|
+
*/
|
|
26
|
+
public async getTreatmentPlans({
|
|
27
|
+
PatNum,
|
|
28
|
+
SecDateTEdit,
|
|
29
|
+
TPStatus,
|
|
30
|
+
}: GetTreatmentPlanParams = {}): Promise<TreatmentPlan[]> {
|
|
31
|
+
const params = {
|
|
32
|
+
PatNum,
|
|
33
|
+
SecDateTEdit,
|
|
34
|
+
TPStatus,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return this.httpClient.get<TreatmentPlan[]>("/treatplans", params);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Create a new TreatPlan.
|
|
42
|
+
* @param {Object} data - Data for the new appointment.
|
|
43
|
+
* @param {number} data.PatNum - Required. FK to patient.PatNum.
|
|
44
|
+
* @param {string} [data.Heading] - Optional. Defaults to the heading of the supplied Treatment Plan.
|
|
45
|
+
* @param {string} [data.Note] - Optional: An administrative note for staff use.
|
|
46
|
+
* @param {"Insurance" | "Discount"} [params.TPType] - Optional. Either "Insurance" or "Discount". If the patient is subscribed to a Discount Plan, this will default to "Discount". Otherwise, defaults to "Insurance".
|
|
47
|
+
* @returns {Promise<TreatmentPlan>} - The created recall object.
|
|
48
|
+
* @throws {Error} - If required fields are missing.
|
|
49
|
+
*/
|
|
50
|
+
public async createTreatmentPlan(data: CreateTreatmentPlanParams): Promise<TreatmentPlan> {
|
|
51
|
+
if (!data.PatNum) {
|
|
52
|
+
throw new Error("PatNum is required.");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return this.httpClient.post<TreatmentPlan>("/treatplans", data);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Creates an unsigned Saved TreatPlan from an existing Active or Inactive TreatPlan.
|
|
60
|
+
* @param {Object} data - Data for the new appointment.
|
|
61
|
+
* @param {number} data.TreatPlanNum - Required.
|
|
62
|
+
* @param {string} [data.Heading] - Optional. Defaults to the heading of the supplied Treatment Plan.
|
|
63
|
+
* @param {string} [data.UserNumPresenter=0] - Optional. FK to userod.UserNum. Default 0.
|
|
64
|
+
* @returns {Promise<TreatmentPlan>} - The created recall object.
|
|
65
|
+
* @throws {Error} - If required fields are missing.
|
|
66
|
+
*/
|
|
67
|
+
public async saveTreatmentPlan(data: SaveTreatmentPlanParams): Promise<TreatmentPlan> {
|
|
68
|
+
if (!data.TreatPlanNum) {
|
|
69
|
+
throw new Error("TreatPlanNum is required.");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return this.httpClient.post<TreatmentPlan>("/treatplans/Saved", data);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Create a new TreatPlan.
|
|
77
|
+
* @param {Object} data - Data for the new appointment.
|
|
78
|
+
* @param {number} data.TreatPlanNum - Required.
|
|
79
|
+
* @param {string} [data.Heading] - The heading that shows at the top of the treatment plan.
|
|
80
|
+
* @param {string} [data.Note] - Optional: An administrative note for staff use.
|
|
81
|
+
* @param {number} [data.ResponsParty] - FK to patient.PatNum. The patient responsible for approving the treatment.
|
|
82
|
+
* @param {"Insurance" | "Discount"} [params.TPType] - Optional. Either "Insurance" or "Discount". If the patient is subscribed to a Discount Plan, this will default to "Discount". Otherwise, defaults to "Insurance".
|
|
83
|
+
* @param {string} [data.SignatureText] - The typed name of the person who signed the patient signature.
|
|
84
|
+
* @param {string} [data.SignaturePracticeText] - The typed name of the person who signed the patient signature.
|
|
85
|
+
* @param {"true" | "false"} [data.isSigned] - The typed name of the person who signed the patient signature.
|
|
86
|
+
* @param {"true" | "false"} [data.isSignedPractice] - Either "true" or "false". True updates the treatplan SignaturePractice, digitally signs for the practice, and overwrites existing signature. False clears the exisiting treatplan SignaturePractice.
|
|
87
|
+
* @returns {Promise<TreatmentPlan>} - The created recall object.
|
|
88
|
+
* @throws {Error} - If required fields are missing.
|
|
89
|
+
*/
|
|
90
|
+
public async updateTreatmentPlan(data: UpdateTreatmentPlanParams): Promise<TreatmentPlan> {
|
|
91
|
+
if (!data.TreatPlanNum) {
|
|
92
|
+
throw new Error("TreatPlanNum is required.");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return this.httpClient.put<TreatmentPlan>(`/treatplans/${data.TreatPlanNum}`, data);
|
|
96
|
+
}
|
|
97
|
+
}
|