@rinse-dental/open-dental 0.1.5 → 0.1.6

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.
@@ -0,0 +1,23 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import { Operatory, GetOperatoriesParams } from "../types/operatoryTypes";
3
+ export default class Operatories {
4
+ private httpClient;
5
+ constructor(httpClient: HttpClient);
6
+ /**
7
+ * Fetch a single patfield by its ID.
8
+ * @param {number} OperatoryNum - The ID of the patfield.
9
+ * @returns {Promise<Operatory>} - The patient data.
10
+ * @throws {Error} - If `PatNum` is not valid or the API returns an error.
11
+ */
12
+ getPatField(OperatoryNum: number): Promise<Operatory>;
13
+ /**
14
+ * Fetch multiple patients with optional filtering and pagination.
15
+ * @param {Object} params - Filtering and pagination parameters.
16
+ * @param {string} [params.ClinicNum] - Filter by clinicnum
17
+ * @param {string} [params.Offset] - Filter by clinicnum
18
+ * @returns {Promise<Operatory[]>} - A list of summarized patient data.
19
+ * @throws {Error} - If the API returns an error.
20
+ */
21
+ getOperatories({ ClinicNum, Offset, }?: GetOperatoriesParams): Promise<Operatory[]>;
22
+ }
23
+ //# sourceMappingURL=operatories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operatories.d.ts","sourceRoot":"","sources":["../../src/api/operatories.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACH,SAAS,EACT,oBAAoB,EACvB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;OAKG;IACU,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAQlE;;;;;;;OAOG;IACY,cAAc,CAAC,EAC1B,SAAS,EACT,MAAM,GACP,GAAE,oBAAyB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CAOtD"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Operatories {
4
+ httpClient;
5
+ constructor(httpClient) {
6
+ this.httpClient = httpClient;
7
+ }
8
+ /**
9
+ * Fetch a single patfield by its ID.
10
+ * @param {number} OperatoryNum - The ID of the patfield.
11
+ * @returns {Promise<Operatory>} - The patient data.
12
+ * @throws {Error} - If `PatNum` is not valid or the API returns an error.
13
+ */
14
+ async getPatField(OperatoryNum) {
15
+ if (!OperatoryNum || typeof OperatoryNum !== "number") {
16
+ throw new Error("Invalid parameter: PatNum must be a valid number.");
17
+ }
18
+ return await this.httpClient.get(`/operatories/${OperatoryNum}`);
19
+ }
20
+ /**
21
+ * Fetch multiple patients with optional filtering and pagination.
22
+ * @param {Object} params - Filtering and pagination parameters.
23
+ * @param {string} [params.ClinicNum] - Filter by clinicnum
24
+ * @param {string} [params.Offset] - Filter by clinicnum
25
+ * @returns {Promise<Operatory[]>} - A list of summarized patient data.
26
+ * @throws {Error} - If the API returns an error.
27
+ */
28
+ async getOperatories({ ClinicNum, Offset, } = {}) {
29
+ return await this.httpClient.get("/operatories", {
30
+ ClinicNum,
31
+ Offset,
32
+ });
33
+ }
34
+ }
35
+ exports.default = Operatories;
@@ -0,0 +1,73 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import { Provider, GetProviderParams, createProviderParams, updateProviderParams } from "../types/providerTypes";
3
+ export default class Providers {
4
+ private httpClient;
5
+ constructor(httpClient: HttpClient);
6
+ /**
7
+ * Fetch a single provider by its ID.
8
+ * @param {number} ProvNum - The ID of the provider.
9
+ * @returns {Promise<Provider>} - The provider data.
10
+ * @throws {Error} - If `ProvNum` is not valid or the API returns an error.
11
+ */
12
+ getProvider(ProvNum: number): Promise<Provider>;
13
+ /**
14
+ * Fetch multiple providers with optional filtering and pagination.
15
+ * @param {Object} params - Filtering and pagination parameters.
16
+ * @param {number} [params.ClinicNum] - Get providers by ClinicNum
17
+ * @param {string} [params.DateTStamp] - Get providers altered after the specified date and time
18
+ * @param {string} [params.Offset] - Pagination
19
+ * @returns {Promise<Provider[]>} - A list of summarized patient data.
20
+ * @throws {Error} - If the API returns an error.
21
+ */
22
+ getProviders({ ClinicNum, DateTStamp, Offset, }?: GetProviderParams): Promise<Provider[]>;
23
+ /**
24
+ * Creates a provider. Cannot create PatFields associated with hidden PatFieldDefs.
25
+ * @param {Object} data - The data for the new patfield.
26
+ * @param {string} data.Abbr - Required.
27
+ * @param {string} data.LName - Optional.
28
+ * @param {string} data.FName - Optional.
29
+ * @param {string} data.MI - Optional.
30
+ * @param {string} data.Suffix - Optional.
31
+ * @param {number} data.FeeSched - Optional.
32
+ * @param {number} data.Specialty - Optional.
33
+ * @param {string} data.SSN - Optional.
34
+ * @param {'true' | 'false'} data.IsSecondary - Optional.
35
+ * @param {'true' | 'false'} data.IsHidden - Optional.
36
+ * @param {'true' | 'false'} data.UsingTIN - Optional.
37
+ * @param {'true' | 'false'} data.SigOnFile - Optional.
38
+ * @param {'true' | 'false'} data.IsNotPerson - Optional.
39
+ * @param {'true' | 'false'} data.IsHiddenReport - Optional.
40
+ * @param {string} data.Birthdate - Optional.
41
+ * @param {string} data.SchedNote - Optional.
42
+ * @param {string} data.PreferredName - Optional.
43
+ * @returns {Promise<Provider>} - The created PatField.
44
+ * @throws {Error} - If the data is invalid or the API returns an error.
45
+ */
46
+ createProvider({ Abbr, LName, FName, MI, Suffix, FeeSched, Specialty, SSN, IsSecondary, IsHidden, UsingTIN, SigOnFile, IsNotPerson, IsHiddenReport, Birthdate, SchedNote, PreferredName, }: createProviderParams): Promise<Provider>;
47
+ /**
48
+ * Update a provider.
49
+ * @param {number} ProvNum - The ID of the provider.
50
+ * @param {Object} data - The data for the new patfield.
51
+ * @param {string} data.Abbr - Optional but must not be blank.
52
+ * @param {string} data.LName - Optional.
53
+ * @param {string} data.FName - Optional.
54
+ * @param {string} data.MI - Optional.
55
+ * @param {string} data.Suffix - Optional.
56
+ * @param {number} data.FeeSched - Optional.
57
+ * @param {number} data.Specialty - Optional.
58
+ * @param {string} data.SSN - Optional.
59
+ * @param {'true' | 'false'} data.IsSecondary - Optional.
60
+ * @param {'true' | 'false'} data.IsHidden - Optional.
61
+ * @param {'true' | 'false'} data.UsingTIN - Optional.
62
+ * @param {'true' | 'false'} data.SigOnFile - Optional.
63
+ * @param {'true' | 'false'} data.IsNotPerson - Optional.
64
+ * @param {'true' | 'false'} data.IsHiddenReport - Optional.
65
+ * @param {string} data.Birthdate - Optional.
66
+ * @param {string} data.SchedNote - Optional.
67
+ * @param {string} data.PreferredName - Optional.
68
+ * @returns {Promise<Provider>} - The created PatField.
69
+ * @throws {Error} - If the data is invalid or the API returns an error.
70
+ */
71
+ updateProvider({ ProvNum, Abbr, LName, FName, MI, Suffix, Specialty, SSN, NationalProvID, StateLicense, UsingTIN, SigOnFile, PreferredName, }: updateProviderParams): Promise<Provider>;
72
+ }
73
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/api/providers.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;OAKG;IACU,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQ5D;;;;;;;;OAQG;IACY,YAAY,CAAC,EACxB,SAAS,EACT,UAAU,EACV,MAAM,GACP,GAAE,iBAAsB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAS/C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACU,cAAc,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,KAAK,EACL,EAAE,EACF,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,EACH,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,SAAS,EACT,SAAS,EACT,aAAa,GACd,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAyB7C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACU,cAAc,CAAC,EAC1B,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,EAAE,EACF,MAAM,EACN,SAAS,EACT,GAAG,EACH,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,aAAa,GACd,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAmB9C"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Providers {
4
+ httpClient;
5
+ constructor(httpClient) {
6
+ this.httpClient = httpClient;
7
+ }
8
+ /**
9
+ * Fetch a single provider by its ID.
10
+ * @param {number} ProvNum - The ID of the provider.
11
+ * @returns {Promise<Provider>} - The provider data.
12
+ * @throws {Error} - If `ProvNum` is not valid or the API returns an error.
13
+ */
14
+ async getProvider(ProvNum) {
15
+ if (!ProvNum || typeof ProvNum !== "number") {
16
+ throw new Error("Invalid parameter: PatNum must be a valid number.");
17
+ }
18
+ return await this.httpClient.get(`/providers/${ProvNum}`);
19
+ }
20
+ /**
21
+ * Fetch multiple providers with optional filtering and pagination.
22
+ * @param {Object} params - Filtering and pagination parameters.
23
+ * @param {number} [params.ClinicNum] - Get providers by ClinicNum
24
+ * @param {string} [params.DateTStamp] - Get providers altered after the specified date and time
25
+ * @param {string} [params.Offset] - Pagination
26
+ * @returns {Promise<Provider[]>} - A list of summarized patient data.
27
+ * @throws {Error} - If the API returns an error.
28
+ */
29
+ async getProviders({ ClinicNum, DateTStamp, Offset, } = {}) {
30
+ return await this.httpClient.get("/providers", {
31
+ ClinicNum,
32
+ DateTStamp,
33
+ Offset,
34
+ });
35
+ }
36
+ /**
37
+ * Creates a provider. Cannot create PatFields associated with hidden PatFieldDefs.
38
+ * @param {Object} data - The data for the new patfield.
39
+ * @param {string} data.Abbr - Required.
40
+ * @param {string} data.LName - Optional.
41
+ * @param {string} data.FName - Optional.
42
+ * @param {string} data.MI - Optional.
43
+ * @param {string} data.Suffix - Optional.
44
+ * @param {number} data.FeeSched - Optional.
45
+ * @param {number} data.Specialty - Optional.
46
+ * @param {string} data.SSN - Optional.
47
+ * @param {'true' | 'false'} data.IsSecondary - Optional.
48
+ * @param {'true' | 'false'} data.IsHidden - Optional.
49
+ * @param {'true' | 'false'} data.UsingTIN - Optional.
50
+ * @param {'true' | 'false'} data.SigOnFile - Optional.
51
+ * @param {'true' | 'false'} data.IsNotPerson - Optional.
52
+ * @param {'true' | 'false'} data.IsHiddenReport - Optional.
53
+ * @param {string} data.Birthdate - Optional.
54
+ * @param {string} data.SchedNote - Optional.
55
+ * @param {string} data.PreferredName - Optional.
56
+ * @returns {Promise<Provider>} - The created PatField.
57
+ * @throws {Error} - If the data is invalid or the API returns an error.
58
+ */
59
+ async createProvider({ Abbr, LName, FName, MI, Suffix, FeeSched, Specialty, SSN, IsSecondary, IsHidden, UsingTIN, SigOnFile, IsNotPerson, IsHiddenReport, Birthdate, SchedNote, PreferredName, }) {
60
+ if (!Abbr) {
61
+ throw new Error("Invalid data: All Abbr is required.");
62
+ }
63
+ return await this.httpClient.post("/providers", {
64
+ Abbr,
65
+ LName,
66
+ FName,
67
+ MI,
68
+ Suffix,
69
+ FeeSched,
70
+ Specialty,
71
+ SSN,
72
+ IsSecondary,
73
+ IsHidden,
74
+ UsingTIN,
75
+ SigOnFile,
76
+ IsNotPerson,
77
+ IsHiddenReport,
78
+ Birthdate,
79
+ SchedNote,
80
+ PreferredName,
81
+ });
82
+ }
83
+ /**
84
+ * Update a provider.
85
+ * @param {number} ProvNum - The ID of the provider.
86
+ * @param {Object} data - The data for the new patfield.
87
+ * @param {string} data.Abbr - Optional but must not be blank.
88
+ * @param {string} data.LName - Optional.
89
+ * @param {string} data.FName - Optional.
90
+ * @param {string} data.MI - Optional.
91
+ * @param {string} data.Suffix - Optional.
92
+ * @param {number} data.FeeSched - Optional.
93
+ * @param {number} data.Specialty - Optional.
94
+ * @param {string} data.SSN - Optional.
95
+ * @param {'true' | 'false'} data.IsSecondary - Optional.
96
+ * @param {'true' | 'false'} data.IsHidden - Optional.
97
+ * @param {'true' | 'false'} data.UsingTIN - Optional.
98
+ * @param {'true' | 'false'} data.SigOnFile - Optional.
99
+ * @param {'true' | 'false'} data.IsNotPerson - Optional.
100
+ * @param {'true' | 'false'} data.IsHiddenReport - Optional.
101
+ * @param {string} data.Birthdate - Optional.
102
+ * @param {string} data.SchedNote - Optional.
103
+ * @param {string} data.PreferredName - Optional.
104
+ * @returns {Promise<Provider>} - The created PatField.
105
+ * @throws {Error} - If the data is invalid or the API returns an error.
106
+ */
107
+ async updateProvider({ ProvNum, Abbr, LName, FName, MI, Suffix, Specialty, SSN, NationalProvID, StateLicense, UsingTIN, SigOnFile, PreferredName, }) {
108
+ if (!ProvNum) {
109
+ throw new Error("Invalid data: ProvNum is required.");
110
+ }
111
+ return await this.httpClient.put(`/providers/${ProvNum}`, {
112
+ Abbr,
113
+ LName,
114
+ FName,
115
+ MI,
116
+ Suffix,
117
+ Specialty,
118
+ SSN,
119
+ NationalProvID,
120
+ StateLicense,
121
+ UsingTIN,
122
+ SigOnFile,
123
+ PreferredName,
124
+ });
125
+ }
126
+ }
127
+ exports.default = Providers;
@@ -7,6 +7,8 @@ import ProcedureLogs from "./api/procedureLog";
7
7
  import Recalls from "./api/recalls";
