Skip to content
Browse files

4/3/12 different field functionalities in female history established

  • Loading branch information...
1 parent c4335f2 commit 7b9f7aa2482d7abdf88dca6f130c884d67a11acc @HashSolo committed
Showing with 30 additions and 1 deletion.
  1. +6 −1 app/controllers/cases_controller.rb
  2. +24 −0 app/views/history_females/new.html.erb
View
7 app/controllers/cases_controller.rb
@@ -1,4 +1,5 @@
class CasesController < ApplicationController
+
def index
@title = "Case Lookup"
@cases = Case.paginate(:page => params[:page])
@@ -28,16 +29,20 @@ def create
@user = User.new(params[:user])
@user.toggle(:patient_account)
-
#automatically generates a password for new user
#will create a helper to make a random pswd generator
@user.password = "foobar"
@user.password_confirmation = "foobar"
+
@case = @user.cases.build(params[:case])
+ @case.clinician_id = params[:case][:clinician_id]
+ @case.referrer_id = params[:case][:referrer_id]
+
if @user.save
@appointment = @case.appointments.build(params[:appointment])
if @appointment.save
+ @title = "New Case!"
flash[:success] = "New Case Successfully Created"
redirect_to case_path(@case)
else
View
24 app/views/history_females/new.html.erb
@@ -32,6 +32,14 @@
<tr>
<td class="label">Occupation </td><td class="value"><%= f.text_field :occupation %></td>
</tr>
+
+ <tr>
+ <td class="value"><%= f.radio_button :marriage_status, 'male' %></td>
+ <td class="label"><%= label :marriage_status_male, "Male"%></td>
+ <td class="value"><%= f.radio_button :marriage_status, 'female' %></td>
+ <td class="label"><%= label :marriage_status_female, "Female"%></td>
+ </tr>
+
</table>
<!--
@@ -52,6 +60,22 @@
<tr>
<td class="label">What is the date of your last menstrual period?</td><td class="value"><%= f.text_field :last_menstrual_period %></td>
</tr>
+
+ <tr>
+ <td class="label">If you take medication, please check all that apply </td>
+ <td class="value"><%= f.check_box :premarin %> Premarin</td>
+ <td class="value"><%= f.check_box :estrace %> Estrace</td>
+ <td class="value"><%= f.check_box :birth_control %> Birth Control Pills</td>
+ <td class="value"><%= f.check_box :progesterone %> Progesterone</td>
+ <td class="value"><%= f.check_box :provera %> Provera</td>
+ <td class="value"><%= f.check_box :cycrin %> Cycrin</td>
+ <td class="value"><%= f.check_box :aygestin %> Aygestin</td>
+ <td class="value"><%= f.check_box :crinone %> Crinone</td>
+ <td class="value"><%= f.check_box :prometrium %> Prometrium</td>
+
+
+ </tr>
+
</table>
<!--

0 comments on commit 7b9f7aa

Please sign in to comment.
Something went wrong with that request. Please try again.