Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const patientSchema = new Schema({
- firstName: {type: String, required: true},
- lastName: {type: String, required: true},
- address: {type: String, required: true},
- address2: {type: String},
- city: {type: String, required: true},
- state: {type: String, required: true},
- zip: {type: String, required: true},
- preferredLanguage: {type: String, required: true},
- medicalCond: {type: String, required: true},
- medication: {type: String},
- allergies: {type: String},
- notes: {type: String},
- primaryCareName: {type: String},
- primaryCareNumber: {type: String},
- contactFirstName: {type: String, required: true},
- contactLastName: {type: String, required: true},
- contactRelationship: {type: String, required: true},
- contactNumb: {type: String, required: true}
- });
- const caretakerSchema = new Schema({
- username: {type: String, unique: true, required: true},
- password: {type: String, required: true},
- phoneNumb: {type: String, required: true},
- local: {
- username: {type: String, unique: true},
- password: {type: String, unique: true}
- },
- patient: [{
- type: Schema.Types.ObjectId,
- ref: "Patient"
- }]
- });
- findById: function(req, res) {
- db.Caretaker
- .findOne({_id: req.params.id})
- .populate("patient")
- .then(dbModel => res.json(dbModel))
- .catch(err => res.status(422).json(err));
- }
Add Comment
Please, Sign In to add comment