Version 111 (modified by Michael Howden, 12 years ago) ( diff )


RHoK 2011

Community Emergency Response Teams (CERTs) are local groups of trained volunteers who respond when a crisis situation overwhelms established emergency response resources. There are more than 1800 CERTs, most of which don't have the money or time to implement a commercial tracking and deployment system. As with most volunteer response efforts, resource coordination is one of the primary bottlenecks to effective response.

At last year's RHoK event, members of Chicago's Community Emergency Response Team formed a collaboration with the Sahana Foundation to create a community scale volunteer and deployment tracking module for the Sahana-Eden platform. This straight-forward, intuitive module will allow community-level response teams to train, track and deploy accurately and efficiently. It will allow us to quickly identify volunteers with the necessary skills (medical, search and rescue, etc) for an emergency response, improving the outcomes for the communities we serve.

Chicago CERT and Sahana developers have created a set of tasks for RHoK 2011 that will allow this project to move from proof-of-concept to implementation with Chicago CERT.

Sahana supports Rapid Application Development and has a worldwide network of generous, knowledgeable developers. This event is an excellent introduction to developing for the Sahana platform. If you know Python, JavaScript or CSS design, please consider joining the collaboration!

The notes from RHoK 2010 are in BluePrintCERT. The relevant portions for our goals this year are copied into the notes below. It is important to understand that many CERT member and administrators are not strongly technical and are intimidated by the power and complexity of the full platform, so need a simplified version customised to just their specific needs.


Laura from CERT Chicago will be at the event in Austin, TX

Sahana developers can be found on IRC at #sahana-eden:

  • flavour (Skype: franboon) physically in Oxford, UK
  • nursix (Skype: nursix) physically in [56.941681N,15.912713E], Sweden
  • ptressel physically in Portland, OR
  • graemef physically in Hanoi, VN


Potential talking points for executive summary problem statement presentation:

Getting Started

Read the Book, especially the chapters on Customization and Building a New Module.

The CERT Development branch is here:

The easiest way to install is by using the USB distribution (1.4 Gb):

  • If on Windows, simply run start-eden.bat
    • Note that the first run will take some time as it needs to create all the database tables...also it is safe to ignore the Warnings in the console window - these are optional dependencies
  • If on Mac, then install VirtualBox whose installer can be found in the /Mac folder, as can an image of a full development environment: InstallationGuidelines/VirtualMachine
  • If on Linux then either use the same VirtualBox image or follow the Installation instructions

Note: The Virtual Machine has the 'trunk' version of Sahana Eden - to convert to the CERT version, open !LXTerminal & type:

cd eden
bzr pull

Once you have done some hacking & are ready to share this with others, then register for an account on LaunchPad, generate an SSH Key (ssh-keygen), and then push to your branch:

bzr whoami "Full Name <>"
bzr add
bzr remove
bzr commit
bzr launchpad-login mylpusername
bzr push lp:~mylpusername/sahana-eden/cert

Note: Windows users using the USB will need to:

User Stories

There are three functionality areas we hope to build at this year's event:

  1. Create a simple, easy-to-follow, intuitive Volunteer and Event database user interface.
  2. Create a search functionality that allows administrators to search for volunteers with specific characteristics and choose to send event deployment requests to those volunteers.
  3. Automatically process volunteer responses to the deployment information, respond appropriately to the responses, and generate a master list of participating volunteers for the event.

This is further broken down into Specific Tasks with actionable instructions on how to realise them.

A demo of the current functionality has been set up at:

You are free to register here & play!

1. Volunteer and Event database user interface

Create a simple, easy-to-follow, intuitive Volunteer and Event database user interface

Note: In the first instance, this system will only be accessible to admins & not by the volunteers themselves, so there is less need to work on access rights - that can be added later.

The following screenshot is a proposed UI design that should be simple and intuitive enough for non-technical users to be able to follow:


User Story 1: Setup for initial CERT training.

The following System Context diagram illustrates the actors and exchanges for the event registration and volunteer deployment functionality

BluePrint CERT System Context Diagram

1a. Events


