-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
670 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import mongoose from "mongoose"; | ||
|
||
export interface BookedAppointment extends mongoose.Document { | ||
date: string; | ||
timing: string; | ||
state: string; | ||
city: string; | ||
hospital: { | ||
id: mongoose.Schema.Types.ObjectId; | ||
name: string; | ||
}; | ||
disease: string; | ||
note: string; | ||
approved: string; | ||
patient_id: mongoose.Schema.Types.ObjectId; | ||
doctor_id: mongoose.Schema.Types.ObjectId; | ||
receptionist_id: mongoose.Schema.Types.ObjectId; | ||
} | ||
|
||
const bookedAppointmentsSchema = new mongoose.Schema( | ||
{ | ||
_id: { type: mongoose.Schema.Types.ObjectId, required: true }, | ||
date: { type: Date, required: true }, | ||
timing: { type: String, required: false }, | ||
state: { type: String, required: true }, | ||
city: { type: String, required: true }, | ||
hospital: { | ||
id: { type: mongoose.Schema.Types.ObjectId, required: true }, | ||
name: { type: String, required: true }, | ||
}, | ||
disease: { type: String, required: true }, | ||
note: { type: String, required: true }, | ||
approved: { | ||
type: String, | ||
enum: ["pending", "approved", "rejected"], | ||
default: "pending", | ||
}, | ||
patient_id: { type: mongoose.Schema.Types.ObjectId, required: true }, | ||
doctor_id: { type: mongoose.Schema.Types.ObjectId }, | ||
receptionist_id: { type: mongoose.Schema.Types.ObjectId }, | ||
}, | ||
{ collection: "bookedAppointments" } | ||
); | ||
|
||
export default mongoose.models.BookedAppointment || | ||
mongoose.model<BookedAppointment>( | ||
"BookedAppointment", | ||
bookedAppointmentsSchema | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import mongoose from "mongoose"; | ||
|
||
export interface CommonDiseases extends mongoose.Document { | ||
commonDiseases: [String]; | ||
} | ||
|
||
const diseaseSchema = new mongoose.Schema( | ||
{ | ||
_id: { type: mongoose.Schema.Types.ObjectId, required: true }, | ||
commonDiseases: [String], | ||
}, | ||
{ | ||
collection: "commonDiseases", | ||
} | ||
); | ||
|
||
export default mongoose.models.CommonDiseases || | ||
mongoose.model<CommonDiseases>("CommonDiseases", diseaseSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import mongoose from "mongoose"; | ||
|
||
export interface Doctor extends mongoose.Document { | ||
firstname: string; | ||
lastname: string; | ||
username: string; | ||
email: string; | ||
password: string; | ||
role: string; | ||
otp: string; | ||
dob: string; | ||
gender: string; | ||
contact: string; | ||
profile: string; | ||
address: { | ||
address_line_1: string; | ||
address_line_2: string; | ||
city: string; | ||
state: string; | ||
country: string; | ||
zip_code: string; | ||
}; | ||
current_hospital: mongoose.Schema.Types.ObjectId; | ||
specialty: string; | ||
patients: []; | ||
} | ||
|
||
const addressSchema = new mongoose.Schema({ | ||
address_line_1: String, | ||
address_line_2: String, | ||
city: String, | ||
state: String, | ||
country: String, | ||
zip_code: String, | ||
}); | ||
|
||
const doctorSchema = new mongoose.Schema( | ||
{ | ||
_id: { type: mongoose.Schema.Types.ObjectId, required: true }, | ||
firstname: { | ||
type: String, | ||
required: true, | ||
}, | ||
lastname: { | ||
type: String, | ||
required: true, | ||
}, | ||
username: { | ||
type: String, | ||
required: true, | ||
unique: true, | ||
}, | ||
email: { | ||
type: String, | ||
required: true, | ||
unique: true, | ||
}, | ||
password: { | ||
type: String, | ||
required: true, | ||
}, | ||
role: { | ||
type: String, | ||
default: "doctor", | ||
}, | ||
otp: String, | ||
dob: { | ||
type: Date, | ||
required: false, | ||
}, | ||
gender: { | ||
type: String, | ||
enum: ["Male", "Female", "Other"], | ||
required: false, | ||
}, | ||
contact: { | ||
type: String, | ||
required: true, | ||
}, | ||
profile: { | ||
type: String, | ||
}, | ||
address: addressSchema, | ||
current_hospital: { | ||
type: mongoose.Schema.Types.ObjectId, | ||
ref: "Hospital", | ||
}, | ||
specialty: { | ||
type: String, | ||
required: true, | ||
}, | ||
patients: [ | ||
{ | ||
type: mongoose.Schema.Types.ObjectId, | ||
ref: "Patient", | ||
}, | ||
], | ||
}, | ||
{ | ||
collection: "doctor", | ||
} | ||
); | ||
|
||
export default mongoose.models.Doctor || | ||
mongoose.model<Doctor>("Doctor", doctorSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import mongoose from "mongoose"; | ||
|
||
export interface Hospital extends mongoose.Document { | ||
firstname: string; | ||
lastname: string; | ||
username: string; | ||
email: string; | ||
password: string; | ||
role: string; | ||
otp: string; | ||
dob: string; | ||
gender: string; | ||
contact: string; | ||
profile: string; | ||
address: { | ||
address_line_1: string; | ||
address_line_2: string; | ||
city: string; | ||
state: string; | ||
country: string; | ||
zip_code: string; | ||
}; | ||
patients: []; | ||
doctors: []; | ||
receptionists: []; | ||
} | ||
|
||
const hospitalSchema = new mongoose.Schema( | ||
{ | ||
_id: { type: mongoose.Schema.Types.ObjectId, required: true }, | ||
firstname: { | ||
type: String, | ||
required: true, | ||
}, | ||
lastname: { | ||
type: String, | ||
required: true, | ||
}, | ||
username: { | ||
type: String, | ||
required: true, | ||
unique: true, | ||
}, | ||
email: { | ||
type: String, | ||
required: true, | ||
unique: true, | ||
}, | ||
password: { | ||
type: String, | ||
required: true, | ||
}, | ||
role: { | ||
type: String, | ||
default: "hospital", | ||
}, | ||
otp: { | ||
type: String, | ||
}, | ||
contact: { | ||
type: String, | ||
required: true, | ||
}, | ||
profile: { | ||
type: String, | ||
}, | ||
address: { | ||
address_line_1: { | ||
type: String, | ||
required: true, | ||
}, | ||
address_line_2: { | ||
type: String, | ||
}, | ||
city: { | ||
type: String, | ||
required: true, | ||
}, | ||
state: { | ||
type: String, | ||
required: true, | ||
}, | ||
country: { | ||
type: String, | ||
required: true, | ||
}, | ||
zip_code: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
patients: [ | ||
{ | ||
type: mongoose.Schema.Types.ObjectId, | ||
ref: "Patient", | ||
}, | ||
], | ||
doctors: [ | ||
{ | ||
type: mongoose.Schema.Types.ObjectId, | ||
ref: "Doctor", | ||
}, | ||
], | ||
receptionists: [ | ||
{ | ||
type: mongoose.Schema.Types.ObjectId, | ||
ref: "Receptionist", | ||
}, | ||
], | ||
}, | ||
|
||
{ | ||
collection: "hospital", | ||
} | ||
); | ||
|
||
export default mongoose.models.Hospital || | ||
mongoose.model<Hospital>("Hospital", hospitalSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// import mongoose from "mongoose"; | ||
|
||
// export interface CityStateHospital extends mongoose.Document { | ||
// State: { | ||
// City: [ | ||
// { | ||
// hospital_id: null; | ||
// hospital_name: "Apollo Hospitals"; | ||
// appointment_charge: "250"; | ||
// }, | ||
// { | ||
// hospital_id: null; | ||
// hospital_name: "Yashoda Hospitals"; | ||
// appointment_charge: "250"; | ||
// }, | ||
// { | ||
// hospital_id: null; | ||
// hospital_name: "KIMS Hospitals"; | ||
// appointment_charge: "250"; | ||
// }, | ||
// { | ||
// hospital_id: null; | ||
// hospital_name: "Continental Hospitals"; | ||
// appointment_charge: "250"; | ||
// }, | ||
// { | ||
// hospital_id: null; | ||
// hospital_name: "Sunshine Hospitals"; | ||
// appointment_charge: "250"; | ||
// } | ||
// ]; | ||
// }; | ||
// } | ||
|
||
// const hospitalsDataSchema = new mongoose.Schema({ | ||
// hospital_id: String, | ||
// hospital_name: { type: String, required: true }, | ||
// appointment_charge: { type: String, required: true }, | ||
// }); | ||
|
||
// const cityStateSchema = new mongoose.Schema( | ||
// { | ||
// _id: { type: mongoose.Schema.Types.ObjectId, required: true }, | ||
// state: String, | ||
// cities: [ | ||
// { | ||
// city_name: { type: String, required: true }, | ||
// hospitals: [hospitalsDataSchema], | ||
// }, | ||
// ], | ||
// }, | ||
// { | ||
// collection: "citystate_hospitals", | ||
// } | ||
// ); | ||
|
||
// const HospitalsData = mongoose.model("HospitalsData", cityStateSchema); | ||
|
||
// export default HospitalsData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import BookedAppointment from "./BookedAppointment"; | ||
import CommonDiseases from "./CommonDisease"; | ||
// import Doctor from "./Doctor"; | ||
// import Hospital from "./Hospital"; | ||
// import HospitalsData from "./HospitalsData"; | ||
// import MedicalHistory from "./MedicalHistory"; | ||
import Patient from "./patient"; | ||
// import Receptionist from "./Receptionist"; | ||
// import Transaction from "./Transaction"; | ||
// import UserLog from "./UserLog"; | ||
|
||
export { | ||
BookedAppointment, | ||
CommonDiseases, | ||
// Doctor, | ||
// Hospital, | ||
// HospitalsData, | ||
// MedicalHistory, | ||
Patient, | ||
// Receptionist, | ||
// Transaction, | ||
// UserLog, | ||
}; |
Oops, something went wrong.