[[TOC]] = 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 [wiki: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. == Coordination == Laura from CERT Chicago will be at the event in Austin, TX Sahana developers can be found on [wiki:Chat 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 == Recruitment == Potential talking points for executive summary problem statement presentation: https://docs.google.com/document/d/12kIJSUIMXVwYQJ5fbPUt8TI9s5gn6icfB64S93ewuM8/edit == Getting Started == '''Note: As of January 2012, BZR/Launchpad info for eden is deprecated. Please visit the GitHub page. Thanks.'''[[BR]] Read the [wiki:Book Book], especially the chapters on [http://en.flossmanuals.net/sahana-eden/customisation/ Customization] and [http://en.flossmanuals.net/sahana-eden/building-a-new-application/ Building a New Module]. The CERT Development branch is here: * https://code.launchpad.net/~flavour/sahana-eden/cert The easiest way to install is by using the [http://eden.sahanafoundation.org/downloads/USB.7z 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: [wiki:InstallationGuidelines/VirtualMachine] * If on Linux then either use the same !VirtualBox image or follow the [wiki:InstallationGuidelines/Linux/Developer/Manual 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 https://code.launchpad.net/~flavour/sahana-eden/cert }}} Once you have done some hacking & are ready to share this with others, then [https://login.launchpad.net/+login 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: * Install Bzr: http://wiki.bazaar.canonical.com/Download * Create SSH keypair using {{{ssky-keygen.cmd}}} * Unzip [http://eden.sahanafoundation.org/downloads/ssh.zip ssh.zip] to a folder in your path (e.g. 'windows') == 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 [wiki:BluePrintCERT/RHoK2011#SpecificTasks Specific Tasks] with actionable instructions on how to realise them. A demo of the current functionality has been set up at: * http://cert.sahanafoundation.org 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: * More current screenshots: https://docs.google.com/present/edit?id=0AYA-kxV2HmgBZGdneDRuczlfMjYyY245N2Q5ZmM [[Image(homepage.png)]] 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 [[Image(BluePrintCERTSystemContextDiagram.png)]] === 1a. Events === hrm_event 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'': [[Image(AddEvent.png)]] === 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: * https://docs.google.com/drawings/d/1m0QFUS7dS_RYdjl6Uh_LJemkgVde6fkOqHzc-XjhKLA/edit?hl=en_GB Example Data: * https://docs.google.com/spreadsheet/ccc?key=0AgESuewSG-wodEhEd3RPYkhvd1psVTZOdUY3UUpUOUE&hl=en_GB#gid=0 ''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.'' [[Image(AddQualification1.png)]] ''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.'' [[Image(AddQualification2.png)]] ''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.'' [[Image(ViewQualifications.png)]] === 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) [[Image(VolunteerProfile_Info.png)]] ==== 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) [[Image(VolunteerProfile_Qualifications.png)]] ==== 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. [[Image(VolunteerProfile_Participation.png)]] ==== 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. [[Image(VolunteerProfile_Notes.png)]] ==== 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. [[Image(VolunteerProfile_Events.png)]] == 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 [[Image(AddDeployment.png)]] ''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"''[[BR]] The notification encodes the location using [wiki:BluePrint/Messaging/OpenGeoSMS OpenGeoSMS] [[Image(AddDeploymentWithPreview.png)]] Here is a flow chart of the whole deployment process: [[Image(Deployment_Workflow.png)]] == 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) * https://docs.google.com/drawings/d/1wp2rQLgrmFvZShQ9pZN6eg0j2JtC9hV7_r4-jqykRJM/edit [[Image(SampleCalloutList.png)]] == Functional Testing == Test Cases document is here: https://docs.google.com/document/d/1iWGeNplhtueNh-twCFirnRz_Ucu706Dhlt0gW_DOW9g/edit == 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}}} Function: {{{index.py()}}} * {{{views/default/index.html}}} You /could/ also edit {{{views/layout.html}}} but that should be seen as lower priority.[[BR]] If you do get that far then suggest reusing the layout used across these 2 projects: * http://rmsdev.aidiq.com * http://bazaar.launchpad.net/~flavour/sahana-eden/ifrc/view/head:/views/layout.html * http://la.aidiq.com * http://bazaar.launchpad.net/~flavour/sahana-eden/la/view/head:/views/layout.html This page may be useful reading: * [wiki:DeveloperGuidelinesCSS] === Event Page === '''!Time/Hours done. Locations: Austin RHoK working on this (bporter)'''[[BR]] 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/s3widgets.py S3BooleanWidget() for when fieldname == "location_id" === Emergency Contacts === '''Oxford have done this'''[[BR]] Add support for Emergency Contacts This could be done by porting across the work done on this in the LA branch: * http://bazaar.launchpad.net/~flavour/sahana-eden/la/view/head:/models/vol.py#L84 * http://bazaar.launchpad.net/~flavour/sahana-eden/la/view/head:/controllers/vol.py#L1356 === Volunteer Status === '''Austin RHoK working on this (kdoran)'''[[BR]] Ensure that we have !Active/Pending statuses available for a volunteer: * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/models/06_hrm.py#L154 Work on the 'rheader' to show this status & the total volunteer hours: * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/controllers/hrm.py#L800 === Information Page === '''Oxford working on this'''[[BR]] 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: * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/controllers/hrm.py#L467 === 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: * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/controllers/hrm.py#L498 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) * http://en.flossmanuals.net/sahana-eden/scheduler/ * http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/models/sync.py#L618 === 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: * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/controllers/hrm.py#L183 This could just be an S3Search with preset filters? === Process Replies === Process SMS/Email replies from Volunteers Can use {{{parserdooth()}}} in {{{controllers/msg.py}}}: http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/controllers/msg.py#L200 Ideally this would be moved into {{{modules/s3/s3msg.py}}} although this can happen later (Faster to RAD outside modules as no need to restart web2py to see changes) === Roster === 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: * BluePrintMobilePortal Sending a PDF of the Roster provides a good backup process in case !Power/Comms are down. * A PDF Roster can be ported from this branch: http://bazaar.launchpad.net/~flavour/sahana-eden/la/view/head:/models/vol.py#L1250 === THIS_NOT_ONE_OF Validator === '''Austin RHOK (Eli) working on this'''[[BR]] When adding an Event to a volunteer's Participation, the dropdown shows all events, even those already added to the profile.[[BR]] The dropdown should be filtered to exclude those records already added. This should probably subclass the IS_ONE_OF validator: * http://eden.sahanafoundation.org/wiki/IS_ONE_OF * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/modules/s3/s3validators.py#L437 A very old attempt to this with the base Web2py IS_IN_DB is here: * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/modules/s3/s3validators.py#L149 === 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()}}}: * http://bazaar.launchpad.net/~flavour/sahana-eden/cert/view/head:/modules/s3/s3gis.py#L1621 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: [wiki:Contribute/Code#ScaleUploadedImages ScaleUploadedImages]