Event types we have so far are "Training", "Emergency Deployment", "Planned Deployment", "Outreach", and "SocialCERT".

Basic training is 8 classes and a final exam. CERT Administrator Joe creates an event for each class:

Add Event

1b. Qualifications

Qualifications (hrm_skill) can be automatically assigned to a user, with an appropriate Skill Level (hrm_competency) by confirmed Participation in the requisite training Events (hrm_experience). They can also be added by an admin when they upload a scan of ther relevant paper certification.

Data Model:

Example Data:

Joe also creates a qualification category that requires all classes and the exam. All the classes are internal to CERT and so go under "Training Requirements". No external credentials are required to complete basic training. The Skill Level indicates the maximum level this qualification grants to the volunteer who receives it. If the volunteer already has a higher skill level, they are not downgraded.

Add Qualification (Internal Training)

Some of the students are already AED / CPR certified, so Joe also creates a qualification for that. The students will send Joe a copy of their certification which he will then attach to their profile.

Add Qualification (External Certification)

Determining which volunteers have completed all the requirements for a given qualification will be refreshed by a background scheduled task or forced by selecting "Refresh All Qualifications" on the Qualifications page.

View Qualifications

1c. Import Class Students

Joe then enters (or import) a list of the students in the class. If they already exist in the volunteer database, the class is added to their existing profile. If they do not exist in the database, a new volunteer record is created.

1d. Status: Active/Pending

When volunteers first complete all the required classes for Basic Training, their status is changed from "Pending" to "Active" and are eligible for additional call-outs and training.

Sample volunteer profile pages

Info tab

The info page is pretty straightforward. The "text" checkbox indicates that the volunteer can receive SMS messages at that number. The "Contact Lists" indicate what types of communications this volunteer will receive from CERT. I'm signed up for everything, but if I wanted to stop receiving notifications about drills I would be removed from the "Drills" contact list. (TODO: preferred method of communication)

Volunteer Profile: Info

Qualifications tab

The qualifications and level boxes (from left to right, level 1, 2 and 3) are pulled from the qualifications database. The notes and attachments are part of the volunteer's profile. The paperclips indicate an an attached file with verification of that qualification.

Note: When volunteers get access to this, they will only be able to add skills with an 'unverified' status (to be added later)

Volunteer Profile: Qualifications

Participation tab

This is just a list of the events in which the volunteer has participated. In the future we'd like to be able to filter by event type.

This is the hrm_experience table, which is populated when a user checks-out of an Event.

Volunteer Profile: Participation

Notes tab

This is where CERT leadership can make notes that are important or helpful for an incident commander. The information on this page will be added to the volunteer roster that is sent to the incident commander, and instructions on the appropriate types of things to write in this area will be part of our SOP.

Note: When the site is extended to allow volunteers to access then this tab would NOT be visible to them.

Volunteer Profile: Notes

Events tab

This is a read only page that indicates which past deployments the volunteer has responded to at what his / her response was.

This is the hrm_deployment table, which is populated when a user is sent a notification of an Event.

Volunteer Profile: Events

2. Deployment

Create a search functionality that allows administrators to search for volunteers with specific characteristics and choose to send event deployment requests to those volunteers.

The deployment page allows the admin to send a request to specific volunteers. (Note: Admins can also send notifications to a contact list without affiliation to an event)

Note: the list of volunteers is already filtered to those in the Contact List (pr_group) for that event type

Add Deployment

By default all Active members are shown in the recipient list who are assigned to the appropriate contact list. For instance, if sending a deployment for a Training event, only volunteers who belong to the "Training" contact list will be shown in the recipient list. The list can be further filtered by selecting "Restrict recipients by qualification" and using multi-select to choose.

The deployment notice is a standard template. Joe wants to edit before sending so he selected "Edit Request Before Sending" to bring up the preview pane. He adds a couple of notes and select "Send Deployment"
The notification encodes the location using OpenGeoSMS

Add Deployment With Preview

Here is a flow chart of the whole deployment process:

Deployment Workflow

3. Process Responses & Generate Roster

Automatically process volunteer responses to the deployment information, respond appropriately to the responses, and generate a master list of participating volunteers for the event

