-
Notifications
You must be signed in to change notification settings - Fork 14
Database Schema
Giovanni wong edited this page Mar 15, 2015
·
18 revisions
Note that every document has a unique field called _id
used to identify it.
-
companyName:
String
-
disclosure:
String
-
fname:
String
-
lname:
String
-
email:
String
-
telephone:
String
-
logo:
String
(optional) path to image file -
style:
Style Object
-
buttonBgColor:
String
Hex color code (e.g. "#F0F0F0") -
buttonTextColor:
String
Hex color code (e.g. "#F0F0F0") -
containerBgColor:
String
Hex color code (e.g. "#F0F0F0F0"). Contains alpha value. -
containerFontColor:
String
Hex color code (e.g. "#F0F0F0F0"). Contains alpha value.
-
business:
ObjectId
-
employee:
ObjectId
Employee who authorized this device -
name:
String
Note: The _id
acts as the auth token
-
business:
ObjectId
-
email:
String
-
fname:
String
(optional) -
lname:
String
(optional) -
password:
String
-
phone:
String
Format is 1234567890, does not include dashes. -
isAdmin:
Boolean
-
smsNotify:
Boolean
-
emailNotify:
Boolean
-
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
-
dob:
String
(must be in MM/DD/YYYY format. If user inputs single digit MM or DD, 0 will be added for them) -
email:
String
-
state:
String
see states for possible values -
confirmationCode:
String
-
admin::
Boolean
- 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.
- done: The patient's appointment is over. 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: "textfield",
label: "Name"
},
{
type: "dropdown",
label: "Gender",
options: ["Male", "Female"]
},
{
type: "textfield",
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"
}
]
}