-
Notifications
You must be signed in to change notification settings - Fork 0
/
recordSeed.js
97 lines (95 loc) · 3.39 KB
/
recordSeed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const mongoose = require("mongoose"),
Record = require("./models/record");
mongoose.Promise = global.Promise;
mongoose.connect(
process.env.MONGODB_URI || "mongodb://localhost:27017/docucare",
{ useNewUrlParser: true }
);
Record.remove({})
.then(() => {
return Record.create({
date: new Date('May 18, 2021 08:00:00'),
problem: "Left knee pain",
status: "Checked out",
patient: "60ae749dc8fbba000a7309aa",
provider: "60ae74a467f70000156bdc12",
hpi: "Erika presents today for left knee pain.",
ros: "She denies any numbness or tingling.",
exam: "She is tender over the medial joint line."
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.then(() => {
return Record.create({
date: new Date('Apr 5, 2021 08:00:00'),
problem: "Right ankle sprain",
patient: "60ae749dc8fbba000a7309aa",
provider: "60ae74a467f70000156bdc12",
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.then(() => {
return Record.create({
date: new Date('Feb 16, 2021 08:00:00'),
problem: "Dizziness",
patient: "60ae749dc8fbba000a7309aa",
provider: "60ae74a467f70000156bdc12",
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.then(() => {
return Record.create({
date: new Date('May 18, 2021 09:00:00'),
status: "Checked out",
problem: "Depression",
patient: "60ae749dc8fbba000a7309ab",
provider: "60ae74a467f70000156bdc12",
hpi: "Paul presents today for depression.",
ros: "He admits fatigue. He denies any changes in apetite.",
exam: "He has a flat affect."
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.then(() => {
return Record.create({
date: new Date('May 18, 2021 10:00:00'),
status: "Waiting",
problem: "Headaches",
patient: "60ae749ec8fbba000a7309ac",
provider: "60ae74a467f70000156bdc12"
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.then(() => {
return Record.create({
date: new Date('May 18, 2021 11:00:00'),
status: "Ready",
problem: "Cough",
patient: "60ae749ec8fbba000a7309ad",
provider: "60ae74a467f70000156bdc12"
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.then(() => {
return Record.create({
date: new Date('May 18, 2021 12:00:00'),
problem: "Chest pain",
patient: "60ae749ec8fbba000a7309ae",
provider: "60ae74a467f70000156bdc12"
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.then(() => {
return Record.create({
date: new Date('May 18, 2021 13:00:00'),
problem: "Nausea",
patient: "60ae749ec8fbba000a7309af",
provider: "60ae74a467f70000156bdc12"
});
})
.then(record => console.log(`${record.patient}, ${record.date}`))
.catch(error => console.log(error.message))
.then(() => {
console.log("DONE");
mongoose.connection.close();
});