As seen in the Deployment Workflow above, volunteers are expected to respond to the deployment request in specific way in order to be processed by the system. When the desired number of volunteers have responded affirmatively, the system sends regrets to all subsequent responses, generates a roster of confirmed volunteers and sends it to the incident commander.

The Roster should provide the ability to check volunteers In/Out of the Event. (Note: a tally of no-shows needs to be recorded for the volunteers)

Sample Volunteer Callout List

Functional Testing

Test Cases document is here:

Specific Tasks

Here are some specific tasks suitable to be achieved during RHoK by developers new to Sahana:

Home Page

These are the files to edit:

  • controllers/default


  • views/default/index.html

You /could/ also edit views/layout.html but that should be seen as lower priority.
If you do get that far then suggest reusing the layout used across these 2 projects:

This page may be useful reading:

Event Page

Time/Hours done. Locations: Austin RHoK working on this (bporter)
The Add Event page has a default Start Time/Hours/Location which can be overridden by Shift...the visibility of the default fields & presence of the Shifts tab/location field within that should be dependent on these options.

Location Selector needs an API to hide/show the whole thing:

  • static/scripts/S3/s3.locationselector.widget.js
  • The API needs to be called from modules/s3/ S3BooleanWidget() for when fieldname == "location_id"

Emergency Contacts

Oxford have done this
Add support for Emergency Contacts

This could be done by porting across the work done on this in the LA branch:

Volunteer Status

Austin RHoK working on this (kdoran)
Ensure that we have Active/Pending statuses available for a volunteer:

Work on the 'rheader' to show this status & the total volunteer hours:

Information Page

Oxford working on this
Create a custom 'information' method to display the data from the pr_address & pr_contact tables on a single screen, as per the screenshot.

It is suggested to implement this as a 'Custom Method' of the person() REST controller:

Events Page

RHoK Austin (Phred): investigating and working on this

This is a formatted view of the user's upcoming events

It is suggested to implement this as a 'Custom Method' of the person() REST controller:

This could start as just a list with a response.s3.filter?

Represent for Skill Competency Levels

Austin RHoK (fritters) working on this

Volunteers have 3 Competency Levels for their Skills: Level 1, Level 2, and Level 3

These should be displayed in the 3 dots format as shown in the screen shots.

This is a represent function:

def my_represent_function(opt):
    represent = ...
    return represent

table.field.represent = my_represent_function

Scheduled Task

We need a scheduled task to update the certifications database - to check for expiry. (updates from particpation in training Events should be done automatically onaccept)

Deployment Page

This is to send a notification to selected group of recipients for a particular event type.

It is suggested to implement this as a 'Custom Method' of the event() REST controller:

This could just be an S3Search with preset filters?

Process Replies

Process SMS/Email replies from Volunteers

Can use parserdooth() in controllers/

Ideally this would be moved into modules/s3/ although this can happen later (Faster to RAD outside modules as no need to restart web2py to see changes)


Create the Roster to be sent to the Incident Commander

This should be displayed nicely on a Mobile device allow volunteers to be checked-in/checked-out.

This page may be useful reading:

Sending a PDF of the Roster provides a good backup process in case Power/Comms are down.


Austin RHOK (Eli) working on this
When adding an Event to a volunteer's Participation, the dropdown shows all events, even those already added to the profile.
The dropdown should be filtered to exclude those records already added.

This should probably subclass the IS_ONE_OF validator:

A very old attempt to this with the base Web2py IS_IN_DB is here:

Validation for Contacts

  • contact_method == SMS/PHONE should use s3_phone_requires
  • contact_method == EMAIL should use IS_EMAIL()

Geo-based notifications filter

Add support for filtering notifications by geo location.

Sahana stores lat & lon in the gis_location table which is accessed via the location_id() reusable field.

This can be queried using gis.get_features_in_radius():

Note that this is lower priority - we would need LatLons for volunteers in the DB for this to be useful - would this be done just on Home Address or via Check-Ins? (Latitude?)

Scale Uploaded Images

Scale uploaded Profile Pictures

See: ScaleUploadedImages

Attachments (20)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.