Commit 92b3921e authored by Marc Duez's avatar Marc Duez

server : add field for patient id used by hospital administration system

parent ddd4bb09
......@@ -56,7 +56,8 @@ def add_form():
id = db.patient.insert(first_name=request.vars["first_name"],
last_name=request.vars["last_name"],
birth=request.vars["birth"],
info=request.vars["info"])
info=request.vars["info"],
id_label=request.vars["id_label"])
user_group = auth.user_group(auth.user.id)
......@@ -122,7 +123,8 @@ def edit_form():
db.patient[request.vars["id"]] = dict(first_name=request.vars["first_name"],
last_name=request.vars["last_name"],
birth=request.vars["birth"],
info=request.vars["info"]
info=request.vars["info"],
id_label=request.vars["id_label"]
)
res = {"redirect": "patient/index",
......
......@@ -84,7 +84,9 @@ db.define_table('patient',
Field('first_name','string'),
Field('last_name','string'),
Field('birth','date'),
Field('info','text'))
Field('info','text'),
Field('id_label','string'),
)
'''
db.patient.first_name.requires = IS_NOT_EMPTY( error_message='input needed' )
......
......@@ -4,53 +4,34 @@
<table>
<tbody>
<tr>
<td >
<label for="patient_first_name" id="patient_first_name__label"> First Name: </label>
</td>
<td >
<input class="string" id="patient_first_name" name="first_name" type="text" value=""><span>*</span>
</td>
<td >
</td>
<td ><label for="patient_first_name" id="patient_first_name__label"> First Name: </label></td>
<td ><input class="string" id="patient_first_name" name="first_name" type="text" value=""><span>*</span></td>
<td ></td>
</tr>
<tr>
<td>
<label for="patient_last_name" id="patient_last_name__label">Last Name: </label>
</td>
<td>
<input class="string" id="patient_last_name" name="last_name" type="text" value=""><span>*</span>
</td>
<td>
</td>
<td><label for="patient_last_name" id="patient_last_name__label">Last Name: </label></td>
<td><input class="string" id="patient_last_name" name="last_name" type="text" value=""><span>*</span></td>
<td></td>
</tr>
<tr>
<td>
<label for="patient_birth" id="patient_birth__label">Birth: </label>
</td>
<td>
<input class="date" id="patient_birth" name="birth" type="text" value=""><span>* (format: yyyy-mm-dd)</span>
</td>
<td>
</td>
<td><label for="patient_birth" id="patient_birth__label">Birth: </label></td>
<td><input class="date" id="patient_birth" name="birth" type="text" value=""><span>* (format: yyyy-mm-dd)</span></td>
<td></td>
</tr>
<tr>
<td>
<label for="patient_info" id="patient_info__label">Info: </label>
</td>
<td>
<textarea class="text" cols="40" id="patient_info" name="info" rows="10"></textarea>
</td>
<td>
</td>
<td><label for="patient_id_label" id="patient_id_label__label">ID label </label></td>
<td><input class="date" id="patient_id_label" name="id_label" type="text" value=""><span>id used by hospital administration system</span></td>
<td></td>
</tr>
<tr>
<td>
</td>
<td >
<input type="submit" value="save" class="btn">
</td>
<td>
</td>
<td><label for="patient_info" id="patient_info__label">Info: </label></td>
<td><textarea class="text" cols="40" id="patient_info" name="info" rows="10"></textarea></td>
<td></td>
</tr>
<tr>
<td></td>
<td ><input type="submit" value="save" class="btn"></td>
<td></td>
</tr>
</tbody>
</table>
......
......@@ -23,6 +23,11 @@ info = db.patient[request.vars["id"]]
<td> <input class="date" id="patient_birth" name="birth" type="text" value="{{=info.birth}}"><span>* (format: yyyy-mm-dd)</span></td>
<td> </td>
</tr>
<tr>
<td><label for="patient_id_label" id="patient_id_label__label">ID label </label></td>
<td><input class="date" id="patient_id_label" name="id_label" type="text" value="{{=info.id_label}}"><span>id used by hospital administration system</span></td>
<td></td>
</tr>
<tr>
<td> <label for="patient_info" id="patient_info__label">Info: </label> </td>
<td> <textarea class="text" cols="40" id="patient_info" name="info" rows="10"> {{=info.info}} </textarea> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment