8000 GitHub - lizzgilmore/prapare: A patient-facing Flutter app that allows for entry of Social Determinants of Health (SDOH) data in their own native language.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A patient-facing Flutter app that allows for entry of Social Determinants of Health (SDOH) data in their own native language.

License

Notifications You must be signed in to change notification settings

lizzgilmore/prapare

 
 

Repository files navigation

PRAPARE

A patient-facing Flutter app that allows for entry of Social Determinants of Health (SDOH) data in their own native language.

This app builds directly off of the work pioneered in the PRAPARE project, though at this time it is not formally affiliated with PRAPARE.

Design

A basic prototype and relevant wireframes were created in Figma prior to app creation.

Architecture

This app loosely follows the Model-View-Controller+Services (MVC+S) architecture, which has both simple and production-level examples of use. Whereas the above examples make heavy use of Provider, ChangeNotifier, and StatefulWidgets, we are instead using Get and some of the Getx pattern to simplify state management, routing, and dependency injection.

Our take on MVC+S is as follows:

  • model: The single point of failure between your data and the controllers/services that call them.
  • views: The UI layer, which is separated into multiple pages and may optionally be managed via a viewcontroller.
  • controller: The connection between models, services, and the UI. State is managed at the controller level and accesses the model directly.
  • service: Communicates with the outside world (e.g. internet or local file system).
  • command: high level 'god' functions that perform a specific task, often by fetching from a service and injecting into a controller.

Folder Structure

The following is the folder structure under the /lib folder:

  • /_internal - custom components/variations of existing Flutter widgets, utils, constants, and the like

  • /controllers - the controllers typically used to manage state and/or perform a function

    • /commands - performs a specific task (login, submit, edit) by the user
    • /services - connects the app to outside world (e.g. REST, http, file storage)
  • /models - the 'single point of failure' between a service and the controller that uses it

    • /data - the data types and observables used in the app. may include JSON serialization
  • /views - top level widgets that are loaded via a route

    • /<screen_name> - contains all code specific to this screen that is not shared
      • <screen_name>.dart - the screen widget, may optionally include 'page', 'card', or 'panel' at the end based view type
      • <screen_name>_binding.dart - the controllers that may be loaded (or lazy-loaded) in a specific view
      • <screen_name>_controller.dart - the viewcontroller that only affects this screen widget
      • <screen_name>_test.dart - any relevant tests for the screen widget or its viewcontroller
    • /shared - shared widgets
      • <widget_name>.dart
  • /routes - maps routes to screen widgets

    • app_pages.dart - the app
    • app_routes.dart - the string route names used in the app
  • api_keys.dart

  • constants.dart

  • main.dart

  • theme.dart - theme and builders

Questionnaire vs Survey

To differentiate between FHIR and our local data model, we have employed the term Survey

  • When an item is specifically related to FHIR and it's formatting, the term Questionnaire is used, along with the formatting for that FHIR resource
  • When it is part of the local model (including locally stored surveys/questionnaires) the term survey is used

To Use the Questionnaire Package

You would create a new object:

var questionnaire = FhirQuestionnaire();

Load the survey (currently hardcoded into the app, but will soon have ability to download from url)

questionnaire.loadAndCreateSurvey();

Anytime that a user has answered questions that you would like to keep track of, you can pass them back like this:

final responses = [
  UserResponse(
      surveyCode: '/93043-8',
      questionCode: '/93043-8/56051-6',
      answerCode: 'LA33-6'),
  UserResponse(
      surveyCode: '/93043-8',
      questionCode: '/93043-8/32624-9',
      answerCode: 'LA14042-8'),
];

questionnaire.getUserResponses(responses);

This can be done multiple times or once, the object will simply keep it as a list until you are finished. Then, when you're ready to create the final response, call the method:

questionnaire.createResponse();

Now you have a QuestionnaireResponse item that you can do with as you will. To print for instance:

print(questionnaire.response.toJson());

Style Guide

Follow the Dart style guide.

Of note, you should:

  • Use UpperCamelCase for types.
  • Use lowercase_snake_case for libraries, packages, directories, and files.
  • Use lowerCamelCase for constant names.
  • Use lowerCamelCase for everything else (like variable names).
  • Capitalize acronyms and abbreviations longer than two letters (Http rather than HTTP or http).
  • A leading underscore makes a member variable private. Only use it if it is private.
  • You can use single line if statements for returns.
  • Use /// instead of /** */ for multi-line comments.

For VS Code, install the Dart and Flutter plugin. Set your editor to format on save.

Questions

We have a Slack channel and welcome new members/contributors.

About

A patient-facing Flutter app that allows for entry of Social Determinants of Health (SDOH) data in their own native language.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 67.4%
  • Objective-C 30.7%
  • C 0.8%
  • Ruby 0.7%
  • Shell 0.3%
  • Swift 0.1%
0