Person Registry (PR)

  • Student :- Kethees
  • Mentor :- Nishantha

Person Registry(PR)

Person Registry(PR) is a centralized location in SAHANA Disaster Management System to collect Individual and Group/Organization information. Its a place for data about people affiliated with SAHANA Disaster Management System.

There are several incidents where Individual or Group/Organization information can be used in SAHANA during disaster or pre deployment of SAHANA. The Individual or Group/Organization information can be used in other person oriented modules by using centralized person search functionality in PR. Each person may have multiple roles such missing person, disaster victim, logistic oriented person and etc. This functionality will avoid collecting redundant data in SAHANA.

Core Functionality
  • Providing person API to use in person oriented modules.
  • Inferface for collect Individual and Group/Organization information.
  • Search person.
Additional Functionality
  • Data beyond Persons: MPR, DVR, Logistic module and other person oriented modules.

Future Plan Integrating Person Registry with Missing Person Registry, Disaster Victim Registry and Volunteer Management and other modules. Make PR a central location to add people information so that other modules can get information from it.

Future Enhancement(s)
  • Integrating Person Registry with other person oriented modules.
  • Tracking person roles such missing person, disaster victim, logistic oriented person and etc within PR.
  • Enhancing Person API and library functionalities.

Person API

Generate Person Box

This allows you to create a input box with add button with AJAX capability. In order to use person form element in your form, you need to do is include the library and call the shn_form_person() API function.

The function for person form is as follows:


Above function will include form elements in your form

<input name="full_name" id="full_name" value="" disabled="disabled" tabindex="1" type="text">
<input name="person_id" value="" type="hidden">
<input value="Add" onclick="popup_show(... " type="button">

In Add button click event person form is poped up with following form fields

  1. First name
  2. Last name
  3. Address
  4. Occupation
  5. Telephone

Person full_name and person_id are returned and assigned in save action of the popup form.

Person Registry class files


  • Contents all sql statements.


    * $person = New Person();
    * $person->save_person();
    * $person->update_person();	
    * $person->get_person($p_uuid);
    * $person->delete_person($p_uuid);


    * $group = New Group();
    * $group->save_group();
    * $group->save_group_member();
    * $group->update_group();	
    * $group->get_group($g_uuid);
    * $group->delete_group($g_uuid);


    * $address = New Address();
    * $address->save_person_address();
    * $address->update_person_address();
    * $address->get_person_address($p_uuid);


    * $identity = New Identity();
    * $identity->save_person_identity();
    * $identity->update_person_identity();
    * $identity->get_person_identity($p_uuid);

Open Flash Chart Library

This allows you to creat a chart with Flash capability. In order to use following function, you need to do is include library and call the shn_draw_chart() API function.

Chart API
  • library includes following code snippets.
   include_once $global['approot']. '/3rd/php-ofc-library/open_flash_chart_object.php';
   include_once $global['approot'] .'/3rd/php-ofc-library/open-flash-chart.php';
   function shn_draw_chart($width, $height, $data_file_url)
       $base = 'res/ofc/';
       open_flash_chart_object($width, $height,$data_file_url,true,$base);

Sample $data_file_url formed via stream as follows.


$url_gender = 'index.php?mod=pr&act=gender&stream=text';
   function shn_text_pr_gender(){		
      $array = Data::get_pr_gender();
      $data = $array['data'];
      $label = $array['label'];
      foreach($data as $d){
         $total += $d;
      foreach($data as $key=>$d){
         $data[$key] = round(($d/$total*100),2);
      $g = new graph();
      $g->pie(60,'#505050','{font-size: 10px; color: #404040;');		
      $g->pie_values( $data, $label );		
      $g->pie_slice_colours( array('#31A43F','#A79810','#D21389') );		
      $g->set_tool_tip( ' Label: #x_label#<br>Value: #val#%' );	
      $g->title( 'Gender', '{font-size:14px; color: #d01f3c}' );
      echo $g->render();

Coordination Meetings

Tuesday, June 2, 2009, 1800 UTC - see logs (starts at 09:56) and meeting notes

Weekly Report(s)

QR Code
QR Code dev:gsoc09_pr (generated for current page)