sghi_core 0.3.189 copy "sghi_core: ^0.3.189" to clipboard
sghi_core: ^0.3.189 copied to clipboard

A set of reusable components used in myCareHub and myCareHub Professional

Release Maintained

sghi_core #

sghi_core is an open source project — it's one among many other shared libraries that make up the wider ecosystem of software made and open sourced by Savannah Informatics Limited.

Shared library for BeWell-Consumer and SladeAdvantage that is a wrapper for various shared helper methods and functions

Installation Instructions #

Use this package as a library by depending on it

Run this command:

  • With Flutter:****
flutter pub add sghi_core

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  sghi_core: ^0.3.189

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Lastly:

Import it like so:

import 'package:sghi_core/app_wrapper/app_wrapper.dart';

Usage #

Check the example provided for how to use this package.

Advantage patient model #

AdvantagePatient mirrors the Advantage backend's patient document, with its snake_case keys: a patient, its Person (contacts, identifiers, address, age and photos), the matched RegisteredPatientRef from a person search, and VitalReferenceRange bands per vital sign. Gender is read in any case and written in upper case (FEMALE); an unknown value reads as Gender.unknown.

import 'package:sghi_core/afya_moja_core/afya_moja_core.dart';

final AdvantagePatient patient = AdvantagePatient.fromJson(json);
final String? name = patient.person?.personDisplay;
final Map<String, dynamic> body = patient.toJson();

Dart & Flutter Version #

  • Dart 2: >= 3.0.6
  • Flutter: >=3.19.2

Developing & Contributing #

First off, thanks for taking the time to contribute!

Be sure to check out detailed instructions on how to contribute to this project here and go through out Code of Conduct.

GPG Signing: As a contributor, you need to sign your commits. For more details check here

License #

This library is distributed under the MIT license found in the LICENSE file.