Skip to content

It's an API for the doctors of a Hospital which can be used for testing and quarantine + well being of COVID-19 patients

Notifications You must be signed in to change notification settings

Debashish-22/hospital_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hospital_API

It's an API for the doctors of a Hospital which can be used for testing and quarantine + well being of COVID-19 patients.

Demonstartion

Demonstration video link

Tech-Stack

Installation Guide

Install NodeJS and MongoDB on your system.

Install or open Postman.

on terminal write:

npm install 
npm start

Open Postman application to test below routes...

API References

Reference Method Purpose Protected
/doctors/register POST register new doctor with doctorName and password No
/doctors/login POST login with doctorName and password returns a JWT token No
/patients/register POST register new patient with patientName and phone Yes
/patients/:id/create_report POST create report of patient with status Yes
/patients/:id/all_reports GET List all the reports of a patient oldest to latest Yes
/reports/:status GET List all the reports of all the patients filtered by a specific status Yes

Notes and Examples

  • report will have following fields: "patient_id", "createdBy", "status", "date".

  • status can be either of : ["Negative", "Travelled-Quarantine", "Symptoms-Quarantine", "Positive-Admit"].

  • /patients/:id/create_report we have to provide only status, rest fields will be automatically filled.

  • Testing /patients/:id/create_report and creating patient_report using postman:-

    Route:- localhost:8000/patients/625300be52bf3e46f5501bd3/create_report
    
    Body > raw:-
    {
    "status": "Positive-Admit"
    }
    
    output:-
    {
     "message": "Report created successfully!",
     "report": {
         "patient_id": "625300be52bf3e46f5501bd3",
         "createdBy": "debashish",
         "status": "Positive-Admit",
         "date": "10-4-2022",
         "_id": "625300ea52bf3e46f5501bd7",
         "createdAt": "2022-04-10T16:08:10.821Z",
         "updatedAt": "2022-04-10T16:08:10.821Z",
         "__v": 0
      }
    }
    
  • For detailed routes testing follow video link.

Folder Structure

  • app.js - Entry point of our application. This file defines our express server.
  • config - This folder contains configuration of Mongoose(schema and model), passport-jwt (for jwt authentication).
  • controllers - This folder contains various functions to be executed when called through routes.
  • models - This folder contains schema definition of our mongoose models.
  • routes - This folder contains all the routes for our API.

About

It's an API for the doctors of a Hospital which can be used for testing and quarantine + well being of COVID-19 patients

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published