Coder Social home page Coder Social logo

hospital-management-system's Introduction

Hospital-Management-System


This is a project made using Node.js , Express.js , MongoDB and Mongoose. The main AIM of this project was to connect all the pages using express.js and execute different queries.

We have 7 buttons in Home Page. If the Patient is suffering from some common disease and is not serious, then he/she is taken to OPD. If the person is serious and needs to be admitted, then he/she is taken to Casualty-Department.

IN OPD, the person is supposed to fill the details and according to the symtoms, he/she is assigned a particular doctor.All these details are stored in MongoDB.Then, the patient is send to the particular department and if treated, the ACTIVE mark is set to false. Else, ACTIVE is set to false.Similarly, ADMITTED and DEATH mark is set.

IN CASUALTY-DEPARTMENT, again the details are entered and stored in Database. The main difference between the OPD and CASUALTY is, in Casualty department, patient is directly admitted with the fees of 200 while in OPD, patient can be treated with the fees of 100 but if he/she is serious, then the patient is admitted and a extra fees of Rs.100 is charged.

We can Register new Doctors.

we can see the Details of Patient and Doctors and Update/Delete them.

Finally, we can see the stats.


Mongoose function :

  1. Find() :
await Doctor.find({symtoms:sym})
  1. FindAndUpdate() :
await Doctor.findByIdAndUpdate(data[0]._id,data[0])
  1. FindById():
await OpdSchema.findById(req.params.id)
  1. Sort():
const displayOpdPatient =await OpdSchema.find().sort({name:1});
  1. FindByIdAndDelete():
const result=await OpdSchema.findByIdAndDelete(req.params.id)
  1. Aggregate() with $match:
//doctors whose earning is greater than 1000   
let docs = await Doctor.aggregate([{ $match: filter }]);
  1. Aggregate() with $group:
//sum of Patients wrt age  
    let docs1_a = await OpdSchema.aggregate([{$group: {_id: '$age',count: { $sum: 1 }}}])  
    let docs1_b = await CasualtySchema.aggregate([{$group: {_id: '$age', count: { $sum: 1 } } }])
  1. Aggregate to find total earning of all doctors
    //sum of earning of all doctors  
    let docs2 = await Doctor.aggregate([
        {$group: {
            _id: 'total',
            total: {$sum:'$earning'}
        }
    }])
  1. Aggregate() with $group, $sort, $project :
//All the doctors  
    let docs3 = await Doctor.aggregate([
        {$group: {_id: '$_id',name:{"$first":'$name'}}},
        {$sort: {"name":1}},
        {$project:{"_id":0}}
    ])  

Home page:

image

AddOpdPatient:

image

SubmitOpdPatient

image

Opd-treated

image

Opd-admit

image

Opd-death

image

AddCasualtyPatient

image

SubmitCasultyPatient

image

Casualty-death

image

AddDoctor

image

ShowPatient

image

ShowDoctor

image

Statistics

image

hospital-management-system's People

Contributors

yash14agr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.