Csc 8711, Databases and the Web - Project 4
Due: Sunday, March 31stIndividual Assignment.
jsoniq, OpenAPI , MongoDB, Python
I. JSONIQ PROBLEM
Consider the JSON document related to movies available at movie.json. Write JSONIQ expressions to answer the following queries (name the query files ma.jq, mb.jq, etc):- Get the title and years of movies in the Crime genre.
- Get the names of persons who have acted in a movie and have directed it as well.
- Get the title and years of movies in which James Caan has acted.
- Get the names of performers and the number of movies in which they have acted.
- Get the names of performers who have acted in at least 10 movies and directed at least 2 movies.
- Get the names of the youngest performers.
- Get the names of the performers who have directed some actor who is older than they are.
II. MONGODB QUERIES IN PYTHON PROBLEM
Consider the mongodb collections related to movies available at movie.js. Write pymongo programs to answer the above queries; name the programs ma.py, mb.py, etc. The programs should print the answers to the queries when run.III. OPENAPI , MONGODB, PYTHON PROJECT
In this project, you will specify (using OpenAPI) AND build REST Web services (using Python Flask). MongoDB will be used as the back-end. The Web services will be used by an application that implements an appointment tracker for a clinic. You do not have to build the client GUI in this project; only the Web services. The following three collections will be used in MongoDB:- physicians: will store information about all physicians in the clinic. The
format of one individual physician is:
{ physicianID: 100, lname: "Broderick", fname: "John", speciality: "Internal Medicine" }
You should populate this collection with several physicians with different specialities. You can use consecutive physicianIDs starting with 100. - patients: will store information about all patients in the clinic. The
format of one individual patient is:
{ patientID: 1000, lname: "Jones", fname: "Jacob", email: "jjones@gmail.com", phone: { mobile: "777-8888", home: "111-1234", office: "111-2121" }, address: { address: "123 Main Street", city: "Atlanta", state: "GA", zip: "30303" } }
Initially you can populate the collection with two patients. patientIDs should be consecutive numbers starting with 1000. - appointments: will store information about appointments. The format of
an appointment is:
{ appointmentID: "1", physicianID: 100, patientID: 1000, date: "12-10-2018", time: "10:00", type: "new patient" }
appointmentID is generated by the system starting with 1. date should be a string with format MM-DD-YYYY and time should be military time such as HH:MM, e.g. 14:30 would be 2.30 pm and 09:30 would be 9.30 am. type would be one of two strings: "new patient", "regular patient". All appointments will begin at half hour intervals between 09:00 and 17:00. Also, your system should not allow more than 2 appointments at the same time with the same physician.
Routes to implement for the Web Services:
GET /physicians should return all physicians GET /physicians/Internal%20Medicine GET /physicians/Cardiology should return all physicians with given speciality. ----------------------------------------- GET /patients should return all patients POST /patients should add a new patient input json: fname, lname, address, phone generate patientID automatically by finding max patientID and adding 1. PUT /patients allows update of address, phone numbers ----------------------------------------- GET /appointments/physicianID should return all appointments given a physicianID GET /appointments/physicianID/MM-DD-YYYY should return all appointments given a physicianID and a date POST /appointments input JSON: physicianID, patientID, date, time, patient type DELETE /appointments/appointmentID delete the appointment with given appointmentID
Deliverables:
- Swagger/OpenAPI specifications for Web servcies.
- Python/Flask implementation of the services