C Copyright 2019 Fahad Pervaiz Understanding Challenges in the Data Pipeline for Development Data

Total Page:16

File Type:pdf, Size:1020Kb

C Copyright 2019 Fahad Pervaiz Understanding Challenges in the Data Pipeline for Development Data c Copyright 2019 Fahad Pervaiz Understanding Challenges in the Data Pipeline for Development Data Fahad Pervaiz A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy University of Washington 2019 Reading Committee: Richard Anderson, Chair Kurtis Heimerl Abraham Flaxman Program Authorized to Offer Degree: Paul G. Allen School of Computer Science & Engineering University of Washington Abstract Understanding Challenges in the Data Pipeline for Development Data Fahad Pervaiz Chair of the Supervisory Committee: Professor Richard Anderson Paul G. Allen School of Computer Science & Engineering The developing world is relying more and more on data driven policies. Numerous develop- ment agencies have pushed for on-ground data collection to support the development work they pursue. Many governments have launched efforts for more frequent information gath- ering. Overall, the amount of data collected is tremendous, yet we face significant issues in doing useful analysis. Most of these barriers are around data cleaning and merging, and they require a data engineer to support some parts of the analysis. This thesis aims to understand the pain points of cleaning development data. It also proposes solutions that harness the thought process of a data engineer to reduce the manual workload of the tedious process of cleaning such data. To achieve these goals, two research areas are critical: (1) to discern current data usage patterns and to build a taxonomy of data cleaning in the devel- oping world; and (2) to create algorithms to support automated data cleaning, which target selected problems including matching transliterated names. With these goals, this thesis will empower regular data users to easily do the necessary data cleaning and scrubbing for analysis. TABLE OF CONTENTS Page List of Figures . iv List of Tables . vi Chapter 1: Introduction . .1 Chapter 2: Background . .4 2.1 Types of Datasets . .4 2.2 Challenges in Development Data . .6 2.3 The Development Data Pipeline . .7 Chapter 3: Identified Problems in the Data Pipeline . 12 3.1 Methodology . 13 3.2 Findings . 15 3.3 Discussion . 26 3.4 Conclusion . 30 Chapter 4: Case Study: Improved Cold Chain Information System . 32 4.1 Summary . 32 4.2 Introduction . 32 4.3 Developing a CCIS for Laos . 38 4.4 Field Experience . 48 4.5 Discussion . 50 Chapter 5: Case Study: Developing Cold Chain Data Standard . 52 5.1 Summary . 52 5.2 Introduction . 52 5.3 Immunization . 54 i 5.4 Cold Chain Information System . 55 5.5 Software Context and Challenges . 57 5.6 Data Standards . 63 5.7 Discussion . 65 5.8 Conclusion . 67 Chapter 6: Case Study: An Assessment of SMS Fraud in Pakistan . 68 6.1 Summary . 68 6.2 Introduction . 68 6.3 Related Work . 70 6.4 SMS Fraud Background . 72 6.5 Data Collection . 73 6.6 Data Analysis . 80 6.7 Results . 83 6.8 Qualitative Analysis . 88 6.9 Discussion . 91 6.10 Conclusion . 95 Chapter 7: The Scalability of SMS Reporting Systems: Integrating with National Health Information Systems . 96 7.1 Summary . 96 7.2 Introduction . 96 7.3 Background . 98 7.4 Case Studies . 102 7.5 Barriers to Responding . 113 7.6 Discussion: Lessons at Scale . 117 7.7 Conclusion . 123 Chapter 8: Name Resolution for Data Cleaning . 125 8.1 Summary . 125 8.2 Introduction . 125 8.3 Related Work . 126 8.4 Methodology . 127 8.5 Evaluation . 129 ii 8.6 Discussion . 133 8.7 Conclusion . 134 Chapter 9: Conclusion . 135 Bibliography . 139 iii LIST OF FIGURES Figure Number Page 2.1 Various stages of the data pipeline along with a list of challenges at each stage.8 3.1 Summary of specific challenges grouped into categories. Challenges in bold text were mentioned by three or more participants. 15 4.1 (Top) fridgetag 30DTR with no alarms in last thirty days, (bottom) fridgetag 30DTR with two high temperature alarms, yesterday and two days ago. 36 4.2 Typical rural health center staffed by approximately four health workers . 39 4.3 Lao PDR, the NIP office is located in the capital Vientiane. 39 4.4 System architecture: Health workers send data via SMS to an android phone that syncs with cloud system. Cold chain manager and SMS moderator man- age these systems using their respective web interfaces. 42 4.5 Vaccine refrigerator labeled with A for reporting. 48 4.6 Five valid messages that all have the same semantic meaning. each message tells the system that refrigerators A and B had zero alarms and that the current stock levels for pentavalent and pneumococcal are 20 and 30. 49 6.1 Screenshots from Safe SMS app, showing how to label a conversation . 75 6.2 Number of conversations that were available on each user's phone, the ones they uploaded and the conversations that were labeled by them . 80 6.3 Presence of different features with important ones highlighted . 87 7.1 Wheel (Close up of the SMS report job aid for DSS) . 106 7.2 A BHU dispenser explaining how he uses the SMS reporting wheel to create a SMS message . 108 7.3 A 30 day temperature recorder (30DTR) in a Lao refrigerator showing two high alarms in the last two days . 108 7.4 The Lao SMS Immunization Manager (SIM) showing a list of incoming SMS reports of October 2014 . 112 7.5 An example message showing a sample of special characters accidentally typed during a training in Laos . 122 iv 8.1 Sensitivity of string matching algorithms against the Niger transliterated lo- cality names . 130 8.2 Sensitivity of different heuristics defined, using a combination of string match- ing algorithms, against the Niger transliterated locality names . 132 v LIST OF TABLES Table Number Page 3.1 Distribution of participants by role and organization type. 14 6.1 Summary of User Labeled Data. 81 6.2 Summary of Fraud Types. 83 6.3 Examples of fraudulent messages that were collected. English translations are given for messages sent in Roman Urdu. 84 6.4 Summary of Heuristic Results . 86 8.1 List of Heuristics. 127 8.2 Examples of failed matches . 133 vi 1 Chapter 1 INTRODUCTION Global development organizations and governments in developing regions increasingly rely on data to inform policies that are intended to improve health, education, employment, human rights, and economic development. Significant amounts of data are collected and analyzed by a wide array of stakeholders (e.g., government agencies, non-governmental or- ganizations, global development donors, and social enterprises) to conceptualize, implement, evaluate, and support policy decisions. Often these stakeholders have different goals and strategies for data collection and analysis. For example, while government agencies often collect a wide range of data to get an overview of different development indicators, non- profit and non-governmental organizations gather data to identify insights on a specific topic or to measure the impact of a specific intervention. For these reasons, attempts to collect data are often disorganized and in silos, which results in the availability of copious amounts of poor-quality data that is inconsistent, isolated, and lacks structure and standards, making it hard to clean and analyze. In many instances, data is collected without much considera- tion and planning, and often it remains little used or forgotten, resulting in time and cost intensive replicated efforts to collect the same data for different purposes. Although it is desirable to combine those datasets that cover similar domains, merging, transforming and cleaning datasets containing different schema and types is a non-trivial process that requires a substantial amount of effort. Data processing also involves multiple stakeholders, both within and outside the organization, and often data goes through multiple processing stages, including importing, merging, rebuilding missing datasets, standardizing and normalizing, duplicating, and exporting. Processed datasets then undergo cycles of analyses and visualizations. Many of these stages, from data collection to data visualization, 2 and processes within these stages are isolated from each other, making it easier for people to work on data independently. However, this isolation also means that people who work on one aspect (e.g., data cleaning) might have no control over processes in other stages (e.g., collection) and may not fully understand the context in which the data is collected, cleaned, transformed, or analyzed. Several Information and Communication Technology for Development (ICTD) researchers have investigated challenges in collecting development data [45] and designed new tools that are more suitable to gather development data [115, 61, 23, 21]. However, the research that examines challenges in different stages of the data pipeline is largely absent. While some researchers have provided taxonomies for dirty data (inaccurate, incomplete, and inconsistent data) in the context of systems in the developed world [81] and identified challenges such.
Recommended publications
  • Ujumbo: a Generic Development Toolkit for Messaging Based Workflows
    Ujumbo: A Generic Development Toolkit for Messaging Based Workflows Dept. of CIS - Senior Design 2012-2013 Archit Budhraja Bob Han Sung Won Hwang [email protected] [email protected] [email protected] Univ. of Pennsylvania Univ. of Pennsylvania Univ. of Pennsylvania Philadelphia, PA Philadelphia, PA Philadelphia, PA Jonathan J. Leung Sean Welleck Boon Thau Loo [email protected] [email protected] [email protected] Univ. of Pennsylvania Univ. of Pennsylvania Univ. of Pennsylvania Philadelphia, PA Philadelphia, PA Philadelphia, PA ABSTRACT We began development by consulting local and interna- Many organizations, especially in developing countries often tional nonprofits and small scale organizations that may lack technical expertise, resource, and financial capital neces- require custom platforms in their operations. We gath- sary to build applications with complex logic flows. Looking ered data on their proposed workflows, needed functional- at the different kinds of products on the market, there seems ity, as well as surveyed their available financial resources. to be a lot of commonality between them yet each of them After talking to several resource-constrained and non-profit is developed independently of each other, requiring program- clients, it was observed there was far too much manual com- ming ability and a substantial investment in time and financ- munication. Most organizations we interviewed are physi- ing for each application. Our project aims to reduce these cally entering and processing data on day to day operations, additional costs in building a new application with common often in simple spreadsheet software. They also invest many communication features by creating a generic platform that hours manually calling and text messaging their members for users with non-technical abilities could build off of.
    [Show full text]
  • Rapidsms in Rwanda
    Evaluating the Impact of RapidSMS: Final Report A Report Commissioned by UNICEF Rwanda December 2, 2016 Hinda Ruton, MSc1,2 Angele Musabyimana, MD, MSc1 Karen Grépin, PhD3 Joseph Ngenzi1 Emmanuel Nzabonimana1 Michael R. Law, PhD1,2,4 1. School of Public Health, College of Medicine and Health Sciences, University of Rwanda, Kigali, Rwanda 2. Centre for Health Services and Policy Research, The University of British Columbia, Vancouver, British Columbia, Canada 3. Sir Wilfred Laurier University, Waterloo, Ontario, Canada 4. Department of Global Health and Social Medicine, Harvard Medical School, Boston, MA, USA 1 Table of Contents Table of Contents ..................................................................................................................................... 2 Index of Tables and Figures ...................................................................................................................... 4 Tables ...................................................................................................................................................... 4 Figures ..................................................................................................................................................... 4 List of Acronyms....................................................................................................................................... 6 Executive Summary .................................................................................................................................
    [Show full text]
  • Návrhy Internetových Aplikací
    Bankovní institut vysoká škola Praha Katedra informačních technologií a elektronického obchodování Návrhy internetových aplikací Bakalářská práce Autor: Jiří Nachtigall Informační technologie, MPIS Vedoucí práce: Ing. Jiří Rotschedl Praha Srpen, 2010 Prohlášení Prohlašuji, že jsem bakalářskou práci zpracoval samostatně a s použitím uvedené literatury. V Praze, dne 24. srpna 2010 Jiří Nachtigall Poděkování Na tomto místě bych rád poděkoval vedoucímu práce Ing. Jiřímu Rotschedlovi za vedení a cenné rady při přípravě této práce. Dále bych chtěl poděkovat Ing. Josefu Holému ze společnosti Sun Microsystems za odbornou konzultaci. Anotace Tato práce se zaměřuje na oblast návrhu internetových aplikací. Podrobně popisuje celý proces návrhu počínaje analýzou za použití k tomu určených nástrojů jako je use case a user story. Další částí procesu je návrh technologického řešení, které se skládá z výběru serverového řešení, programovacích technik a databází. Jako poslední je zmíněn návrh uživatelského rozhraní pomocí drátěných modelů a návrh samotného designu internetové aplikace. Annotation This work focuses on web application design. It describes whole process of design in detail. It starts with analysis using some tools especially created for this purpose like use case and user story. Next part of the process is technical design which consists from selection of server solution, programming language and database. And finally user interface prepared using wireframes is mentioned here alongside with graphical design of the web application. Obsah Úvod
    [Show full text]
  • Terms of References for Trainers in Professional Short Courses in in E-Health
    Terms of References for Trainers in Professional Short Courses in in e-Health I. BACKGROUND AND JUSTIFICATION E-health is one of the key areas on which the East African Community Regional Centre of Excellence in Biomedical Engineering, E-Health, Rehabilitation and Mobility Sciences (CEBE) is focusing. The CEBE aims to increase the knowledge and skills of e-Health workforce in Rwanda and other East African countries for improved healthcare service delivery and e-Health systems management, which is currently quite limited. As more and more health facilities acquire more equipment for diagnosis and treatment purposes, CEBE’s target is to build the capacity of end users, managers, technical personnel and researchers who will design, develop, implement and evaluate e- health systems. 2. Overall Goal of the short course trainings The purpose of this e-health capacity building trainings is to strengthen the knowledge and skills in Rwanda and in the Region for the development and management e-Health applications and systems under the national eHealth enterprise architecture. 3. The specific objectives of the e-health capacity building trainings are as follows: 3.1 Design teaching materials and upload them on the e-learning platform of the University of Rwanda. For any or all of the following five selected e-health short courses a. Telemedicine applications b. Security, privacy and legal framework of health information systems c. Medical Coding d. E-Health: Software Development and Implementation (EHSDI) e. Electronic Medical Records use, Management and Health Information Systems 3.2 Deliver any or all of the five short courses as mentioned above and detailed in Annex 1.
    [Show full text]
  • Speed Evidence Evaluation
    World Vision Project SPEED EVIDENCE EVALUATION June 2014 CONTENTS CONTENTS • Objectives • Summary and Analysis • Matrices - Products Against Features - Products Against Standards • Appendices - Appendix A - List of Products Evaluated and Included in the Matrix - Appendix B - List of Products Evaluated and Excluded from the Matrix - Appendix C - List of Features by Product for Products in the Matrix OBJECTIVES OBJECTIVES Based on the features of Speed Evidence • Identify and evaluate products that are able to deliver similar and extended functionality • Compare products using a matrix of products against features SUMMARY AND ANALYSIS SUMMARY AND ANALYSIS It is important to note that this research not based upon first hand experience of the products but on information gleaned from websites and case studies, in some cases inferences were made. • Matrix of products against features - 28 products evaluated against Speed Evidence - Products are evaluated against 33 features under 8 headings • Features - The 33 features are listed under specific headings - E.g. Uploading/downloading surveys, Sends bulk SMS, Twitter feeds, Geo- located data, Easy to manage contacts, Set notifications, Free & easy to set up SUMMARY AND ANALYSIS ●Headings - The 8 headings are assessments, SMS, emails, data feeds, mapping, data management, user experience and other • Top 3 platforms by features - Speed Evidence 31/33 features, 8/8 headings - Ushahidi 21/33 features and 8/8 headings - Palantir Gotham 15/33 features and 7/8 headings • Palantir Gotham is a possible
    [Show full text]
  • Using Locational Data from Mobile Phones to Enhance the Science of Delivery
    INFORMATION AND COMMUNICATION TECHNOLOGIES USING LOCATIONAL DATA FROM MOBILE PHONES TO ENHANCE THE SCIENCE OF DELIVERY Ryan Haddad, Tim Kelly, Teemu Leinonen and Vesa Saarinen June 2014 WORLD BANK REPOrt NUMBER ACS9644 USING LOCATIONAL DATA FROM MOBILE PHONES TO ENHANCE THE SCIENCE OF DELIVERY Ryan Haddad, Tim Kelly, Teemu Leinonen and Vesa Saarinen June 2014 WORLD BANK REPOrt NUMBER ACS9644 STANDARD DISCLAIMER This volume is a product of the staff of the International Bank for Reconstruction and Development/ The World Bank. The findings, interpretations, and conclusions expressed in this paper do not necessarily reflect the views of the Executive Directors of The World Bank or the governments they represent. The World Bank does not guarantee the accuracy of the data included in this work. The boundaries, colors, denominations, and other information shown on any map in this work do not imply any judgment on the part of The World Bank concerning the legal status of any territory or the endorsement or acceptance of such boundaries. COPYRIGHT STATEMENT The material in this publication is copyrighted. Copying and/or transmitting portions or all of this work without permission may be a violation of applicable law. The International Bank for Reconstruction and Development/ The World Bank encourages dissemination of its work and will normally grant permission to reproduce portions of the work promptly. For permission to photocopy or reprint any part of this work, please send a request with complete information to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA, telephone 978-750-8400, fax 978-750-4470, http://www.copyright.com/.
    [Show full text]
  • Global Human Rights Monitoring, New Technologies, and the Politics Of
    The European Journal of International Law Vol. 23 no. 4 © The Author, 2012. Published by Oxford University Press on behalf of EJIL Ltd. All rights reserved. For Permissions, please email: [email protected] Global Human Rights Monitoring, New Technologies, and the Politics of Information Downloaded from Philip Alston* and Colin Gillespie** http://ejil.oxfordjournals.org/ Abstract Antonio Cassese’s vision for the future of the international human rights and criminal justice regimes relied critically upon the availability of reliable and systematic sources of information about alleged violations, to be provided primarily by the major interna- tional human rights NGOs. But the reality is that the existing system is problematically at New York University School of Law on December 20, 2012 fragmented, hierarchical, non-collaborative, and excessively shaped by organizational self-interest. The politics of information suggests that, in the absence of significant pressure for change, the major INGOs will continue to adopt a proprietorial rather than a communal approach to reported data. We argue that while new information and com- munications technologies have already demonstrated their potential to transform the existing human rights regime, there is a compelling case to be made for establishing a comprehensive reporting website, open to local actors as well as the international community, and equipped with a collaborative online editing tool that would begin to resemble a human rights version of the Wikipedia. The article explores the many advan- tages of a human rights wiki, and notes the range of choices that would need to be made in order to shape the structure, and modes of organization and management of such an initiative.
    [Show full text]
  • Global Human Rights Monitoring, New Technologies, and the Politics of Information
    The European Journal of International Law Vol. 23 no. 4 © The Author, 2012. Published by Oxford University Press on behalf of EJIL Ltd. All rights reserved. For Permissions, please email: [email protected] Global Human Rights Monitoring, New Technologies, and the Politics of Information Philip Alston* and Colin Gillespie** Downloaded from Abstract Antonio Cassese’s vision for the future of the international human rights and criminal http://ejil.oxfordjournals.org/ justice regimes relied critically upon the availability of reliable and systematic sources of information about alleged violations, to be provided primarily by the major interna- tional human rights NGOs. But the reality is that the existing system is problematically fragmented, hierarchical, non-collaborative, and excessively shaped by organizational self-interest. The politics of information suggests that, in the absence of significant pressure for change, the major INGOs will continue to adopt a proprietorial rather than a communal approach to reported data. We argue that while new information and com- munications technologies have already demonstrated their potential to transform the by guest on April 13, 2015 existing human rights regime, there is a compelling case to be made for establishing a comprehensive reporting website, open to local actors as well as the international community, and equipped with a collaborative online editing tool that would begin to resemble a human rights version of the Wikipedia. The article explores the many advan- tages of a human rights wiki, and notes the range of choices that would need to be made in order to shape the structure, and modes of organization and management of such an initiative.
    [Show full text]
  • Smsaúde: Design, Development, and Implementation of a Remote/Mobile Patient Management System to Improve Retention in Care for HIV/AIDS and Tuberculosis Patients
    JMIR MHEALTH AND UHEALTH Nhavoto et al Original Paper SMSaúde: Design, Development, and Implementation of a Remote/Mobile Patient Management System to Improve Retention in Care for HIV/AIDS and Tuberculosis Patients José António Nhavoto1,2*, MSc; Åke Grönlund1*, PhD; Walter Ponce Chaquilla3*, MSc 1Informatics, School of Business, Örebro University, Örebro, Sweden 2Informatics, Department of Mathematics and Informatics, Eduardo Mondlane University, Maputo, Mozambique 3Elizabeth Glaser Pediatric AIDS Foundation (EGPAF), Maputo, Mozambique *all authors contributed equally Corresponding Author: José António Nhavoto, MSc Informatics School of Business Örebro University Fakultetsgatan 1 Örebro, 70182 Sweden Phone: 46 760833032 Fax: 46 19332546 Email: [email protected] Abstract Background: The widespread and low cost of mobile phones and the convenience of short message service (SMS) text messaging suggest potential suitability for use with alternative strategies for supporting retention in care and adherence to the treatment of various chronic diseases, such as HIV and tuberculosis (TB). Despite the growing body of literature reporting positive outcomes of SMS text message-based communication with patients, there is yet very little research about the integration of communication technologies and electronic medical records or electronic patient tracking systems. Objective: To design, develop, and implement an integrated mobile phone text messaging system used to follow up with patients with HIV and TB in treatment in Mozambique. Methods: Following the design science research methodology, we developed a Web-based system that provides support to patients. A case study involving three health care sites in Mozambique was a basis for discussing design issues for this kind of system. We used brainstorming techniques to solicit usability requirements, focus group meetings to discuss and define system architecture, and prototyping to test in real environments and to improve the system.
    [Show full text]
  • View Preprint
    Fighting a moving target: Leapfrogging to new information systems for malaria vector monitoring and control Mauro Braganca, Bruno de Sousa, Jacques Derek Charlwood In order to adapt control efforts to the moving target of malaria, new ways of rapidly processing and using data are required to produce usable information. Portable electronic devices with software applications, collectively known as mHealth, are increasingly used to assist health services and manage patient information. Here we describe the development s t of an mHealth system, using mobile phones, for data collection and analysis in resource- n i constrained environments. The system overcomes many of the difficulties presented by r P other mHealth systems. An asynchronous, Internet connection-independent data collection e system, similar to web-based architecture, is proposed. Reporting and advanced statistical r P and epidemiological analysis, with external data integration, such as environmental datasets, is demonstrated by a pilot assessment of the system in Mozambique. We argue that this technology can provide the entomological and epidemiological information needed for sensible decision-making processes and the development of public health policies regarding malaria control. PeerJ PrePrints | http://dx.doi.org/10.7287/peerj.preprints.753v1 | CC-BY 4.0 Open Access | rec: 21 Dec 2014, publ: 21 Dec 2014 1 Leapfrogging to New Information Systems for Malaria Vector 2 Monitoring and Control 3 Mauro Braganca1,2 , Bruno de Sousa2 and J. Derek Charlwood 3,5 4 1: Faculdade de Medicina, Universidade de Lisboa, Lisbon, Portugal. 5 2: Centro de Malária e Doenças Tropicais, Instituto de Higiene e Medicina Tropical, 6 Universidade Nova de Lisboa, Lisbon, Portugal.
    [Show full text]
  • TAGR: Telehealth Automatically Generated Recommendations
    University of the Philippines Manila College of Arts and Sciences Department of Physical Sciences and Mathematics TAGR: Telehealth Automatically Generated Recommendations A special problem in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science Submitted by: Kryle Marxel E. Molina June 2016 Permission is given for the following people to have access to this SP: Available to the general public Yes Available only after consultation with author/SP adviser No Available only to those bound by confidentiality agreement No ACCEPTANCE SHEET The Special Problem entitled \TAGR: Telehealth Automatically Gen- erated Recommendations" prepared and submitted by Kryle Marxel E. Molina in partial fulfillment of the requirements for the degree of Bachelor of Science in Com- puter Science has been examined and is recommended for acceptance. Marvin John C. Ignacio, M.Sc.(candidate) Adviser EXAMINERS: Approved Disapproved 1. Gregorio B. Baes, Ph.D. (candidate) 2. Avegail D. Carpio, M.Sc. 3. Richard Bryann L. Chua, Ph.D. (candidate) 4. Perlita E. Gasmen, M.Sc. (candidate) 5. Ma. Sheila A. Magboo, M.Sc. 6. Vincent Peter C. Magboo, M.D., M.Sc. Accepted and approved as partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science. Ma. Sheila A. Magboo, M.Sc. Marcelina B. Lirazan, Ph.D. Unit Head Chair Mathematical and Computing Sciences Unit Department of Physical Sciences Department of Physical Sciences and Mathematics and Mathematics Leonardo R. Estacio Jr., Ph.D. Dean College of Arts and Sciences i Abstract Telehealth Automatically Generated Recommendations (TAGR) is a module for auto- matically classifying SMS and e-mail messages with their appropriate tags as required by the National Telehealth Center for their National Telehealth Service Program (NTSP).
    [Show full text]
  • Rapidsms Documentation Release 0.12.0
    RapidSMS Documentation Release 0.12.0 RapidSMS March 21, 2013 CONTENTS i ii RapidSMS Documentation, Release 0.12.0 Creating new SMS functionality can be done in a few simple steps: • create a model which inherits from rapidsms.apps.base.AppBase • save it as yourapplicationname/apps.py • add it to your INSTALLED_APPS list in settings.py. The most basic app could look like: from rapidsms.apps.base import AppBase class App(AppBase): def handle(self, message): message.respond("hello world") Notice that in the above example, only the ‘handle’ phase is implemented. RapidSMS apps can (but don’t have to) implement 6 phases: CONTENTS 1 RapidSMS Documentation, Release 0.12.0 2 CONTENTS CHAPTER ONE FILTER The first phase, before any actual work is done. This is the only phase that can entirely abort further processing of the incoming message, which it does by returning True. e.g. a filter to kill spam messages 3 RapidSMS Documentation, Release 0.12.0 4 Chapter 1. filter CHAPTER TWO PARSE Typically used to modify all messages in a way which is globally useful. Each apps parse phase will see all incoming messages that were not filtered. Don’t do INSERTs or UPDATEs in here! e.g. an app which adds metadata about phone number registration to each message 5 RapidSMS Documentation, Release 0.12.0 6 Chapter 2. parse CHAPTER THREE HANDLE Respond to messages here. The router will pass incoming messages through each apps ‘handle’ phase until one of them returns true. All subse- quent apps will never see the message.
    [Show full text]