@rinse-dental/open-dental 2.5.7 → 3.0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitTypes.d.ts","sourceRoot":"","sources":["../../src/transformerTypes/visitTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"visitTypes.d.ts","sourceRoot":"","sources":["../../src/transformerTypes/visitTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,KAAK;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBA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AAM,CAAC;CACxB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GACjB,WAAW,GACX,UAAU,GACV,aAAa,GACb,MAAM,GACN,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visit.d.ts","sourceRoot":"","sources":["../../src/transformers/visit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"visit.d.ts","sourceRoot":"","sources":["../../src/transformers/visit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAGvD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,KAAK,CAsC1D"}
|
|
@@ -5,24 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.appointmentToVisit = appointmentToVisit;
|
|
7
7
|
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
8
|
-
const firebase_admin_1 = __importDefault(require("firebase-admin"));
|
|
9
8
|
function appointmentToVisit(apt) {
|
|
10
|
-
const db = firebase_admin_1.default.firestore();
|
|
11
9
|
const moment_aptDateTime = moment_timezone_1.default.tz(apt.AptDateTime, 'YYYY-MM-DD HH:mm:ss', 'America/Los_Angeles');
|
|
12
|
-
/*
|
|
13
|
-
let firestoreTimestamp: Timestamp | undefined;
|
|
14
|
-
if (moment_aptDateTime.isValid()) {
|
|
15
|
-
//firestoreTimestamp = Timestamp.fromDate(moment_aptDateTime.toDate());
|
|
16
|
-
} else {
|
|
17
|
-
console.warn(`Invalid AptDateTime: "${apt.AptDateTime}"`);
|
|
18
|
-
}
|
|
19
|
-
*/
|
|
20
10
|
const duration = (apt.Pattern?.length || 0) * 5;
|
|
21
11
|
const location = 'NF6YVFAXyRVXGi5nItqV';
|
|
22
12
|
const display_ProvNum = apt.IsHygiene == 'true' ? apt.ProvHyg : apt.ProvNum;
|
|
23
13
|
const AptTypeNum = apt.AppointmentTypeNum == 0 ? updateAptTypeNum(apt.ProcDescript ?? '') : apt.AppointmentTypeNum;
|
|
24
14
|
return {
|
|
25
|
-
//docRef: db.doc(`/patients/${apt.PatNum}/patientVisits/${apt.AptNum}`),
|
|
26
15
|
...apt,
|
|
27
16
|
TimeLocked: apt.TimeLocked === 'true',
|
|
28
17
|
IsHygiene: apt.IsHygiene == 'true',
|
|
@@ -31,13 +20,9 @@ function appointmentToVisit(apt) {
|
|
|
31
20
|
status: normalizeStatus(apt.AptStatus),
|
|
32
21
|
duration: duration,
|
|
33
22
|
ProvNum: display_ProvNum,
|
|
34
|
-
//ProviderDocRef: display_ProvNum != 0 ? db.doc(`/providers/${display_ProvNum}`) : undefined,
|
|
35
|
-
//VisitTypeDocRef: db.doc(`/lookups/lookup_definitions/lookup_visitType/${AptTypeNum}`),
|
|
36
|
-
//OpDocRef: apt.Op != 0 ? db.doc(`/locations/${location}/locationOperatories/${apt.Op}`) : undefined,
|
|
37
23
|
date: moment_aptDateTime.format('YYYY-MM-DD'),
|
|
38
24
|
dateTime: moment_aptDateTime.format(),
|
|
39
25
|
unix: moment_aptDateTime.unix(),
|
|
40
|
-
//firestoreTimestamp: firestoreTimestamp,
|
|
41
26
|
date_formats: {
|
|
42
27
|
date_MMM_D: moment_aptDateTime.format('MMM D'),
|
|
43
28
|
month_M: moment_aptDateTime.format('M'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rinse-dental/open-dental",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.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",
|
|
@@ -15,16 +15,15 @@
|
|
|
15
15
|
"url": "git+https://github.com/getrinsed/open-dental.git"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"axios": "^1.
|
|
19
|
-
"moment-timezone": "^0.6.0"
|
|
20
|
-
"firebase-admin": "^13.4.0"
|
|
18
|
+
"axios": "^1.13.2",
|
|
19
|
+
"moment-timezone": "^0.6.0"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
|
-
"@types/jest": "^
|
|
24
|
-
"@types/node": "^
|
|
25
|
-
"jest": "^
|
|
26
|
-
"prettier": "^3.
|
|
27
|
-
"typescript": "^5.
|
|
22
|
+
"@types/jest": "^30.0.0",
|
|
23
|
+
"@types/node": "^24.10.1",
|
|
24
|
+
"jest": "^30.2.0",
|
|
25
|
+
"prettier": "^3.6.2",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
28
27
|
},
|
|
29
28
|
"scripts": {
|
|
30
29
|
"build": "tsc",
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Timestamp, DocumentReference } from 'firebase-admin/firestore';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Represents an visit in firebase.
|
|
5
3
|
* Transformer for appointment
|
|
@@ -7,7 +5,6 @@ import { Timestamp, DocumentReference } from 'firebase-admin/firestore';
|
|
|
7
5
|
export interface Visit {
|
|
8
6
|
serverDateTime?: string; // Server timestamp of the appointment; returned by some endpoints
|
|
9
7
|
AptNum?: number; // Unique identifier for the appointment
|
|
10
|
-
//docRef?: DocumentReference; // docRef of this visit.
|
|
11
8
|
PatNum?: number; // Unique identifier for the patient
|
|
12
9
|
AptStatus?: AptStatus; // Status of the appointment (Scheduled, Complete, etc.)
|
|
13
10
|
Pattern?: string; // Time pattern in 5-minute increments, e.g., "/XX/" for 20 minutes
|
|
@@ -48,13 +45,9 @@ export interface Visit {
|
|
|
48
45
|
status?: string; //
|
|
49
46
|
duration?: number; // pattern * 5
|
|
50
47
|
ProvNum?: number; // ProvNum or ProvHyg depending on IsHygiene
|
|
51
|
-
//ProviderDocRef?: DocumentReference; //
|
|
52
|
-
//VisitTypeDocRef?: DocumentReference; //
|
|
53
|
-
//OpDocRef?: DocumentReference; //
|
|
54
48
|
date?: string; //
|
|
55
49
|
dateTime?: string; //
|
|
56
50
|
unix?: number //
|
|
57
|
-
//firestoreTimestamp?: Timestamp; // admin.firestore.Timestamp.fromDate(moment_aptDateTime.toDate()),
|
|
58
51
|
date_formats?: Date_Formats; //
|
|
59
52
|
}
|
|
60
53
|
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import { Appointment } from '../types/appointmentTypes';
|
|
2
2
|
import { Visit } from '../transformerTypes/visitTypes';
|
|
3
3
|
import moment from 'moment-timezone';
|
|
4
|
-
import admin from 'firebase-admin';
|
|
5
|
-
import { Timestamp } from 'firebase-admin/firestore';
|
|
6
4
|
|
|
7
|
-
export function appointmentToVisit(apt: Appointment): Visit {
|
|
8
|
-
const db = admin.firestore();
|
|
9
|
-
|
|
5
|
+
export function appointmentToVisit(apt: Appointment): Visit {
|
|
10
6
|
|
|
11
7
|
const moment_aptDateTime = moment.tz(apt.AptDateTime, 'YYYY-MM-DD HH:mm:ss', 'America/Los_Angeles');
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
let firestoreTimestamp: Timestamp | undefined;
|
|
15
|
-
if (moment_aptDateTime.isValid()) {
|
|
16
|
-
//firestoreTimestamp = Timestamp.fromDate(moment_aptDateTime.toDate());
|
|
17
|
-
} else {
|
|
18
|
-
console.warn(`Invalid AptDateTime: "${apt.AptDateTime}"`);
|
|
19
|
-
}
|
|
20
|
-
*/
|
|
21
8
|
|
|
22
9
|
const duration = (apt.Pattern?.length || 0) * 5;
|
|
23
10
|
const location = 'NF6YVFAXyRVXGi5nItqV';
|
|
@@ -25,7 +12,6 @@ export function appointmentToVisit(apt: Appointment): Visit {
|
|
|
25
12
|
const AptTypeNum = apt.AppointmentTypeNum == 0 ? updateAptTypeNum(apt.ProcDescript ?? '') : apt.AppointmentTypeNum;
|
|
26
13
|
|
|
27
14
|
return {
|
|
28
|
-
//docRef: db.doc(`/patients/${apt.PatNum}/patientVisits/${apt.AptNum}`),
|
|
29
15
|
...apt,
|
|
30
16
|
TimeLocked: apt.TimeLocked === 'true',
|
|
31
17
|
IsHygiene: apt.IsHygiene == 'true',
|
|
@@ -34,13 +20,9 @@ export function appointmentToVisit(apt: Appointment): Visit {
|
|
|
34
20
|
status: normalizeStatus(apt.AptStatus),
|
|
35
21
|
duration: duration,
|
|
36
22
|
ProvNum: display_ProvNum,
|
|
37
|
-
//ProviderDocRef: display_ProvNum != 0 ? db.doc(`/providers/${display_ProvNum}`) : undefined,
|
|
38
|
-
//VisitTypeDocRef: db.doc(`/lookups/lookup_definitions/lookup_visitType/${AptTypeNum}`),
|
|
39
|
-
//OpDocRef: apt.Op != 0 ? db.doc(`/locations/${location}/locationOperatories/${apt.Op}`) : undefined,
|
|
40
23
|
date: moment_aptDateTime.format('YYYY-MM-DD'),
|
|
41
24
|
dateTime: moment_aptDateTime.format(),
|
|
42
25
|
unix: moment_aptDateTime.unix(),
|
|
43
|
-
//firestoreTimestamp: firestoreTimestamp,
|
|
44
26
|
date_formats: {
|
|
45
27
|
date_MMM_D: moment_aptDateTime.format('MMM D'),
|
|
46
28
|
month_M: moment_aptDateTime.format('M'),
|