BookMD 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/BookMD/version.rb +1 -1
- data/lib/bookMD2.rb +28 -103
- data/lib/patients.txt +18 -0
- data/lib/user.rb +25 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6170956a00e5e543ce4517e6c4bdc7d82449f842ff89a61c2694466b48c407bf
|
4
|
+
data.tar.gz: 67631bf7c1b070e24fc949f99e6dc141f971bafb0fa7832c94ffb57c810d7042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9387d2ca7eb24d1cdc9892faeaba6a1e0270c59043f2f1697323cb315596174418d7420687e7098b86214b3a5699e4aaa603cb407803ec9a8f1cced326615f9e
|
7
|
+
data.tar.gz: cc78eaa5165a205a259584131b276c3405437799bcd2ef43a3cf7273b2bffe5e14eee18a2bc224db2f1291219fd7afd0b7826111a54e0554de9f8e2ff563e63e
|
data/.DS_Store
CHANGED
Binary file
|
data/lib/.DS_Store
CHANGED
Binary file
|
data/lib/BookMD/version.rb
CHANGED
data/lib/bookMD2.rb
CHANGED
@@ -31,12 +31,12 @@ def day_select
|
|
31
31
|
|
32
32
|
case
|
33
33
|
when day_choice == 'Monday'
|
34
|
+
dr_selection
|
34
35
|
mon_time_selection
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
38
39
|
|
39
|
-
|
40
40
|
def mon_time_selection
|
41
41
|
prompt = TTY::Prompt.new
|
42
42
|
choices = %w("8.30" "9.00")
|
@@ -46,104 +46,14 @@ time_choice = prompt.multi_select("Select time", choices)
|
|
46
46
|
end
|
47
47
|
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
#
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
# mondaytimes.render(:ascii)
|
59
|
-
# end
|
60
|
-
|
61
|
-
|
62
|
-
# def monday_appointments
|
63
|
-
# prompt = TTY::Prompt.new
|
64
|
-
# monday_select = prompt.select("welcome to bookMD") do |menu|
|
65
|
-
# menu.choice 'Dr. Gregor 8.30am'
|
66
|
-
# menu.choice 'Dr. Gregor 11.30'
|
67
|
-
# menu.choice 'Dr. Helen Kouzmin 9.00am'
|
68
|
-
# menu.choice 'Dr. Helen Kouzmin 2.00pm'
|
69
|
-
# menu.choice 'Dr. Patrivk Chan 9.30am'
|
70
|
-
# menu.choice 'Dr. Patrivk Chan 3.00pm'
|
71
|
-
# menu.choice 'Back to week availability'
|
72
|
-
|
73
|
-
# end
|
74
|
-
|
75
|
-
# end
|
76
|
-
|
77
|
-
# def monday_selector
|
78
|
-
# monday_appointment = menu.choice
|
79
|
-
# # case
|
80
|
-
|
81
|
-
|
82
|
-
# # when monday_select == 'Dr. Gregor 8.30am'
|
83
|
-
|
84
|
-
# # when monday_select == 'Dr. Gregor 11.30'
|
85
|
-
# # appointment_time = 'Dr. Gregor 11.30'
|
86
|
-
|
87
|
-
# # when monday_select == 'Dr. Helen Kouzmin 2.00pm'
|
88
|
-
# # appointment_time = 'Dr. Helen Kouzmin 2.00'
|
89
|
-
# # when monday_select == 'Dr. Helen Kouzmin 9.00am'
|
90
|
-
# # print "9"
|
91
|
-
# # when monday_select == 'Dr. Patrivk Chan 9.30am'
|
92
|
-
# # print "kkj"
|
93
|
-
# # when monday_select == 'Dr. Patrivk Chan 3.00pm'
|
94
|
-
# # print "c 3"
|
95
|
-
# # when monday_select == 'Back to week availability'
|
96
|
-
# # system("clear")
|
97
|
-
# # print booking_info
|
98
|
-
# return menu.choice
|
99
|
-
# # end
|
100
|
-
# end
|
101
|
-
|
102
|
-
# def tuesday_display
|
103
|
-
# system("clear")
|
104
|
-
# tuesdaytimes = TTY::Table.new header:
|
105
|
-
|
106
|
-
# ['Dr. Gregor','Dr. Helen Kouzmin','Dr Kooray', 'Dr. Sade Weatley','Dr. Patrick Chan'], rows: [['9.30am', '10.00am','2.30pm','9.00am','10.00am'], ['1.30pm', '2.00pm','3.00pm','3.00pm ',' ']]
|
107
|
-
|
108
|
-
# tuesdaytimes.render(:ascii)
|
109
|
-
# end
|
110
|
-
|
111
|
-
# def tuesday_appointments
|
112
|
-
# prompt = TTY::Prompt.new
|
113
|
-
# tuesday_select = prompt.select("Tuesday Appointments - Scroll down to view all appointment availabilities") do |menu|
|
114
|
-
# menu.choice 'Dr. Gregor 9.30am'
|
115
|
-
# menu.choice 'Dr. Gregor 1.30'
|
116
|
-
# menu.choice 'Dr. Helen Kouzmin 10.00am'
|
117
|
-
# menu.choice 'Dr. Helen Kouzmin 2.00pm'
|
118
|
-
# menu.choice 'Dr. Lanka Kooray 2.30pm'
|
119
|
-
# menu.choice 'Dr. Lanka Kooray 3.00pm'
|
120
|
-
# menu.choice 'Dr. Sade Weatley 9.00am'
|
121
|
-
# menu.choice 'Dr. Sade Weatley 3.00pm'
|
122
|
-
# menu.choice 'Dr. Patrivk Chan 10.00am'
|
123
|
-
# menu.choice 'Back to week availability'
|
124
|
-
|
125
|
-
# end
|
126
|
-
# case
|
127
|
-
# when tuesday_select == 'Dr. Gregor 8.30am'
|
128
|
-
# print "greg"
|
129
|
-
# when tuesday_select== 'Dr. Gregor 8.90am'
|
130
|
-
# prompt = TTY::Prompt.new
|
131
|
-
# confirm = prompt.yes?('Confirm appointment 9.30?')
|
132
|
-
# when tuesday_select == 'Dr. Gregor 11.30'
|
133
|
-
# print "l"
|
134
|
-
# when tuesday_select == 'Dr. Helen Kouzmin 2.00pm'
|
135
|
-
# print "2"
|
136
|
-
# when tuesday_select == 'Dr. Helen Kouzmin 9.00am'
|
137
|
-
# print "9"
|
138
|
-
# when tuesday_select == 'Dr. Patrivk Chan 9.30am'
|
139
|
-
# print "kkj"
|
140
|
-
# when tuesday_select == 'Dr. Patrivk Chan 3.00pm'
|
141
|
-
# print "c 3"
|
142
|
-
# when tuesday_select == 'Back to week availability'
|
143
|
-
# system("clear")
|
144
|
-
# print booking_info
|
145
|
-
# end
|
146
|
-
# end
|
49
|
+
def dr_selection
|
50
|
+
prompt = TTY::Prompt.new
|
51
|
+
choices = %w('Dr.Gregor' 'Dr.Kouzmin' 'Dr.Kooray' 'Dr.Weatley' 'Dr.Chan')
|
52
|
+
dr_choice = prompt.multi_select("Select time", choices)
|
53
|
+
# return time_choice
|
54
|
+
|
55
|
+
return dr_choice
|
56
|
+
end
|
147
57
|
|
148
58
|
|
149
59
|
|
@@ -158,20 +68,35 @@ def start
|
|
158
68
|
end
|
159
69
|
|
160
70
|
|
161
|
-
|
162
71
|
start
|
163
72
|
case
|
164
73
|
when first_menu = 'book_appointment'
|
165
74
|
drs_info
|
166
75
|
day_select
|
167
|
-
when
|
76
|
+
when first_menu = 'manage_appointments'
|
168
77
|
puts "current appointments"
|
169
78
|
end
|
170
|
-
# return welcome
|
171
|
-
# end
|
172
79
|
|
173
80
|
|
174
81
|
|
82
|
+
class Appointments
|
83
|
+
def initialize
|
84
|
+
@your_appointments = {}
|
85
|
+
end
|
86
|
+
|
87
|
+
def add(key_value)
|
88
|
+
key_value.each do |key, value|
|
89
|
+
@your_appointments[key] = value
|
90
|
+
end
|
91
|
+
self
|
92
|
+
end
|
93
|
+
|
94
|
+
def keywords
|
95
|
+
@your_appointments.keywords
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
print @your_appointments
|
175
100
|
|
176
101
|
|
177
102
|
|
data/lib/patients.txt
CHANGED
@@ -22,3 +22,21 @@
|
|
22
22
|
|
23
23
|
{:Name=>"GEORGIA", :Phone=>"020202020", :Email=>"EMAIL", :Travel=>"N"}
|
24
24
|
|
25
|
+
{:Name=>"test", :Phone=>"test", :Email=>"test", :Travel=>"N"}
|
26
|
+
|
27
|
+
{:Name=>"", :Phone=>"", :Email=>"", :Travel=>""}
|
28
|
+
|
29
|
+
{:Name=>"testy", :Phone=>"testy", :Email=>"testy", :Travel=>"N"}
|
30
|
+
|
31
|
+
#<Patient:0x00007fa44c90d510>
|
32
|
+
|
33
|
+
N
|
34
|
+
|
35
|
+
#<Patient:0x00007fb88710aaf8>
|
36
|
+
|
37
|
+
#<Patient:0x00007fccf48fc6e0>
|
38
|
+
|
39
|
+
#<Patient:0x00007fc53687e418>
|
40
|
+
|
41
|
+
#<Patient:0x00007fb94f01e5e0>
|
42
|
+
|
data/lib/user.rb
CHANGED
@@ -1,21 +1,31 @@
|
|
1
|
+
class Patient
|
2
|
+
attr_accessor :name, :phone, :email, :travel
|
3
|
+
def initialize
|
4
|
+
@name = name
|
5
|
+
@phone = phone
|
6
|
+
@email = email
|
7
|
+
@travel = travel
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
1
11
|
|
2
12
|
def make_patient #this method makes a patient from user input in terminal
|
3
13
|
patients = {}
|
4
14
|
|
5
15
|
print "Name: "
|
6
|
-
name = gets.chomp
|
16
|
+
@name = gets.chomp
|
7
17
|
print "Phone: "
|
8
|
-
phone = gets.chomp
|
18
|
+
@phone = gets.chomp
|
9
19
|
print "Email: "
|
10
|
-
email = gets.chomp
|
20
|
+
@email = gets.chomp
|
11
21
|
print "have you been overseas in the last two weeks or in close contact with someone who has? type Y or N: "
|
12
|
-
travel = gets.chomp
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
22
|
+
@travel = gets.chomp
|
23
|
+
patients = Patient.new #{
|
24
|
+
# 'Name': name,
|
25
|
+
# 'Phone': phone,
|
26
|
+
# 'Email': email,
|
27
|
+
# 'Travel': travel
|
28
|
+
# }
|
19
29
|
|
20
30
|
end
|
21
31
|
|
@@ -28,8 +38,12 @@ File.open("patients.txt","a+") do |f| #flag
|
|
28
38
|
|
29
39
|
end
|
30
40
|
end
|
31
|
-
|
41
|
+
|
42
|
+
|
43
|
+
|
32
44
|
p printer(make_patient)
|
33
45
|
|
34
46
|
|
35
47
|
|
48
|
+
|
49
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: BookMD
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GorginZ
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|