Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.
/ ct_task Public archive

Flutter app viewer for patients in FHIR API

License

Notifications You must be signed in to change notification settings

Foxpace/ct_task

Repository files navigation

CT_task

Simple app, which takes data from http:https://hapi.fhir.org/ API and parse them into list. The app uses the patients GET endpoint, to obtain the patient data.

For state management the app uses the flutter_bloc plugin. The UI is created based on the states evoked by events. Everything can be found in bloc_module. The parsing of the Json data is being done by autogenerated code from json_serializable and build_runner. Patient object is created by parsed data (id, name, birthDate, deceasedDateTime, gender and full url to the patient at the API). The data are used to fill the list view with examinations for CT. The date and type of examination are generated randomly for each patient. Only the patients for today's day are visible. The search bar also works and patients can be found by id or name. If there is no internet, the list is empty or error occurred, the error page with appropriate message is shown and button to retry.

Structure of the app:

  • bloc_module
    • bloc_module.dart - maps events and holds reference to client
    • bloc_observer.dart - prints the events and states to console
    • events.dart
    • states.dart
  • fhir - api related files
    • json_types
      • json_patient.dart - json template classes
      • json_patient.g.dart - generated code for json parsing
    • types
      • examination.dart - object, with which the list view is filled
      • patient.dart - holds all the patient's data
    • api_client.dart - makes all the api calls and holds the data
    • filtration.dart - functions, which filter the patients by conditions
  • res
    • images.dart - paths to images
    • strings.dart - all used strings
  • widgets
    • custom_widgets
      • app_bar.dart
      • search_bar.dart
    • exams
      • exam_list.dart - creation of the list for all the examinations
      • exam_page.dart - merges the list, buttons and search bar
      • exam_tab.dart - widget for examination
    • error_page.dart - shows error and provides the button to retry
    • main_page.dart
  • main.dart
  • theme.dart - custom theme + other constants used across the project

Used resources:

Used libraries:

Screenshots:

loading

list

empty_search

no_internet

error