8
8
  import TreatmentPlans from "./api/treatplans";
9
9
  import Schedules from "./api/schedules";
10
+ import Providers from "./api/providers";
11
+ import Operatories from "./api/operatories";
10
12
  declare class OpenDental {
11
13
  private static httpClient;
12
14
  /**
@@ -49,6 +51,14 @@ declare class OpenDental {
49
51
  * Create a new instance of the Schedules API.
50
52
  */
51
53
  static Schedules(): Schedules;
54
+ /**
55
+ * Create a new instance of the Schedules API.
56
+ */
57
+ static Providers(): Providers;
58
+ /**
59
+ * Create a new instance of the Schedules API.
60
+ */
61
+ static Operatories(): Operatories;
52
62
  }
53
63
  export { OpenDental };
54
64
  //# 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;AAGxC,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAC,UAAU,CAAa;IAEtC;;OAEG;WACW,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAWlE;;OAEG;WACa,YAAY;IAQ5B;;OAEG;WACa,QAAQ;IAOxB;;OAEG;WACW,YAAY;IAO1B;;SAEK;WACS,SAAS;IAOvB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,aAAa;IAO3B;;OAEG;WACW,OAAO;IAOrB;;OAEG;WACW,cAAc;IAO5B;;OAEG;WACa,SAAS;CAQ1B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"openDental.d.ts","sourceRoot":"","sources":["../src/openDental.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAE5C,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAC,UAAU,CAAa;IAEtC;;OAEG;WACW,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAWlE;;OAEG;WACa,YAAY;IAQ5B;;OAEG;WACa,QAAQ;IAOxB;;OAEG;WACW,YAAY;IAO1B;;SAEK;WACS,SAAS;IAOvB;;OAEG;WACW,QAAQ;IAOtB;;OAEG;WACW,aAAa;IAO3B;;OAEG;WACW,OAAO;IAOrB;;OAEG;WACW,cAAc;IAO5B;;OAEG;WACa,SAAS;IAOzB;;OAEG;WACa,SAAS;IAOzB;;OAEG;WACa,WAAW;CAM5B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -14,6 +14,8 @@ const procedureLog_1 = __importDefault(require("./api/procedureLog"));
