Skip to content

Back End (Node.js, JS, BetterDoctor API): iOS app that connects users with health care facilities based on their preferred location and health insurance provider.

License

Notifications You must be signed in to change notification settings

MoneyCashNodes/RestInsured-API

Repository files navigation

cf Rest Insured

Coverage Status Build Status

MoneyCacheNodes Team

Abigail White Ben Ayzenberg Enrique Rico Kayla Asay
Abigail White Ben Ayzenberg Enrique Rico Kayla Asay

Application Summary

"Rest Insured" is an iOS app that connects users with health care facilities based on their preferred location and health insurance provider. The code for iOS front-end development can be accessed in the Rest Insured repository. This current repository provides the back-end code for the application, created using JavaScript and Node.js.

This application is intended for educational purposes only. This project does not maintain user medical records with respect to health care needs or preferences. This app does not persist records of previous health care appointments or illness.

Functionality

  • Connect users with medical facilities that accept their insurance, based on user input of location and insurance provider.
  • Utilize registered user functionality to access app functionality

Structure and Resources

  • This app was structured using MVC (Model-View-Controller) architecture.
  • This project is deployed on Heroku using staging and production environments.
  • The primary resources utilized in this project are Node.js, Mongo DB, Mocha/ Chai, and Express Middleware.

Overview

Minimum Viable Product

  • Registered user takes in full name, email, location, provider, password info
    • Password hashed so the password is never stored in plain text
  • Input of provider info and location
    • User location
    • Range of query
    • Insurance provider name
  • Output of medical institutions (dental, pharmacy, doctors) that accept insurance.
    • Visualization: interactive pins on a map AND listed information beneath map
  • Provided info includes:
    • Doctor
    • Phone number
    • Name
    • Practice
    • Practice name
    • Insurance providers accepted (list)
    • Practice phone number
    • Specialty
    • Location

Future Opportunities

  • Filter requests to api by “specialty”
  • Book appointments functionality
  • Calendar notifications of appointment
  • Unregistered user functionality to access query and map functionality

Resources

Team Collaboration Tools

  • GitHub Projects/ Organization
  • Google Docs for larger overview, daily stand-ups
  • Slack for basic communication

API Endpoints

Deployed endpoint: https://rest-insured-production.herokuapp.com

Note: Application requests will be unsuccessful without essential environment variables.

Install Node Packages

  1. First, npm i to download all resources onto the local machine.
  2. In terminal, run files using nodemon server.

Create and Modify User

Objective: Create, retrieve, modify, and delete user account info from MongoDB.

Enter into terminal window:

  1. Create Account:
  • Template: http POST https://rest-insured-production.herokuapp.com/signup <fullName>=<input> <email>=<input> <password>=<input> <insurance>=<input>
  • Example: http POST https://rest-insured-production.herokuapp.com/api/signin fullName=abigail email=abs@white.com password=1234 insurance=aetna
  1. Fetch Account:
  • Template: http GET https://rest-insured-production.herokuapp.com/signin -a <email>:<password>
  • Example: http GET https://rest-insured-production.herokuapp.com/api/signin -a abswhite:1234
  1. Update Account:
  • Template: http PUT https://rest-insured-production.herokuapp.com/update/<user-id> <key>:<changed value> 'Authorization:Bearer <token>'
  • Example: http PUT https://rest-insured-production.herokuapp.com/update/1093982398738957329857 <fullName>:<abbi> 'Authorization:Bearer <token>'
  1. Delete Account:
  • Template: http DELETE https://rest-insured-production.herokuapp.com/delete/<user-id> 'Authorization:Bearer <token>'
  • Example: http DELETE https://rest-insured-production.herokuapp.com/update/1093982398738957329857 'Authorization:Bearer <token>'

Doctor and Practice Retrieval

Objective: Fetch provider information based on Location and Insurance Provider input.

  • Further documentation found at Better Doctor API:
  • Utilize http://api.betterdoctor.com as basis for request endpoints.
  1. API URL Request Retrieved from External API:
http GET https://api.betterdoctor.com/2016-03-01/doctors?insurance_uid=${req.query.insurance}&location=${req.query.lat}%2C${req.query.lon}%2C${req.query.range}&limit=5&user_key=${process.env.user_key}
  1. API URL Sent to iOS Front-End (example):
http GET https://rest-insured-staging.herokuapp.com/ext/doctors?lat=47.606&lon=-122.332&range=10&insurance=regenceblueshieldofwashinton-regencewapreferredprovidernetwork 'Authorization:Bearer <token>'

Sample JSON Data Output

Example of data output from API request

{
  "Providers": [
    {
      "Practice" : {
        "Name" : "Good Doctors",
        "phone" : "1111111111",
        "uid" : "1234uiid576851234",
        "lat" : 47.635867,
        "long" : -122.281694,
        "state": "WA",
        "state_long": "Washington",
        "street": "821 Saint Helena Hwy S",
        "zip": "98116",
        "accepts_new_patients": true,
        "Doctors" : [
          {
            "Doctor Name" : "Adam Scott",
            "Specialty" : "cardiologist"
          }
        ]
      }
    }
  ]
}

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Thank you to Adam Wallraff, Scott Schmidt, Thomas Martinez, Devon Hackley, Erica Winberry, and many others for guidance and assistance throughout the project.

About

Back End (Node.js, JS, BetterDoctor API): iOS app that connects users with health care facilities based on their preferred location and health insurance provider.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •