@rinse-dental/open-dental 1.5.1 → 1.6.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.
@@ -0,0 +1,22 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import { ProcedureCode, GetProcedureCodeParams } from "../types/procedureCodeTypes";
3
+ export default class ProcedureCodes {
4
+ private httpClient;
5
+ constructor(httpClient: HttpClient);
6
+ /**
7
+ * Fetch a single inssub by its ID.
8
+ * @param {number} CodeNum - The unique identifier for the inssub.
9
+ * @returns {Promise<ProcedureCode>} - The inssub object.
10
+ * @throws {Error} - If `InsSubNum` is not provided.
11
+ */
12
+ getProcedureCode(CodeNum: number): Promise<ProcedureCode>;
13
+ /**
14
+ * Fetch multiple inssubs with optional filtering and pagination.
15
+ * @param {Object} params - The parameters for filtering and pagination.
16
+ * @param {string} [params.DateTStamp] - String in "yyyy-MM-dd HH:mm:ss" format. Get ProcedureCodes altered on and after the specified date and time.
17
+ * @param {number} [params.Offset] - Pagination offset for results.
18
+ * @returns {Promise<ProcedureCode[]>} - A list of inssubs.
19
+ */
20
+ getProcedureCodes({ DateTStamp, Offset, }?: GetProcedureCodeParams): Promise<ProcedureCode[]>;
21
+ }
22
+ //# sourceMappingURL=procedureCodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedureCodes.d.ts","sourceRoot":"","sources":["../../src/api/procedureCodes.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;OAKG;IACU,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAOtE;;;;;;QAMI;IACS,iBAAiB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,GAAE,sBAA2B,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAQ1D"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class ProcedureCodes {
4
+ httpClient;
5
+ constructor(httpClient) {
6
+ this.httpClient = httpClient;
7
+ }
8
+ /**
9
+ * Fetch a single inssub by its ID.
10
+ * @param {number} CodeNum - The unique identifier for the inssub.
11
+ * @returns {Promise<ProcedureCode>} - The inssub object.
12
+ * @throws {Error} - If `InsSubNum` is not provided.
13
+ */
14
+ async getProcedureCode(CodeNum) {
15
+ if (!CodeNum) {
16
+ throw new Error("CodeNum is required.");
17
+ }
18
+ return this.httpClient.get(`/procedurecodes/${CodeNum}`);
19
+ }
20
+ /**
21
+ * Fetch multiple inssubs with optional filtering and pagination.
22
+ * @param {Object} params - The parameters for filtering and pagination.
23
+ * @param {string} [params.DateTStamp] - String in "yyyy-MM-dd HH:mm:ss" format. Get ProcedureCodes altered on and after the specified date and time.
24
+ * @param {number} [params.Offset] - Pagination offset for results.
25
+ * @returns {Promise<ProcedureCode[]>} - A list of inssubs.
26
+ */
27
+ async getProcedureCodes({ DateTStamp, Offset, } = {}) {
28
+ const params = {
29
+ DateTStamp,
30
+ Offset,
31
+ };
32
+ return this.httpClient.get("/procedurecodes", params);
33
+ }
34
+ }
35
+ exports.default = ProcedureCodes;
@@ -22,6 +22,7 @@ import InsPlans from "./api/insPlans";
22
22
  import Benefits from "./api/benefits";
23
23
  import ClaimProcs from "./api/claimProcs";
24
24
  import Adjustments from "./api/adjustments";
25
+ import ProcedureCodes from "./api/procedureCodes";
25
26
  declare class OpenDental {
26
27
  private static httpClient;
27
28
  /**
@@ -124,6 +125,10 @@ declare class OpenDental {
124
125
  * Create a new instance of the Adjustments API.
125
126
  */
126
127
  static Adjustments(): Adjustments;
128
+ /**
129
+ * Create a new instance of the ProcedureCodes API.
130
+ */
131
+ static ProcedureCodes(): ProcedureCodes;
127
132
  }
128
133
  export { OpenDental };
129
134
  //# sourceMappingURL=openDental.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openDental.d.ts","sourceRoot":"","sources":["../src/openDental.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,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;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W;IAOzB;;OAEG;WACW,cAAc;CAO7B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -29,6 +29,7 @@ const insPlans_1 = __importDefault(require("./api/insPlans"));
29
29
  const benefits_1 = __importDefault(require("./api/benefits"));