14
14
  const recalls_1 = __importDefault(require("./api/recalls"));
15
15
  const treatplans_1 = __importDefault(require("./api/treatplans"));
16
16
  const schedules_1 = __importDefault(require("./api/schedules"));
17
+ const providers_1 = __importDefault(require("./api/providers"));
18
+ const operatories_1 = __importDefault(require("./api/operatories"));
17
19
  class OpenDental {
18
20
  static httpClient;
19
21
  /**
@@ -108,5 +110,23 @@ class OpenDental {
108
110
  }
109
111
  return new schedules_1.default(this.httpClient);
110
112
  }
113
+ /**
114
+ * Create a new instance of the Schedules API.
115
+ */
116
+ static Providers() {
117
+ if (!this.httpClient) {
118
+ throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
119
+ }
120
+ return new providers_1.default(this.httpClient);
121
+ }
122
+ /**
123
+ * Create a new instance of the Schedules API.
124
+ */
125
+ static Operatories() {
126
+ if (!this.httpClient) {
127
+ throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
128
+ }
129
+ return new operatories_1.default(this.httpClient);
130
+ }
111
131
  }
112
132
  exports.OpenDental = OpenDental;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Parameters for fetching multiple patients.
3
+ * @see https://www.opendental.com/site/apioperatories.html
4
+ * Version Added: 24.1.10
5
+ */
6
+ export interface Operatory {
7
+ OperatoryNum?: number;
8
+ OpName?: string;
9
+ Abbrev?: string;
10
+ ItemOrder?: number;
11
+ IsHidden?: 'true' | 'false';
12
+ ProvDentist?: number;
13
+ ProvHygienist?: string;
14
+ IsHygiene?: 'true' | 'false';
15
+ SetProspective?: 'true' | 'false';
16
+ IsWebSched?: 'true' | 'false';
17
+ OperatoryType?: number;
18
+ operatoryType?: string;
19
+ }
20
+ export interface GetOperatoriesParams {
21
+ ClinicNum?: number;
22
+ Offset?: number;
23
+ }
24
+ //# sourceMappingURL=operatoryTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operatoryTypes.d.ts","sourceRoot":"","sources":["../../src/types/operatoryTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Parameters for fetching multiple patients.
3
+ * @see https://www.opendental.com/site/apiproviders.html
4
+ * Version Added: 24.4.17
5
+ */
6
+ export interface Provider {
7
+ ProvNum?: number;
8
+ Abbr?: number;
9
+ LName?: string;
10
+ FName?: string;
11
+ MI?: string;
12
+ Suffix?: string;
13
+ FeeSched?: number;
14
+ Specialty?: number;
15
+ SSN?: string;
16
+ StateLicense?: string;
17
+ IsSecondary?: 'true' | 'false';
18
+ provColor?: string;
19
+ IsHidden?: 'true' | 'false';
20
+ UsingTIN?: string;
21
+ SigOnFile?: 'true' | 'false';
22
+ NationalProvID?: string;
23
+ DateTStamp?: string;
24
+ IsNotPerson?: 'true' | 'false';
25
+ ProvStatus?: string;
26
+ IsHiddenReport?: 'true' | 'false';
27
+ Birthdate?: string;
28
+ SchedNote?: string;
29
+ PreferredName?: string;
30
+ serverDateTime?: string;
31
+ }
32
+ export interface GetProviderParams {
33
+ ClinicNum?: number;
34
+ DateTStamp?: string;
35
+ Offset?: number;
36
+ }
37
+ export interface createProviderParams {
38
+ Abbr: number;
39
+ LName?: string;
40
+ FName?: string;
41
+ MI?: string;
42
+ Suffix?: string;
43
+ FeeSched?: number;
44
+ Specialty?: number;
45
+ SSN?: string;
46
+ IsSecondary?: 'true' | 'false';
47
+ IsHidden?: 'true' | 'false';
48
+ UsingTIN?: string;
49
+ SigOnFile?: 'true' | 'false';
50
+ IsNotPerson?: 'true' | 'false';
51
+ IsHiddenReport?: 'true' | 'false';
52
+ Birthdate?: string;
53
+ SchedNote?: string;
54
+ PreferredName?: string;
55
+ }
56
+ export interface updateProviderParams {
57
+ ProvNum: number;
58
+ Abbr?: number;
59
+ LName?: string;
60
+ FName?: string;
61
+ MI?: string;
62
+ Suffix?: string;
63
+ PreferredName?: string;
64
+ Specialty?: number;
65
+ SigOnFile?: 'true' | 'false';
66
+ NationalProvID?: string;
67
+ StateLicense?: string;
68
+ SSN?: string;
69
+ UsingTIN?: string;
70
+ }
71
+ //# sourceMappingURL=providerTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providerTypes.d.ts","sourceRoot":"","sources":["../../src/types/providerTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -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": "0.1.5",
3
+ "version": "0.1.6",
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,46 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import {
3
+ Operatory,
4
+ GetOperatoriesParams,
5
+ } from "../types/operatoryTypes";
6
+
7
+ export default class Operatories {
8
+ private httpClient: HttpClient;
9
+
10
+ constructor(httpClient: HttpClient) {
11
+ this.httpClient = httpClient;
12
+ }
13
+
14
+ /**
15
+ * Fetch a single patfield by its ID.
16
+ * @param {number} OperatoryNum - The ID of the patfield.
17
+ * @returns {Promise<Operatory>} - The patient data.
18
+ * @throws {Error} - If `PatNum` is not valid or the API returns an error.
19
+ */
20
+ public async getPatField(OperatoryNum: number): Promise<Operatory> {
21
+ if (!OperatoryNum || typeof OperatoryNum !== "number") {
22
+ throw new Error("Invalid parameter: PatNum must be a valid number.");
23
+ }
24
+
25
+ return await this.httpClient.get<Operatory>(`/operatories/${OperatoryNum}`);
26
+ }
27
+
28
+ /**
29
+ * Fetch multiple patients with optional filtering and pagination.
30
+ * @param {Object} params - Filtering and pagination parameters.
31
+ * @param {string} [params.ClinicNum] - Filter by clinicnum
32
+ * @param {string} [params.Offset] - Filter by clinicnum
33
+ * @returns {Promise<Operatory[]>} - A list of summarized patient data.
34
+ * @throws {Error} - If the API returns an error.
35
+ */
36
+ public async getOperatories({
37
+ ClinicNum,
38
+ Offset,
39
+ }: GetOperatoriesParams = {}): Promise<Operatory[]> {
40
+
41
+ return await this.httpClient.get<Operatory[]>("/operatories", {
42
+ ClinicNum,
43
+ Offset,
44
+ });
45
+ }
46
+ }
@@ -0,0 +1,175 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import {
3
+ Provider,
4
+ GetProviderParams,
5
+ createProviderParams,
6
+ updateProviderParams,
7
+ } from "../types/providerTypes";
8
+
9
+ export default class Providers {
10
+ private httpClient: HttpClient;
11
+
12
+ constructor(httpClient: HttpClient) {
13
+ this.httpClient = httpClient;
14
+ }
15
+
16
+ /**
17
+ * Fetch a single provider by its ID.
18
+ * @param {number} ProvNum - The ID of the provider.
19
+ * @returns {Promise<Provider>} - The provider data.
20
+ * @throws {Error} - If `ProvNum` is not valid or the API returns an error.
21
+ */
22
+ public async getProvider(ProvNum: number): Promise<Provider> {
23
+ if (!ProvNum || typeof ProvNum !== "number") {
24
+ throw new Error("Invalid parameter: PatNum must be a valid number.");
25
+ }
26
+
27
+ return await this.httpClient.get<Provider>(`/providers/${ProvNum}`);
28
+ }
29
+
30
+ /**
31
+ * Fetch multiple providers with optional filtering and pagination.
32
+ * @param {Object} params - Filtering and pagination parameters.
33
+ * @param {number} [params.ClinicNum] - Get providers by ClinicNum
34
+ * @param {string} [params.DateTStamp] - Get providers altered after the specified date and time
35
+ * @param {string} [params.Offset] - Pagination
36
+ * @returns {Promise<Provider[]>} - A list of summarized patient data.
37
+ * @throws {Error} - If the API returns an error.
38
+ */
39
+ public async getProviders({
40
+ ClinicNum,
41
+ DateTStamp,
42
+ Offset,
43
+ }: GetProviderParams = {}): Promise<Provider[]> {
44
+
45
+ return await this.httpClient.get<Provider[]>("/providers", {
46
+ ClinicNum,
47
+ DateTStamp,
48
+ Offset,
49
+ });
50
+ }
51
+
52
+ /**
53
+ * Creates a provider. Cannot create PatFields associated with hidden PatFieldDefs.
54
+ * @param {Object} data - The data for the new patfield.
55
+ * @param {string} data.Abbr - Required.
56
+ * @param {string} data.LName - Optional.
57
+ * @param {string} data.FName - Optional.
58
+ * @param {string} data.MI - Optional.
59
+ * @param {string} data.Suffix - Optional.
60
+ * @param {number} data.FeeSched - Optional.
61
+ * @param {number} data.Specialty - Optional.
62
+ * @param {string} data.SSN - Optional.
63
+ * @param {'true' | 'false'} data.IsSecondary - Optional.
64
+ * @param {'true' | 'false'} data.IsHidden - Optional.
65
+ * @param {'true' | 'false'} data.UsingTIN - Optional.
66
+ * @param {'true' | 'false'} data.SigOnFile - Optional.
67
+ * @param {'true' | 'false'} data.IsNotPerson - Optional.
68
+ * @param {'true' | 'false'} data.IsHiddenReport - Optional.
69
+ * @param {string} data.Birthdate - Optional.
70
+ * @param {string} data.SchedNote - Optional.
71
+ * @param {string} data.PreferredName - Optional.
72
+ * @returns {Promise<Provider>} - The created PatField.
73
+ * @throws {Error} - If the data is invalid or the API returns an error.
74
+ */
75
+ public async createProvider({
76
+ Abbr,
77
+ LName,
78
+ FName,
79
+ MI,
80
+ Suffix,
81
+ FeeSched,
82
+ Specialty,
83
+ SSN,
84
+ IsSecondary,
85
+ IsHidden,
86
+ UsingTIN,
87
+ SigOnFile,
88
+ IsNotPerson,
89
+ IsHiddenReport,
90
+ Birthdate,
91
+ SchedNote,
92
+ PreferredName,
93
+ }: createProviderParams): Promise<Provider> {
94
+ if (!Abbr) {
95
+ throw new Error("Invalid data: All Abbr is required.");
96
+ }
97
+ return await this.httpClient.post<Provider>("/providers", {
98
+ Abbr,
99
+ LName,
100
+ FName,
101
+ MI,
102
+ Suffix,
103
+ FeeSched,
104
+ Specialty,
105
+ SSN,
106
+ IsSecondary,
107
+ IsHidden,
108
+ UsingTIN,
109
+ SigOnFile,
110
+ IsNotPerson,
111
+ IsHiddenReport,
112
+ Birthdate,
113
+ SchedNote,
114
+ PreferredName,
115
+ });
116
+ }
117
+
118
+ /**
119
+ * Update a provider.
120
+ * @param {number} ProvNum - The ID of the provider.
121
+ * @param {Object} data - The data for the new patfield.
122
+ * @param {string} data.Abbr - Optional but must not be blank.
123
+ * @param {string} data.LName - Optional.
124
+ * @param {string} data.FName - Optional.
125
+ * @param {string} data.MI - Optional.
126
+ * @param {string} data.Suffix - Optional.
127
+ * @param {number} data.FeeSched - Optional.
128
+ * @param {number} data.Specialty - Optional.
129
+ * @param {string} data.SSN - Optional.
130
+ * @param {'true' | 'false'} data.IsSecondary - Optional.
131
+ * @param {'true' | 'false'} data.IsHidden - Optional.
132
+ * @param {'true' | 'false'} data.UsingTIN - Optional.
133
+ * @param {'true' | 'false'} data.SigOnFile - Optional.
134
+ * @param {'true' | 'false'} data.IsNotPerson - Optional.
135
+ * @param {'true' | 'false'} data.IsHiddenReport - Optional.
136
+ * @param {string} data.Birthdate - Optional.
137
+ * @param {string} data.SchedNote - Optional.
138
+ * @param {string} data.PreferredName - Optional.
139
+ * @returns {Promise<Provider>} - The created PatField.
140
+ * @throws {Error} - If the data is invalid or the API returns an error.
141
+ */
142
+ public async updateProvider({
143
+ ProvNum,
144
+ Abbr,
145
+ LName,
146
+ FName,
147
+ MI,
148
+ Suffix,
149
+ Specialty,
150
+ SSN,
151
+ NationalProvID,
152
+ StateLicense,
153
+ UsingTIN,
154
+ SigOnFile,
155
+ PreferredName,
156
+ }: updateProviderParams): Promise<Provider> {
157
+ if (!ProvNum) {
158
+ throw new Error("Invalid data: ProvNum is required.");
159
+ }
160
+ return await this.httpClient.put<Provider>(`/providers/${ProvNum}`, {
161
+ Abbr,
162
+ LName,
163
+ FName,
164
+ MI,
165
+ Suffix,
166
+ Specialty,
167
+ SSN,
168
+ NationalProvID,
169
+ StateLicense,
170
+ UsingTIN,
171
+ SigOnFile,
172
+ PreferredName,
173
+ });
174
+ }
175
+ }
package/src/openDental.ts CHANGED
@@ -8,7 +8,8 @@ import ProcedureLogs from "./api/procedureLog";
8
8
  import Recalls from "./api/recalls";
