-
Notifications
You must be signed in to change notification settings - Fork 14
Database Schema
J Delaney edited this page Feb 11, 2015
·
18 revisions
-
companyName:
String
-
username:
String
-
password:
String
-
email:
String
-
phone:
String
-
logo:
String
path to image file -
walkins:
Boolean
-
business:
ObjectId
-
email:
String
-
fname:
String
(optional) -
lname:
String
(optional) -
password:
String
-
registerToken:
String
(optional) When a business first adds an employee a token is generated for them. They're sent a link with this token attached to it.
-
business:
ObjectId
-
employee:
ObjectId
-
date:
Date
-
fname:
String
-
lname:
String
-
email:
String
-
state:
String
see states for possible values -
confirmationCode:
String
- scheduled: The person has an appointment in the future but has not yet shown up in the office.
- formDone: The person has completed the custom form by the office and only needs a signature to finish checking in.
- checkedIn: The person has finished the custom form by the office and has signed the disclosure agreement. Their form response can now be viewed and they are ready to be roomed.
- roomed: The patient is now in a room. After this point, we don't really care about them.
-
business:
ObjectId
-
fields:
[fieldObject]
an array of embedded documents following thefieldObject
schema specified below. Order of the array reflects order of the fields.
-
type:
String
can be either "textfield" or "dropdown" -
label:
String
-
options:
[String]
(optional) Only for "dropdown" fields. The list of options for the dropdown.
-
employee:
ObjectId
-
appointment:
ObjectId
-
answers:
[answerObject]
an array of embedded documents following the `answerObject schema specified below. Order of the array reflects order of the fields.
-
label:
String
-
response:
String
Since the forms
and formResponses
collection are a bit complex here is an example to help clarify. Pretend we are trying to encode the form shown here. The form collection would look like:
{
business: ObjectId("948943204910"),
fields: [
{
type: "textbox",
label: "Name"
},
{
type: "dropdown",
label: "Gender",
options: ["Male", "Female"]
},
{
type: "textbox",
label: "Email"
},
{
type: "dropdown",
label: "Favorite Color",
options: ["Blue", "Yellow", "Green", "Pink"]
}
]
}
An example response would look like:
{
employee: ObjectId("9585938934"),
appointment: ObjectId("438398498294"),
answers: [
{
label: "Name",
response: "John Doe"
},
{
label: "Gender",
response: "Female"
},
{
label: "Email",
response: "john.doe@example.com"
},
{
label: "Favorite Color",
response: "Blue"
}
]
}