30
30
  const claimProcs_1 = __importDefault(require("./api/claimProcs"));
31
31
  const adjustments_1 = __importDefault(require("./api/adjustments"));
32
+ const procedureCodes_1 = __importDefault(require("./api/procedureCodes"));
32
33
  class OpenDental {
33
34
  static httpClient;
34
35
  /**
@@ -258,5 +259,14 @@ class OpenDental {
258
259
  }
259
260
  return new adjustments_1.default(this.httpClient);
260
261
  }
262
+ /**
263
+ * Create a new instance of the ProcedureCodes API.
264
+ */
265
+ static ProcedureCodes() {
266
+ if (!this.httpClient) {
267
+ throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
268
+ }
269
+ return new procedureCodes_1.default(this.httpClient);
270
+ }
261
271
  }
262
272
  exports.OpenDental = OpenDental;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Represents a procedure code in the Open Dental system.
3
+ * @see https://www.opendental.com/site/apiprocedurecodes.html
4
+ */
5
+ export interface ProcedureCode {
6
+ CodeNum?: number;
7
+ ProcCode?: string;
8
+ Descript?: string;
9
+ AbbrDesc?: string;
10
+ ProcTime?: string;
11
+ ProcCat?: number;
12
+ procCat?: string;
13
+ TreatArea?: string;
14
+ NoBillIns?: number;
15
+ IsProsth?: "true" | "false";
16
+ DefaultNote?: string;
17
+ IsHygiene?: "true" | "false";
18
+ AlternateCode1?: string;
19
+ MedicalCode?: string;
20
+ IsTaxed?: "true" | "false";
21
+ PaintType?: string;
22
+ LaymanTerm?: string;
23
+ IsCanadianLab?: "true" | "false";
24
+ BaseUnits?: number;
25
+ SubstitutionCode?: string;
26
+ SubstOnlyIf?: string;
27
+ DateTStamp?: string;
28
+ DrugNDC?: string;
29
+ RevenueCodeDefault?: string;
30
+ ProvNumDefault?: number;
31
+ CanadaTimeUnits?: number;
32
+ IsRadiology?: "true" | "false";
33
+ DefaultClaimNote?: string;
34
+ DefaultTPNote?: string;
35
+ PaintText?: string;
36
+ AreaAlsoToothRange?: "true" | "false";
37
+ DiagnosticCodes?: string;
38
+ }
39
+ /**
40
+ * Gets a list of ProcedureCodes
41
+ * @see https://www.opendental.com/site/apiprocedurecodes.html
42
+ */
43
+ export interface GetProcedureCodeParams {
44
+ DateTStamp?: string;
45
+ Offset?: number;
46
+ }
47
+ //# sourceMappingURL=procedureCodeTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedureCodeTypes.d.ts","sourceRoot":"","sources":["../../src/types/procedureCodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rinse-dental/open-dental",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "A TypeScript library for easily accessing Open Dental APIs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/release.sh CHANGED
@@ -40,6 +40,6 @@ git push origin "$NEW_TAG"
40
40
  gh release create "$NEW_TAG" --title "Release $NEW_TAG" --notes "$COMMIT_MSG"
41
41
 
42
42
 
43
- #example ./release.sh "Some commit message" patch
44
- #example ./release.sh "Added insplans and benefits" minor
43
+ #example ./release.sh "added adjustments to index" patch
44
+ #example ./release.sh "Added adjustments" minor
45
45
  #example ./release.sh "Some commit message" major
@@ -0,0 +1,45 @@
1
+ import HttpClient from "../utils/httpClient";
2
+ import {
3
+ ProcedureCode,
4
+ GetProcedureCodeParams,
5
+ } from "../types/procedureCodeTypes";
6
+
7
+ export default class ProcedureCodes {
8
+ private httpClient: HttpClient;
9
+
10
+ constructor(httpClient: HttpClient) {
11
+ this.httpClient = httpClient;
12
+ }
13
+
14
+ /**
15
+ * Fetch a single inssub by its ID.
16
+ * @param {number} CodeNum - The unique identifier for the inssub.
17
+ * @returns {Promise<ProcedureCode>} - The inssub object.
18
+ * @throws {Error} - If `InsSubNum` is not provided.
19
+ */
20
+ public async getProcedureCode(CodeNum: number): Promise<ProcedureCode> {
21
+ if (!CodeNum) {
22
+ throw new Error("CodeNum is required.");
23
+ }
24
+ return this.httpClient.get<ProcedureCode>(`/procedurecodes/${CodeNum}`);
25
+ }
26
+
27
+ /**
28
+ * Fetch multiple inssubs with optional filtering and pagination.
29
+ * @param {Object} params - The parameters for filtering and pagination.
30
+ * @param {string} [params.DateTStamp] - String in "yyyy-MM-dd HH:mm:ss" format. Get ProcedureCodes altered on and after the specified date and time.
31
+ * @param {number} [params.Offset] - Pagination offset for results.
32
+ * @returns {Promise<ProcedureCode[]>} - A list of inssubs.
33
+ */
34
+ public async getProcedureCodes({
35
+ DateTStamp,
36
+ Offset,
37
+ }: GetProcedureCodeParams = {}): Promise<ProcedureCode[]> {
38
+ const params = {
39
+ DateTStamp,
40
+ Offset,
41
+ };
42
+
43
+ return this.httpClient.get<ProcedureCode[]>("/procedurecodes", params);
44
+ }
45
+ }
package/src/openDental.ts CHANGED
@@ -23,6 +23,7 @@ import InsPlans from "./api/insPlans";
23
23
  import Benefits from "./api/benefits";
24
24
  import ClaimProcs from "./api/claimProcs";
25
25
  import Adjustments from "./api/adjustments";
26
+ import ProcedureCodes from "./api/procedureCodes";
26
27
 
27
28
  class OpenDental {
28
29
  private static httpClient: HttpClient;
@@ -281,6 +282,17 @@ class OpenDental {
281
282
  }
282
283
  return new Adjustments(this.httpClient);
283
284
  }
285
+
286
+ /**
287
+ * Create a new instance of the ProcedureCodes API.
288
+ */
289
+ public static ProcedureCodes() {
290
+ if (!this.httpClient) {
291
+ throw new Error("OpenDental not initialized. Call OpenDental.initialize() first.");
292
+ }
293
+ return new ProcedureCodes(this.httpClient);
294
+ }
295
+
284
296
  }
285
297
 
286
298
  export { OpenDental };
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Represents a procedure code in the Open Dental system.
3
+ * @see https://www.opendental.com/site/apiprocedurecodes.html
4
+ */
5
+ export interface ProcedureCode {
6
+ CodeNum?: number; //PK
7
+ ProcCode?: string; //
8
+ Descript?: string; //
9
+ AbbrDesc?: string; //
10
+ ProcTime?: string; //
11
+ ProcCat?: number; //
12
+ procCat?: string; //
13
+ TreatArea?: string; //
14
+ NoBillIns?: number; //
15
+ IsProsth?: "true" | "false"; //
16
+ DefaultNote?: string; //
17
+ IsHygiene?: "true" | "false"; //
18
+ AlternateCode1?: string; //
19
+ MedicalCode?: string; //
20
+ IsTaxed?: "true" | "false"; //
21
+ PaintType?: string; //
22
+ LaymanTerm?: string; //
23
+ IsCanadianLab?: "true" | "false"; //
24
+ BaseUnits?: number; //
25
+ SubstitutionCode?: string; //
26
+ SubstOnlyIf?: string; //
27
+ DateTStamp?: string; //String in "yyyy-MM-dd HH:mm:ss" format.
28
+ DrugNDC?: string; //
29
+ RevenueCodeDefault?: string; //
30
+ ProvNumDefault?: number; //
31
+ CanadaTimeUnits?: number; //
32
+ IsRadiology?: "true" | "false"; //
33
+ DefaultClaimNote?: string; //
34
+ DefaultTPNote?: string; //
35
+ PaintText?: string; //
36
+ AreaAlsoToothRange?: "true" | "false"; //
37
+ DiagnosticCodes?: string; //
38
+ }
39
+
40
+ /**
41
+ * Gets a list of ProcedureCodes
42
+ * @see https://www.opendental.com/site/apiprocedurecodes.html
43
+ */
44
+ export interface GetProcedureCodeParams {
45
+ DateTStamp?: string; //String in "yyyy-MM-dd HH:mm:ss" format. Get ProcedureCodes altered on and after the specified date and time.
46
+ Offset?: number; // Pagination offset for results
47
+ }
48
+