Skip to content

Commit f5dded2

Browse files
Project Completed
0 parents  commit f5dded2

File tree

147 files changed

+7065
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+7065
-0
lines changed

.gitignore

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.packages
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
35+
# Web related
36+
lib/generated_plugin_registrant.dart
37+
38+
# Symbolication related
39+
app.*.symbols
40+
41+
# Obfuscation related
42+
app.*.map.json
43+
44+
# Android Studio will place build artifacts here
45+
/android/app/debug
46+
/android/app/profile
47+
/android/app/release

.metadata

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled.
5+
6+
version:
7+
revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
8+
channel: stable
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
17+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
18+
- platform: android
19+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
20+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
21+
- platform: ios
22+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
23+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
24+
- platform: linux
25+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
26+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
27+
- platform: macos
28+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
29+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
30+
- platform: web
31+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
32+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
33+
- platform: windows
34+
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
35+
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

README.md

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
<div align="center">
2+
3+
# MedRec
4+
5+
</div>
6+
7+
Medical records need innovation. Patients leave data scattered across various jurisdictions as life events take them away from one provider’s data to another. In doing so, they lose easy access to past data, as the provider, not the patient, generally retains primary stewardship. Patients thus interact with records in a broken manner that reflects the nature of how these records are managed. Patients with a huge medical history across many hospitals should not have to keep their history in the form of huge Patients and providers may face significant hurdles in initiating data retrieval and sharing due to economic incentives that encourage “health information blocking”. In the age of online banking and social media, patients are increasingly willing, able and desirous of managing their data on the web and on the go. This work explores a blockchain structure with its backend based on a Rinkeby Test network using Ethereum for its data storage and a smart contract for its data logic. Medical Records are data with sensitive information, and hence using DAPPS with smart contracts ensures safety features essential such as Zero Downtime (i.e. the data associated with a patient is always ready to be fetched and updated), Privacy (A Patient's data should be secured and of limited accessibility to only the people closely associated with the patient), Complete data integrity (The data must not be changed by someone in no authority to do so). This MedRec blockchain implementation seeks to solve this vast fragmentation of patient data by bringing it together and organizing it in the form of a ledger while providing it with the benefits provided by blockchain and DAPPs.
8+
9+
Hence, by implementing Medical records on the blockchain we achieve the following features which by other means could only be partially fulfilled or not fulfilled at all.
10+
11+
1. Non-Repudiation of Medical Records, i.e. once the prescription is received by a patient from a doctor, the transaction is stored digitally on the blockchain signed by the private keys of both the patient and the doctor, hence if either party refuses to claim the ownership of the transaction, it can be easily detected using the public key of both.
12+
2. Only the authorized doctor can suggest a prescription that is to be added to the patient records.
13+
3. The integrity that the prescription once added cannot be modified by any of the parties involved, i.e. the doctor, the patient or an attacker trying to harass the patient.
14+
4. Automated transactions using smart contracts i.e. Once the patient authorizes a doctor to suggest a prescription, money is automatically transferred from the patient’s wallet to the patient contract and once the doctor sends a prescription, the money is transferred from the patient contract to the doctor’s wallet. The prescription to be sent is based on the mutual trust between the doctor and the patient and is not regulated by the application.
15+
16+
5. The contracts were created with vulnerabilities like Re-entrancy, transaction ordering, value underflow-overflow etc. in mind hence the application is safe to use under such circumstances if they shall prevail.
17+
18+
19+
<div align="center">
20+
21+
## Contents
22+
23+
[Download APK](#Download-APK)[How to Use](#how-to-use)[Screen Shots](#screen-shots)[Libraries & Tools Used](#libraries--tools-used)[Folder Structure](#folder-structure)[Routes](#routes)[Main](#main)[Contracts](#Solidity-Contracts)
24+
25+
</div>
26+
27+
28+
## Download APK
29+
You can download the latest installable version of MedRec for Android: [MedRec.apk](https://drive.google.com/file/d/1oYe_ooBF0s332pzXtK_F1dMYXNUxp_zF/view?usp=sharing)
30+
31+
32+
## How to Use
33+
34+
**Step 1:**
35+
36+
Download or clone this repo by using the link below:
37+
38+
```
39+
https://github.com/Abhishekkr3003/MedRec.git
40+
```
41+
42+
**Step 2:**
43+
44+
Go to project root and execute the following command in console to get the required dependencies (make sure you have flutter installed successfully):
45+
46+
```
47+
flutter pub get
48+
```
49+
50+
**Step 3:**
51+
52+
Connect your device and run:
53+
54+
```
55+
flutter run
56+
```
57+
58+
59+
## Screenshots
60+
<table>
61+
62+
<tr>
63+
<td><img src="Screenshots/1.png" width=270 height=580></td>
64+
<td><img src="Screenshots/2.png" width=270 height=580></td>
65+
<td><img src="Screenshots/3.png" width=270 height=580></td>
66+
</tr>
67+
<tr>
68+
<td><img src="Screenshots/4.png" width=270 height=580></td>
69+
<td><img src="Screenshots/5.png" width=270 height=580></td>
70+
<td><img src="Screenshots/6.png" width=270 height=580></td>
71+
</tr>
72+
<tr>
73+
<td><img src="Screenshots/7.png" width=270 height=580></td>
74+
<td><img src="Screenshots/8.png" width=270 height=580></td>
75+
</tr>
76+
</table>
77+
78+
79+
## Libraries & Tools Used
80+
81+
* [web3dart](https://github.com/xclud/web3dart)
82+
* [http](https://github.com/dart-lang/http)
83+
* [Cupertino_Icons](https://github.com/flutter/packages/tree/master/third_party/packages/cupertino_icons)
84+
* [font_awesome_flutter](https://github.com/fluttercommunity/font_awesome_flutter)
85+
* [FlutterToast](https://github.com/PonnamKarthik/FlutterToast)
86+
* [Google Fonts](https://github.com/material-foundation/google-fonts-flutter/)
87+
88+
## Folder Structure
89+
Here is the core folder structure which flutter provides.
90+
91+
```
92+
flutter-app/
93+
|- android
94+
|- assets
95+
|- build
96+
|- ios
97+
|- lib
98+
|- test
99+
|- linux
100+
|- macos
101+
|- test
102+
|- web
103+
|- windows
104+
```
105+
106+
Here is the folder structure we have been using in this project
107+
108+
```
109+
assets/
110+
|- contracts/
111+
|- doctor.json
112+
|- patient.json
113+
|- Icons/
114+
|- 1024.png
115+
|-images
116+
|-welcomeImage.png
117+
118+
lib/
119+
|- Pages/
120+
|- doctor_home_page.dart
121+
|- login.dart
122+
|- patient_home_page.dart
123+
|- splash_screen.dart
124+
|- view_prescription.dart
125+
126+
|- Utils/
127+
|- routes.dart
128+
|- routes.dart
129+
130+
|- main.dart
131+
```
132+
133+
## Routes
134+
135+
This file contains all the routes for your application.
136+
137+
```dart
138+
import 'package:flutter/material.dart';
139+
import 'package:medrec/Pages/doctor_home_page.dart';
140+
import 'package:medrec/Pages/login.dart';
141+
import 'package:medrec/Pages/patient_home_page.dart';
142+
143+
class MyRoutes {
144+
static const String loginPage = "/loginPage";
145+
static const String doctorHomePage = "/doctorHome";
146+
static const String patientHomePage = "/patientHome";
147+
148+
static final routes = <String, WidgetBuilder>{
149+
loginPage: (context) => const LoginPage(),
150+
doctorHomePage: (context) => const DoctorHomePage(),
151+
patientHomePage: (context) => const PatientHomePage(),
152+
};
153+
}
154+
155+
```
156+
157+
## Main
158+
159+
This is the starting point of the application. All the application level configurations are defined in this file i.e, theme, routes, title, orientation etc.
160+
161+
```dart
162+
import 'package:flutter/material.dart';
163+
import 'package:flutter/services.dart';
164+
import 'package:google_fonts/google_fonts.dart';
165+
import 'Pages/splash_screen.dart';
166+
import 'Utils/routes.dart';
167+
168+
void main() {
169+
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
170+
statusBarColor: Colors.black, statusBarIconBrightness: Brightness.light));
171+
runApp(const MyApp());
172+
}
173+
174+
class MyApp extends StatelessWidget {
175+
const MyApp({Key? key}) : super(key: key);
176+
177+
@override
178+
Widget build(BuildContext context) {
179+
return MaterialApp(
180+
debugShowCheckedModeBanner: false,
181+
theme: ThemeData(
182+
textTheme: GoogleFonts.poppinsTextTheme(
183+
Theme.of(context).textTheme,
184+
),
185+
),
186+
home: const Splash2(),
187+
routes: MyRoutes.routes,
188+
);
189+
}
190+
}
191+
192+
```
193+
194+
## Solidity Contracts
195+
[Doctor](https://github.com/Abhishekkr3003/Medrec/solidity_contracts/doctor.sol)
196+
197+
198+
[Patient](https://github.com/Abhishekkr3003/Medrec/solidity_contracts/patient.sol)
199+

Screenshots/1.png

656 KB
Loading

Screenshots/2.png

646 KB
Loading

Screenshots/3.png

650 KB
Loading

Screenshots/4.png

775 KB
Loading

Screenshots/5.png

871 KB
Loading

Screenshots/6.png

782 KB
Loading

Screenshots/7.png

659 KB
Loading

Screenshots/8.png

731 KB
Loading

analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

android/.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks

0 commit comments

Comments
 (0)