9
9
  import TreatmentPlans from "./api/treatplans";
10
10
  import Schedules from "./api/schedules";
11
-
11
+ import Providers from "./api/providers";
12
+ import Operatories from "./api/operatories";
12
13
 
13
14
  class OpenDental {
14
15
  private static httpClient: HttpClient;
@@ -117,8 +118,26 @@ class OpenDental {
117
118
  }
118
119
  return new Schedules(this.httpClient);
119
120
  }
121
+
122
+ /**
123
+ * Create a new instance of the Schedules API.
124
+ */
125
+ public static Providers() {
126
+ if (!this.httpClient) {
127
+ throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
128
+ }
129
+ return new Providers(this.httpClient);
130
+ }
120
131
 
121
-
132
+ /**
133
+ * Create a new instance of the Schedules API.
134
+ */
135
+ public static Operatories() {
136
+ if (!this.httpClient) {
137
+ throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
138
+ }
139
+ return new Operatories(this.httpClient);
140
+ }
122
141
  }
123
142
 
124
143
  export { OpenDental };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Parameters for fetching multiple patients.
3
+ * @see https://www.opendental.com/site/apioperatories.html
4
+ * Version Added: 24.1.10
5
+ */
6
+ export interface Operatory {
7
+ OperatoryNum?: number; //Unique identifier for an operatory
8
+ OpName?: string; //
9
+ Abbrev?: string; //
10
+ ItemOrder?: number; //
11
+ IsHidden?: 'true' | 'false'; //
12
+ ProvDentist?: number; //
13
+ ProvHygienist?: string; //"YYYY-MM-DD"
14
+ IsHygiene?: 'true' | 'false'; //
15
+ SetProspective?: 'true' | 'false'; //
16
+ IsWebSched?: 'true' | 'false'; //
17
+ OperatoryType?: number; //"YYYY-MM-DD"
18
+ operatoryType?: string; //"YYYY-MM-DD"
19
+ }
20
+
21
+ export interface GetOperatoriesParams {
22
+ ClinicNum?: number; //
23
+ Offset?: number; //
24
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Parameters for fetching multiple patients.
3
+ * @see https://www.opendental.com/site/apiproviders.html
4
+ * Version Added: 24.4.17
5
+ */
6
+ export interface Provider {
7
+ ProvNum?: number; //Unique identifier for provider
8
+ Abbr?: number; //
9
+ LName?: string; //
10
+ FName?: string; //
11
+ MI?: string; //
12
+ Suffix?: string; //
13
+ FeeSched?: number; //FK to feesched
14
+ Specialty?: number; //FK to speciality
15
+ SSN?: string; //
16
+ StateLicense?: string; //
17
+ IsSecondary?: 'true' | 'false'; //
18
+ provColor?: string; //
19
+ IsHidden?: 'true' | 'false'; //
20
+ UsingTIN?: string; //
21
+ SigOnFile?: 'true' | 'false'; //
22
+ NationalProvID?: string; //
23
+ DateTStamp?: string; //
24
+ IsNotPerson?: 'true' | 'false'; //
25
+ ProvStatus?: string; //
26
+ IsHiddenReport?: 'true' | 'false'; //
27
+ Birthdate?: string; //"YYYY-MM-DD"
28
+ SchedNote?: string; //
29
+ PreferredName?: string; //
30
+ serverDateTime?: string; //
31
+ }
32
+
33
+ export interface GetProviderParams {
34
+ ClinicNum?: number; //Optional. Specifying a ClinicNum returns list of non-hidden providers that are either not restricted to a clinic, or are restricted to the ClinicNum provided. When using ClinicNum, a serverDateTime will not be returned.
35
+ DateTStamp?: string; // (added in version 21.3): Optional. String in "yyyy-MM-dd HH:mm:ss" format. Get providers altered after the specified date and time. This is a good way for you to keep a synchronized copy of providers. Store serverDateTime that gets returned, and use it to run the next GET.
36
+ Offset?: number; //
37
+ }
38
+
39
+ export interface createProviderParams {
40
+ Abbr: number; //Unique identifier for patient
41
+ LName?: string; //
42
+ FName?: string; //
43
+ MI?: string; //
44
+ Suffix?: string; //
45
+ FeeSched?: number; //FK to feesched
46
+ Specialty?: number; //FK to speciality
47
+ SSN?: string; //
48
+ IsSecondary?: 'true' | 'false'; //
49
+ IsHidden?: 'true' | 'false'; //
50
+ UsingTIN?: string; //
51
+ SigOnFile?: 'true' | 'false'; //
52
+ IsNotPerson?: 'true' | 'false'; //
53
+ IsHiddenReport?: 'true' | 'false'; //
54
+ Birthdate?: string; //"YYYY-MM-DD"
55
+ SchedNote?: string; //
56
+ PreferredName?: string; //
57
+ }
58
+
59
+ export interface updateProviderParams {
60
+ ProvNum: number //Unique identifier for provider
61
+ Abbr?: number; //
62
+ LName?: string; //
63
+ FName?: string; //
64
+ MI?: string; //
65
+ Suffix?: string; //
66
+ PreferredName?: string; //
67
+ Specialty?: number; //FK to speciality
68
+ SigOnFile?: 'true' | 'false'; //
69
+ NationalProvID?: string; //
70
+ StateLicense?: string; //
71
+ SSN?: string; //
72
+ UsingTIN?: string; //
73
+ }