Wavemind / liwi-medal-reader

React native application used by clinician and feed by MedAL-Creator
https://dynamic-study.com
Other
7 stars 1 forks source link
dynamic-study medal-reader react-native

MedAl-Reader CI

React native application used by clinician and feed by MedAl-creator

Setup

This project was bootstrapped with TheCodingMachine React Native boilerplate.

Below you'll find information about performing common tasks.

Table of contents

Available scripts

If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing.

yarn run android

Runs your app in development mode.

yarn test

Runs the jest test runner on your tests.

yarn build only for Linux and MacOS

Generate release version of app

yarn w-build only for Windows

Generate release version of app

yarn test:watch

Watches your code and runs the tests everytime your code is edited

yarn np

Set version number, build number, generate a new release and create a changelog

Customizing app display name and icons

Please refer to TheCodingMachine React Native boilerplate instruction.

Data structure

Medical case

Field type Description
activities Array<Activity> Array of all activities related
comment text Clinician's comment set during the consultation stage
consent boolean Tells if the patient consented to share his data for the clinical research
created_at datetime Date & Time when the patient was created
diagnosis Diagnosis Contains all the date related to the diagnoses
id string (UUID) Unique identification string for a medical case
nodes Array<Node> Array of nodes
status string Tells what is the status of the medical case (closed / 1st assessments /...)
synchronized_at datetime Date & Time when the patient was sent to Medal-Data or Medal-hub
updated_at string (UUID) Date & Time when the patient was updated for the last time
version_id integer Medal-Creator's id of the version used
json_version integer Medal-Creator's incremental of the version used

Diagnoses

{ "proposed": [(array of node id)], "excluded": [(array of node id)], "refused": [(array of node id)], "additional": { "1" : { "id": "1", "managements": [(array of node id)] "drugs": { "agreed": { "14" : { "id": 14 "formulation_id" : 4 } }, "refused": [(array of node id)], "additional": { "15" : { "formulation_id" : 4 "duration": 5 # in days "addedAt": 1689546123 # unix timestamp } } } } }, "agreed": { "1" : { "id": "1", "managements": [(array of node id)] "drugs": { "agreed": { "14" : { "id": 14 "formulation_id" : 4 } }, "refused": [(array of node id)], "additional": { "15" : { "formulation_id" : 4 "duration": 5 # in days "addedAt": 1689546123 # unix timestamp } } } } }, "custom": { "uid" : { "id": uid, "name": "My name", "drugs": { "uid" : { "id": uid "name": "my custom drug", "duration": 5 # in days } } } } }

Icons available

A list of icons is available with react-native-vector-icons.

We also set a list of custom icons. We split it in 2 components

Date

We're using date-fns to handle date format. Good documentation can be found here

ColoredIcon

import { ColoredIcon } from '@/Components'
return <ColoredIcon name="about" />
Name
about alt text
consult alt text
home alt text
logout alt text
patient-list alt text
qr-scan alt text
settings alt text
summary alt text
synchronize alt text

Icon

import { Icon } from '@/Components'
return <Icon name="about" />

API

Swagger

alt text alt text alt text

Writing and running tests

This project is set up to use jest for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called __tests__ or with the .test extension to have the files loaded by jest. See the the template project for an example test. The jest documentation is also a wonderful resource, as is the React Native testing tutorial.

Publishing

We're using sementic for version number. We have set up react-native-version-setter to manage version number

 Uploading sourcemaps to Sentry using sentry-cli

Use the following code in the terminal replacing the "files" information with the current release number :

sentry-cli releases \ --org wavemind --project medal-reader \ files 1.3.0-1 \ upload-sourcemaps \ --strip-prefix . \ index.android.bundle index.android.bundle.map