Adding new fields to the registration_admission module

12 views
Skip to first unread message

jose

unread,
Aug 26, 2008, 4:28:36 PM8/26/08
to Care2X
Greetings.

I'm triying to modify the patient_registration module, in order to add
some aditional fields.

I already modified the registration form template in smarty, and
changed the database in order to reflect the new fields, but i'm
having trouble with the functional part, collecting that new data in
the form and adding it to the database.

I need some orientation and help with the modification of this module.


Thanks.

Gjergj Sheldija

unread,
Aug 26, 2008, 5:49:46 PM8/26/08
to care...@googlegroups.com
Hi Jose,

can you explain a bit more in detail about your problem ?
anyway, you need to play around with include\care_api_classes\class_gui_input_person.php


regards
gj.

jose de jesus

unread,
Aug 26, 2008, 8:04:58 PM8/26/08
to care...@googlegroups.com
Hi. Thanks for helping me. Excuse my english.

What i need to do is to add a new field to the form in the patient/registration form and make it functional. Pretty much have a new field added to the database and the interface, but i'm failing to register it when the user hits submit, because i don´t know how to do it.

First thing i did was to add the new field to the table care_person.

Then i added the lines:

'$this->smarty->assign('newFieldLabel','newField: ');
'$this->smarty->assign('newFieldInput',<input name="newField" type="text" size="35" value="'.$new Field.'" >');'

to the file:
include\care_api_classes\class_gui_input_person.php,

in order to the use the smarty variables $newFieldLabel and $newFieldInput in the file:
D:\xampp\htdocs\care2x\gui\smarty_template\templates\default\registration_admission\reg_form.tpl

Now, i have the new field in my interface. What i need to do now is to make it work, i mean, that when the user fills the form and hits the submit button the value of the new field is added to the database. I fail to understand how care2x adds information to the database ( that's my biggest concern right now !).

I can see that the form in the template re_form.tpl the line:

 <form method="post" action="{{$thisfile}}...

But isnt {{$thisfile}} the very samefile ?, when is the content of the form added to the database ?

I also would like to understand how the template reg_show.tpl uses the very same template reg_form.tpl to show the information of a patient, how is that the file reg_form.tpl serves to receive and show information at the same time ?


Thanks a lot !

balamouk

unread,
Aug 26, 2008, 10:03:04 PM8/26/08
to Care2X
Hi jose,

well, here is a simple solution
in class_gui_input_person near line 122 you have something like :
include_once($root_path.'include/care_api_classes/
class_insurance.php'); // insurance data
include_once($root_path.'include/care_api_classes/
class_person.php'); //person data

now all you gave to do is to open class_person and to the $elems_array
the fields in the db you just added.
the insert part is done near line 311 in class_gui_person_input you
have a function call
there something like if( $person_obj-
>insertDataFromInternalArray() )...
the update part is near line 189 :
if(&update)...

the code is quite well docuemented in this part, alltough you'll have
to experiment a bit :)

regards
gj.
> On Tue, Aug 26, 2008 at 11:49 PM, Gjergj Sheldija <gjergj.sheld...@gmail.com
>
> > wrote:
> > Hi Jose,
>
> > can you explain a bit more in detail about your problem ?
> > anyway, you need to play around with
> > include\care_api_classes\class_gui_input_person.php
>
> > regards
> > gj.
>

jose de jesus

unread,
Aug 27, 2008, 7:09:17 PM8/27/08
to care...@googlegroups.com
Thanks for your help and time,  your advice solved my problem.

Gjergj Sheldija

unread,
Aug 27, 2008, 8:07:12 PM8/27/08
to care...@googlegroups.com
Glad this helped you.

We're actually working on a new user manual, hope you will help us.

regards
gj.
Reply all
Reply to author
Forward
0 new messages