Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into patient_arrival_ist

 Conflicts:
	lib/client/base_app_client.dart
	lib/config/config.dart
	lib/core/service/patient_service.dart
	lib/core/viewModel/patient_view_model.dart
	lib/lookups/patient_lookup.dart
	lib/models/patient/patiant_info_model.dart
	lib/screens/patients/patients_screen.dart
ipd-changes-for-vida-plus
Elham Rababah 6 years ago
commit dccf474e70

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -7,6 +7,8 @@ PODS:
- connectivity (0.0.1): - connectivity (0.0.1):
- Flutter - Flutter
- Reachability - Reachability
- connectivity_for_web (0.1.0):
- Flutter
- connectivity_macos (0.0.1): - connectivity_macos (0.0.1):
- Flutter - Flutter
- device_info (0.0.1): - device_info (0.0.1):
@ -22,17 +24,27 @@ PODS:
- Flutter - Flutter
- local_auth (0.0.1): - local_auth (0.0.1):
- Flutter - Flutter
- maps_launcher (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11) - MTBBarcodeScanner (5.0.11)
- OpenTok (2.15.3) - OpenTok (2.15.3)
- "permission_handler (5.0.0+hotfix.5)": - path_provider_linux (0.0.1):
- Flutter
- path_provider_windows (0.0.1):
- Flutter
- "permission_handler (5.0.1+1)":
- Flutter - Flutter
- Reachability (3.2) - Reachability (3.2)
- shared_preferences (0.0.1): - shared_preferences (0.0.1):
- Flutter - Flutter
- shared_preferences_linux (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1): - shared_preferences_macos (0.0.1):
- Flutter - Flutter
- shared_preferences_web (0.0.1): - shared_preferences_web (0.0.1):
- Flutter - Flutter
- shared_preferences_windows (0.0.1):
- Flutter
- speech_to_text (0.0.1): - speech_to_text (0.0.1):
- Flutter - Flutter
- Try - Try
@ -40,15 +52,20 @@ PODS:
- Try (2.1.1) - Try (2.1.1)
- url_launcher (0.0.1): - url_launcher (0.0.1):
- Flutter - Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1): - url_launcher_macos (0.0.1):
- Flutter - Flutter
- url_launcher_web (0.0.1): - url_launcher_web (0.0.1):
- Flutter - Flutter
- url_launcher_windows (0.0.1):
- Flutter
DEPENDENCIES: DEPENDENCIES:
- Alamofire - Alamofire
- barcode_scan (from `.symlinks/plugins/barcode_scan/ios`) - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`) - connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
- device_info (from `.symlinks/plugins/device_info/ios`) - device_info (from `.symlinks/plugins/device_info/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
@ -57,15 +74,22 @@ DEPENDENCIES:
- hexcolor (from `.symlinks/plugins/hexcolor/ios`) - hexcolor (from `.symlinks/plugins/hexcolor/ios`)
- imei_plugin (from `.symlinks/plugins/imei_plugin/ios`) - imei_plugin (from `.symlinks/plugins/imei_plugin/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`) - local_auth (from `.symlinks/plugins/local_auth/ios`)
- maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
- OpenTok - OpenTok
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`) - permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
SPEC REPOS: SPEC REPOS:
trunk: trunk:
@ -81,6 +105,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/barcode_scan/ios" :path: ".symlinks/plugins/barcode_scan/ios"
connectivity: connectivity:
:path: ".symlinks/plugins/connectivity/ios" :path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
:path: ".symlinks/plugins/connectivity_for_web/ios"
connectivity_macos: connectivity_macos:
:path: ".symlinks/plugins/connectivity_macos/ios" :path: ".symlinks/plugins/connectivity_macos/ios"
device_info: device_info:
@ -97,27 +123,42 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/imei_plugin/ios" :path: ".symlinks/plugins/imei_plugin/ios"
local_auth: local_auth:
:path: ".symlinks/plugins/local_auth/ios" :path: ".symlinks/plugins/local_auth/ios"
maps_launcher:
:path: ".symlinks/plugins/maps_launcher/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_windows:
:path: ".symlinks/plugins/path_provider_windows/ios"
permission_handler: permission_handler:
:path: ".symlinks/plugins/permission_handler/ios" :path: ".symlinks/plugins/permission_handler/ios"
shared_preferences: shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios" :path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_linux:
:path: ".symlinks/plugins/shared_preferences_linux/ios"
shared_preferences_macos: shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios" :path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web: shared_preferences_web:
:path: ".symlinks/plugins/shared_preferences_web/ios" :path: ".symlinks/plugins/shared_preferences_web/ios"
shared_preferences_windows:
:path: ".symlinks/plugins/shared_preferences_windows/ios"
speech_to_text: speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios" :path: ".symlinks/plugins/speech_to_text/ios"
url_launcher: url_launcher:
:path: ".symlinks/plugins/url_launcher/ios" :path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos: url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios" :path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web: url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios" :path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18
barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479 barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479
connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
@ -126,20 +167,27 @@ SPEC CHECKSUMS:
hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735
permission_handler: 6226fcb78b97c7c7458a95c7346a11d5184fec12 path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932 SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.9.3 COCOAPODS: 1.10.0

@ -3,11 +3,9 @@ import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:provider/provider.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
@ -30,7 +28,7 @@ Helpers helpers = new Helpers();
* */ * */
class BaseAppClient { class BaseAppClient {
//TODO change the post fun to nun static when you change all service //TODO change the post fun to nun static when you change all service
post( post(
String endPoint, { String endPoint, {
Map<String, dynamic> body, Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
@ -38,20 +36,21 @@ class BaseAppClient {
}) async { }) async {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;
try { try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //TODO change it edit By Jammal
String token = await sharedPref.getString(TOKEN); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { // String token = await sharedPref.getString(TOKEN);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); // if (profile != null) {
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
body['DoctorID'] = doctorProfile?.doctorID; // if (body['DoctorID'] == null)
body['EditedBy'] = doctorProfile?.doctorID; body['DoctorID'] = 4709;//doctorProfile?.doctorID;
body['ProjectID'] = doctorProfile?.projectID; body['EditedBy'] = 4709;//doctorProfile?.doctorID;
if (body['ClinicID'] == null) //if (body['ProjectID'] == null) {
body['ClinicID'] = doctorProfile?.clinicID; body['ProjectID'] = 15;//doctorProfile?.projectID;
} // }
body['TokenID'] = token ?? ''; // if (body['ClinicID'] == null)
body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiMDBmMDI3NjQtZDczMi00NDA0LThkYmUtZWViZDkwY2EzM2JiIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1NzYyMDYiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODIyMjUwNiwiZXhwIjoxNjA5MDg2NTA2LCJpYXQiOjE2MDgyMjI1MDZ9.X_66vZw08tiH4DmhKUPXzIiIMrnadE2IHe0wOA0GM6g"; body['ClinicID'] = 1;//doctorProfile?.clinicID;
// }
body['TokenID'] = "@dm!n";//token ?? '';
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar') if (lang != null && lang == 'ar')
body['LanguageID'] = 1; body['LanguageID'] = 1;
@ -65,6 +64,11 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID; body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA; body['PatientOutSA'] = 0; // PATIENT_OUT_SA;
body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaRefreshTokenID'] ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU";
//await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
@ -76,23 +80,24 @@ class BaseAppClient {
'Accept': 'application/json' 'Accept': 'application/json'
}); });
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
// TODO: return it back when backend fixed
// if (!parsed['IsAuthenticated']) { // if (!parsed['IsAuthenticated']) {
// await helpers.logout(); // // TODO: return it back when IsAuthenticated work fine in all service
// // await helpers.logout();
// //
// helpers.showErrorToast('Your session expired Please login agian'); // helpers.showErrorToast('Your session expired Please login agian');
// } else // } else
if (parsed['MessageStatus'] == 1) {
// if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated'])
onSuccess(parsed, statusCode); onFailure(getError(parsed), statusCode);
// } else { else
// onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], onSuccess(parsed, statusCode);
// statusCode); } else {
// } onFailure(getError(parsed), statusCode);
}
} }
} else { } else {
onFailure('Please Check The Internet Connection', -1); onFailure('Please Check The Internet Connection', -1);
@ -102,4 +107,27 @@ class BaseAppClient {
onFailure(e.toString(), -1); onFailure(e.toString(), -1);
} }
} }
String getError(parsed) {
//TODO change this fun
String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];
if (parsed["ValidationErrors"] != null) {
error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null &&
parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
for (var i = 0;
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +
parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +
"\n";
}
}
}
if(error == null || error == "null" || error == "null\n"){
return "This server not work probably in this time";
}
return error;
}
} }

@ -1,3 +1,5 @@
import 'package:flutter/material.dart';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
@ -22,10 +24,13 @@ const PATIENT_GET_LIST_REFERAL_URL =
"Services/Lists.svc/REST/GetList_STPReferralFrequency"; "Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL = const PATIENT_GET_CLINIC_BY_PROJECT_URL =
"Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; "Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP';
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA =
'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_LAB_OREDERS = const GET_PATIENT_LAB_OREDERS =
'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; 'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
@ -57,6 +62,15 @@ const ADD_REFERRED_DOCTOR_REMARKS =
const GET_MY_REFERRED_PATIENT = const GET_MY_REFERRED_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; 'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral';
const GET_DOCTOR_WORKING_HOURS_TABLE = const GET_DOCTOR_WORKING_HOURS_TABLE =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
@ -71,12 +85,58 @@ const SELECT_DEVICE_IMEI =
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const MEMBER_CHECK_ACTIVATION_CODE_NEW = const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; 'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_DASHBOARD =
'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
const GET_SICKLEAVE_STATISTIC =
'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL =
'Services/DoctorApplication.svc/REST/PatientArrivalList​';
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/GetPrescription';
const POST_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetProcedure';
const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_ARRIVAL_LIST =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
// SOAP
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const GET_MASTER_LOOKUP_LIST =
'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE =
'Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT =
'Services/DoctorApplication.svc/REST/PostAssessment';
const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetCategories';
var selectedPatientType = 1; var selectedPatientType = 1;
@ -141,4 +201,5 @@ const TIMER_MIN = 10;
class AppGlobal { class AppGlobal {
static var CONTEX; static var CONTEX;
static Color appPrimaryColor = Color(0xFFB9382C);
} }

@ -49,6 +49,7 @@ const Map<String, Map<String, String>> localizedValues = {
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'referPatient': {'en': 'Refer Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'},
'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'},
@ -201,6 +202,10 @@ const Map<String, Map<String, String>> localizedValues = {
'routine': {'en': 'Routine', 'ar': 'روتيني'}, 'routine': {'en': 'Routine', 'ar': 'روتيني'},
'send': {'en': 'Send', 'ar': 'ارسال'}, 'send': {'en': 'Send', 'ar': 'ارسال'},
'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'}, 'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'},
'selectReferralFrequency': {
'en': 'Select Referral Frequency:',
'ar': 'اختار تواتر الحالة:'
},
'clinicalDetailsAndRemarks': { 'clinicalDetailsAndRemarks': {
'en': 'Clinical Details and Remarks', 'en': 'Clinical Details and Remarks',
'ar': 'التفاصيل السرسرية والملاحظات' 'ar': 'التفاصيل السرسرية والملاحظات'
@ -229,6 +234,7 @@ const Map<String, Map<String, String>> localizedValues = {
'beingBad': {'en': 'being bad', 'ar': 'سيء'}, 'beingBad': {'en': 'being bad', 'ar': 'سيء'},
'beingGreat': {'en': 'being great', 'ar': 'رائع'}, 'beingGreat': {'en': 'being great', 'ar': 'رائع'},
'cancel': {'en': 'CANCEL', 'ar': 'الغاء'}, 'cancel': {'en': 'CANCEL', 'ar': 'الغاء'},
'ok': {'en': 'OK', 'ar': 'موافق'},
'done': {'en': 'DONE', 'ar': 'تأكيد'}, 'done': {'en': 'DONE', 'ar': 'تأكيد'},
'resumecall': {'en': 'Resume call', 'ar': 'استئناف المكالمة'}, 'resumecall': {'en': 'Resume call', 'ar': 'استئناف المكالمة'},
'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'}, 'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'},
@ -255,17 +261,21 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'لا يوجد اي نتائج' 'ar': 'لا يوجد اي نتائج'
}, },
'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'},
'moreThan3Letter': { 'moreThan3Letter': {
'en': 'Medicine Name Should Be More Than 3 letter', 'en': 'Medicine Name Should Be More Than 3 letter',
'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف'
}, },
'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '},
'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '},
'replySuccessfully': { 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'},
'en': 'Reply Successfully', "sick-leaves": {"en": "Patient Sick Leave", "ar": "الاجازات المرضية"},
'ar': 'تم الرد بنجاح' "patient-sick": {"en": "Patient Sick", "ar": "المرضية"},
}, "leave": {"en": "Leave", "ar": "غادر"},
"submit": {"en": "Submit", "ar": "ارسال"},
"doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"},
"clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"},
"sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."},
"sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."},
'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '},
'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'},
'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'},
@ -273,4 +283,96 @@ const Map<String, Map<String, String>> localizedValues = {
'area': {'en': 'AREA:', 'ar': 'المنطقة'}, 'area': {'en': 'AREA:', 'ar': 'المنطقة'},
'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'room': {'en': 'ROOM:', 'ar': 'الغرفة'},
'bed': {'en': 'BED:', 'ar': 'السرير'}, 'bed': {'en': 'BED:', 'ar': 'السرير'},
'next': {'en': 'Next', 'ar': 'التالي'},
'healthRecordInformation': {
'en': 'HEALTH RECORD INFORMATION',
'ar': 'معلومات السجل الصحي'
},
"prevoius-sickleave-issed": {
"en": "Total previous sick leave issued by the doctor",
"ar": "مجموع الإجازات المرضية السابقة التي أصدرها الطبيب"
},
'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'},
'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'},
"empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"},
'no-sickleve-applied': {
'en': "No sick leave applied",
'ar': 'لم تطبق إجازة مرضية'
},
'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'},
'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'},
'add': {'en': "Add", 'ar': 'أضف'},
'approved': {'en': "Approved", 'ar': 'وافق'},
'extended': {'en': "Extended", 'ar': 'وسعوا'},
'pending': {'en': "Pending", 'ar': 'قيد الانتظار'},
'leave-start-date': {'en': "Leave start date", 'ar': 'تاريخ بدء المغادرة'},
'days-sick-leave': {'en': "DAYS OF SICK LEAVE", 'ar': 'أيام الإجازة المرضية'},
'extend': {'en': "Extend", 'ar': 'تمديد'},
'extend-sickleave': {
'en': "EXTEND SICK LEAVE",
'ar': 'قم بتمديد الإجازة المرضية'
},
"chiefComplaintLength": {
"en": "Chief Complaint length should be greater than 25",
"ar": "يجب أن يكون طول شكوى الرئيس أكبر من 25"
},
'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'},
'no-priscription-listed': {
'en': 'No Prescription Listed',
'ar': 'لا وصفة طبية مدرجة'
},
'referTo': {'en': "Refer To", 'ar': 'محال إلى'},
'referredFrom': {'en': "Referred From", 'ar': 'محال من'},
'branch': {'en': "Branch", 'ar': 'الفرع'},
'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'},
'appointmentNo': {'en': "Appointment #:", 'ar': '# الموعد:'},
'refer': {'en': "REFER", 'ar': 'إحالة'},
'rejected': {'en': "Rejected", 'ar': 'مرفوض'},
'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'},
'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'},
'dr': {'en': "DR.", 'ar': 'د.'},
'previewHealth': {'en': "Preview Health", 'ar': 'معاينة الصحة'},
'summaryReport': {'en': "Summary Report", 'ar': 'تقرير موجز'},
'accept': {'en': "ACCEPT", 'ar': 'قبول'},
'reject': {'en': "REJECT", 'ar': 'رفض'},
'noAppointmentsErrorMsg': {
'en': "There is no appointments for at this date",
'ar': 'لا توجد مواعيد في هذا التاريخ'
},
'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '},
'noPrescriptionListed': {
'en': 'NO PRESCRIPTION LISTED',
'ar': 'لم يتم سرد أي وصف'
},
'addNow': {'en': 'ADD Now', 'ar': 'اضف الآن'},
'orderType': {'en': 'Order Type', 'ar': 'نوع الطلب'},
'strength': {'en': 'Strength', 'ar': 'شدة'},
'doseTime': {'en': 'Dose Time', 'ar': 'وقت الجرعة'},
'indication': {'en': 'Indication', 'ar': 'دواعي الاستخدام'},
'duration': {'en': 'Duration', 'ar': 'المدة الزمنية'},
'instruction': {'en': 'Instructions', 'ar': 'إرشادات'},
'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'},
'route': {'en': 'Route', 'ar': 'المسار'},
'weight': {'en': "Weight", 'ar': 'الوزن'},
'kg': {'en': "kg", 'ar': 'كغ'},
'height': {'en': "Height", 'ar': 'الطول'},
'cm': {'en': "cm", 'ar': 'سم'},
'idealBodyWeight': {'en': "Ideal Body Weight", 'ar': 'وزن الجسم المثالي'},
'waistSize': {'en': "Waist Size", 'ar': 'مقاس الخصر'},
'inch': {'en': "Inch", 'ar': 'إنش'},
'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'},
'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'},
'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'},
'method': {'en': "Method", 'ar': 'الطريقة'},
'pulseBeats': {'en': 'Pulse(beats/minute)', 'ar': ' (دقة/دقيقة)النبض'},
'rhythm': {'en': "Rhythm", 'ar': 'الإيقاع'},
'respBeats': {'en': 'RESP (beats/minute)', 'ar': ' (دقة/دقيقة)التنفس'},
'patternOfRespiration': {'en': "Pattern Of Respiration", 'ar': 'نمط التنفس'},
'bloodPressureDiastoleAndSystole': {'en': 'Blood Pressure (Sys, Dias)', 'ar': 'ضغط الدم (العظمى, الصغرى)'},
'cuffLocation': {'en': "Cuff Location", 'ar': 'موقع الكف'},
'cuffSize': {'en': "Cuff Size", 'ar': 'حجم الكف'},
'patientPosition': {'en': "Patient Position", 'ar': 'موقع المريض'},
'fio2': {'en': "FIO2(%)", 'ar': 'FIO2(%)'},
'sao2': {'en': "SAO2(%)", 'ar': 'SAO2(%)'},
'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'},
}; };

@ -1,10 +1,12 @@
final TOKEN = 'token'; final TOKEN = 'token';
final PROJECT_ID = 'projectID'; final PROJECT_ID = 'projectID';
//===========amjad============ final VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID';
final VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID';
final LOGIN_TOKEN_ID = 'LogInToken';
final DOCTOR_ID = 'doctorID'; final DOCTOR_ID = 'doctorID';
//=======================
final SLECTED_PATIENT_TYPE = 'slectedPatientType'; final SLECTED_PATIENT_TYPE = 'slectedPatientType';
final APP_Language = 'language'; final APP_Language = 'language';
final DOCTOR_PROFILE = 'doctorProfile'; final DOCTOR_PROFILE = 'doctorProfile';
final LIVE_CARE_PATIENT = 'livecare-patient-profile'; final LIVE_CARE_PATIENT = 'livecare-patient-profile';
final LOGGED_IN_USER = 'loggedUser'; final LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data';

@ -0,0 +1,57 @@
enum MasterKeysService {
Allergies,
HistoryFamily,
HistoryMedical,
HistorySocial,
HistorySports,
HistorySurgical,
PhysicalExamination,
AllergySeverity,
physiotherapyGoals,
DiagnosisCondition,
DiagnosisType,
ICD10
}
extension SelectedMasterKeysService on MasterKeysService {
// ignore: missing_return
int getMasterKeyService() {
switch (this) {
case MasterKeysService.Allergies:
return 11;
break;
case MasterKeysService.HistoryFamily:
return 36;
break;
case MasterKeysService.HistoryMedical:
return 37;
break;
case MasterKeysService.HistorySocial:
return 38;
break;
case MasterKeysService.HistorySports:
return 39;
break;
case MasterKeysService.HistorySurgical:
return 66;
break;
case MasterKeysService.PhysicalExamination:
return 59;
break;
case MasterKeysService.AllergySeverity:
return 55;
break;
case MasterKeysService.physiotherapyGoals:
return 117;
break;case MasterKeysService.DiagnosisCondition:
return 34;
break;
case MasterKeysService.DiagnosisType:
return 35;
break;
case MasterKeysService.ICD10:
return 2500;
break;
}
}
}

@ -0,0 +1,106 @@
class PostPrescriptionReqModel {
String vidaAuthTokenID;
int clinicID;
int episodeID;
int appointmentNo;
int patientMRN;
List<PrescriptionRequestModel> prescriptionRequestModel;
PostPrescriptionReqModel(
{this.vidaAuthTokenID =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiYTYxZjAyZjItNzUwZS00MTZkLWEzOTQtZTRjZmViZGVjMDE5IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUzNTIiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODUzMDAyNywiZXhwIjoxNjA5Mzk0MDI3LCJpYXQiOjE2MDg1MzAwMjd9.M1NTREPgz5vQH_GTZ_KGb0xQW5HEDs47AtNR3jbqnms",
this.clinicID = 1,
this.episodeID = 200012117,
this.appointmentNo = 2016054573,
this.patientMRN = 3120690,
this.prescriptionRequestModel});
PostPrescriptionReqModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
clinicID = json['ClinicID'];
episodeID = json['EpisodeID'];
appointmentNo = json['AppointmentNo'];
patientMRN = json['PatientMRN'];
if (json['prescriptionRequestModel'] != null) {
prescriptionRequestModel = new List<PrescriptionRequestModel>();
json['prescriptionRequestModel'].forEach((v) {
prescriptionRequestModel.add(new PrescriptionRequestModel.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['ClinicID'] = this.clinicID;
data['EpisodeID'] = this.episodeID;
data['AppointmentNo'] = this.appointmentNo;
data['PatientMRN'] = this.patientMRN;
if (this.prescriptionRequestModel != null) {
data['prescriptionRequestModel'] =
this.prescriptionRequestModel.map((v) => v.toJson()).toList();
}
return data;
}
}
class PrescriptionRequestModel {
int itemId;
String doseStartDate;
int duration;
int dose;
int doseUnitId;
int route;
int frequency;
int doseTime;
bool covered;
bool approvalRequired;
String remarks;
String icdcode10Id;
PrescriptionRequestModel(
{this.itemId = 4,
this.doseStartDate = "2020-12-20T13:07:41.769Z",
this.duration = 2,
this.dose = 1,
this.doseUnitId = 1,
this.route = 1,
this.frequency = 1,
this.doseTime = 1,
this.covered = true,
this.approvalRequired = true,
this.remarks = "test1",
this.icdcode10Id = "test3"});
PrescriptionRequestModel.fromJson(Map<String, dynamic> json) {
itemId = json['itemId'];
doseStartDate = json['doseStartDate'];
duration = json['duration'];
dose = json['dose'];
doseUnitId = json['doseUnitId'];
route = json['route'];
frequency = json['frequency'];
doseTime = json['doseTime'];
covered = json['covered'];
approvalRequired = json['approvalRequired'];
remarks = json['remarks'];
icdcode10Id = json['icdcode10Id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['itemId'] = this.itemId;
data['doseStartDate'] = this.doseStartDate;
data['duration'] = this.duration;
data['dose'] = this.dose;
data['doseUnitId'] = this.doseUnitId;
data['route'] = this.route;
data['frequency'] = this.frequency;
data['doseTime'] = this.doseTime;
data['covered'] = this.covered;
data['approvalRequired'] = this.approvalRequired;
data['remarks'] = this.remarks;
data['icdcode10Id'] = this.icdcode10Id;
return data;
}
}

@ -0,0 +1,157 @@
class PrescriptionModel {
List<EntityList> entityList;
dynamic rowcount;
dynamic statusMessage;
PrescriptionModel({this.entityList, this.rowcount, this.statusMessage});
PrescriptionModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) {
entityList = new List<EntityList>();
json['entityList'].forEach((v) {
entityList.add(new EntityList.fromJson(v));
});
}
rowcount = json['rowcount'];
statusMessage = json['statusMessage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.entityList != null) {
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
}
data['rowcount'] = this.rowcount;
data['statusMessage'] = this.statusMessage;
return data;
}
}
class EntityList {
dynamic appointmentNo;
dynamic clinicName;
dynamic createdBy;
dynamic createdOn;
dynamic doctorName;
dynamic doseDailyQuantity;
dynamic doseDailyUnitID;
dynamic doseDetail;
dynamic doseDurationDays;
dynamic doseTimingID;
dynamic episodeID;
dynamic frequencyID;
dynamic icdCode10ID;
dynamic indication;
dynamic isDispensed;
dynamic isMedicineCovered;
dynamic isSIG;
dynamic medicationName;
dynamic medicationPrice;
dynamic medicineCode;
dynamic orderTypeDescription;
dynamic qty;
dynamic quantity;
dynamic remarks;
dynamic routeID;
dynamic startDate;
dynamic status;
dynamic stopDate;
dynamic uom;
EntityList(
{this.appointmentNo,
this.clinicName,
this.createdBy,
this.createdOn,
this.doctorName,
this.doseDailyQuantity,
this.doseDailyUnitID,
this.doseDetail,
this.doseDurationDays,
this.doseTimingID,
this.episodeID,
this.frequencyID,
this.icdCode10ID,
this.indication,
this.isDispensed,
this.isMedicineCovered,
this.isSIG,
this.medicationName,
this.medicationPrice,
this.medicineCode,
this.orderTypeDescription,
this.qty,
this.quantity,
this.remarks,
this.routeID,
this.startDate,
this.status,
this.stopDate,
this.uom});
EntityList.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo'];
clinicName = json['clinicName'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
doctorName = json['doctorName'];
doseDailyQuantity = json['doseDailyQuantity'];
doseDailyUnitID = json['doseDailyUnitID'];
doseDetail = json['doseDetail'];
doseDurationDays = json['doseDurationDays'];
doseTimingID = json['doseTimingID'];
episodeID = json['episodeID'];
frequencyID = json['frequencyID'];
icdCode10ID = json['icdCode10ID'];
indication = json['indication'];
isDispensed = json['isDispensed'];
isMedicineCovered = json['isMedicineCovered'];
isSIG = json['isSIG'];
medicationName = json['medicationName'];
medicationPrice = json['medicationPrice'];
medicineCode = json['medicineCode'];
orderTypeDescription = json['orderTypeDescription'];
qty = json['qty'];
quantity = json['quantity'];
remarks = json['remarks'];
routeID = json['routeID'];
startDate = json['startDate'];
status = json['status'];
stopDate = json['stopDate'];
uom = json['uom'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo;
data['clinicName'] = this.clinicName;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['doctorName'] = this.doctorName;
data['doseDailyQuantity'] = this.doseDailyQuantity;
data['doseDailyUnitID'] = this.doseDailyUnitID;
data['doseDetail'] = this.doseDetail;
data['doseDurationDays'] = this.doseDurationDays;
data['doseTimingID'] = this.doseTimingID;
data['episodeID'] = this.episodeID;
data['frequencyID'] = this.frequencyID;
data['icdCode10ID'] = this.icdCode10ID;
data['indication'] = this.indication;
data['isDispensed'] = this.isDispensed;
data['isMedicineCovered'] = this.isMedicineCovered;
data['isSIG'] = this.isSIG;
data['medicationName'] = this.medicationName;
data['medicationPrice'] = this.medicationPrice;
data['medicineCode'] = this.medicineCode;
data['orderTypeDescription'] = this.orderTypeDescription;
data['qty'] = this.qty;
data['quantity'] = this.quantity;
data['remarks'] = this.remarks;
data['routeID'] = this.routeID;
data['startDate'] = this.startDate;
data['status'] = this.status;
data['stopDate'] = this.stopDate;
data['uom'] = this.uom;
return data;
}
}

@ -0,0 +1,18 @@
class PrescriptionReqModel {
String vidaAuthTokenID;
dynamic patientMRN;
PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN});
PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
return data;
}
}

@ -0,0 +1,18 @@
class CategoriseProcedureModel {
String categoryID;
String categoryName;
CategoriseProcedureModel({this.categoryID, this.categoryName});
CategoriseProcedureModel.fromJson(Map<String, dynamic> json) {
categoryID = json['CategoryID'];
categoryName = json['CategoryName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['CategoryID'] = this.categoryID;
data['CategoryName'] = this.categoryName;
return data;
}
}

@ -0,0 +1,89 @@
class GetProcedureModel {
List<EntityList> entityList;
int rowcount;
dynamic statusMessage;
GetProcedureModel({this.entityList, this.rowcount, this.statusMessage});
GetProcedureModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) {
entityList = new List<EntityList>();
json['entityList'].forEach((v) {
entityList.add(new EntityList.fromJson(v));
});
}
rowcount = json['rowcount'];
statusMessage = json['statusMessage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.entityList != null) {
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
}
data['rowcount'] = this.rowcount;
data['statusMessage'] = this.statusMessage;
return data;
}
}
class EntityList {
bool allowedClinic;
String category;
String categoryID;
String genderValidation;
String group;
String orderedValidation;
int price;
String procedureId;
String procedureName;
String specialPermission;
String subGroup;
String template;
EntityList(
{this.allowedClinic,
this.category,
this.categoryID,
this.genderValidation,
this.group,
this.orderedValidation,
this.price,
this.procedureId,
this.procedureName,
this.specialPermission,
this.subGroup,
this.template});
EntityList.fromJson(Map<String, dynamic> json) {
allowedClinic = json['allowedClinic'];
category = json['category'];
categoryID = json['categoryID'];
genderValidation = json['genderValidation'];
group = json['group'];
orderedValidation = json['orderedValidation'];
price = json['price'];
procedureId = json['procedureId'];
procedureName = json['procedureName'];
specialPermission = json['specialPermission'];
subGroup = json['subGroup'];
template = json['template'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['allowedClinic'] = this.allowedClinic;
data['category'] = this.category;
data['categoryID'] = this.categoryID;
data['genderValidation'] = this.genderValidation;
data['group'] = this.group;
data['orderedValidation'] = this.orderedValidation;
data['price'] = this.price;
data['procedureId'] = this.procedureId;
data['procedureName'] = this.procedureName;
data['specialPermission'] = this.specialPermission;
data['subGroup'] = this.subGroup;
data['template'] = this.template;
return data;
}
}

@ -0,0 +1,40 @@
class GetProcedureReqModel {
int clinicId;
int patientMRN;
int pageSize;
int pageIndex;
List<String> search;
dynamic categoryId;
String vidaAuthTokenID;
GetProcedureReqModel(
{this.clinicId,
this.patientMRN,
this.pageSize,
this.pageIndex,
this.search,
this.categoryId,
this.vidaAuthTokenID});
GetProcedureReqModel.fromJson(Map<String, dynamic> json) {
clinicId = json['ClinicId'];
patientMRN = json['PatientMRN'];
pageSize = json['PageSize'];
pageIndex = json['PageIndex'];
search = json['Search'].cast<String>();
categoryId = json['CategoryId'];
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicId'] = this.clinicId;
data['PatientMRN'] = this.patientMRN;
data['PageSize'] = this.pageSize;
data['PageIndex'] = this.pageIndex;
data['Search'] = this.search;
data['CategoryId'] = this.categoryId;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}

@ -0,0 +1,87 @@
class PostProcedureReqModel {
int patientMRN;
int appointmentNo;
int episodeID;
List<Procedures> procedures;
String vidaAuthTokenID;
PostProcedureReqModel(
{this.patientMRN,
this.appointmentNo,
this.episodeID,
this.procedures,
this.vidaAuthTokenID});
PostProcedureReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
if (json['Procedures'] != null) {
procedures = new List<Procedures>();
json['Procedures'].forEach((v) {
procedures.add(new Procedures.fromJson(v));
});
}
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
if (this.procedures != null) {
data['Procedures'] = this.procedures.map((v) => v.toJson()).toList();
}
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}
class Procedures {
String procedure;
String category;
List<Controls> controls;
Procedures({this.procedure, this.category, this.controls});
Procedures.fromJson(Map<String, dynamic> json) {
procedure = json['Procedure'];
category = json['Category'];
if (json['Controls'] != null) {
controls = new List<Controls>();
json['Controls'].forEach((v) {
controls.add(new Controls.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Procedure'] = this.procedure;
data['Category'] = this.category;
if (this.controls != null) {
data['Controls'] = this.controls.map((v) => v.toJson()).toList();
}
return data;
}
}
class Controls {
String code;
String controlValue;
Controls({this.code, this.controlValue});
Controls.fromJson(Map<String, dynamic> json) {
code = json['Code'];
controlValue = json['ControlValue'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Code'] = this.code;
data['ControlValue'] = this.controlValue;
return data;
}
}

@ -0,0 +1,102 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'base/lookup-service.dart';
class SOAPService extends LookupService {
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
await baseAppClient.post(
GET_ALLERGIES,
onSuccess: (dynamic response, int statusCode) {
listOfAllergies.clear();
response['List_Allergies']['entityList'].forEach((v) {
listOfAllergies.add(MasterKeyModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: getAllergiesRequestModel.toJson(),
);
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
hasError = false;
await baseAppClient.post(POST_ALLERGY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postAllergyRequestModel.toJson());
}
Future postHistories(
PostHistoriesRequestModel postHistoriesRequestModel) async {
hasError = false;
await baseAppClient.post(POST_HISTORY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postHistoriesRequestModel.toJson());
}
Future postChiefComplaint(
PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
hasError = false;
await baseAppClient.post(POST_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postChiefComplaintRequestModel.toJson());
}
Future postPhysicalExam(
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
hasError = false;
await baseAppClient.post(POST_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postPhysicalExamRequestModel.toJson());
}
Future postProgressNote(
PostProgressNoteRequestModel postProgressNoteRequestModel) async {
hasError = false;
await baseAppClient.post(POST_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postProgressNoteRequestModel.toJson());
}
Future postAssessment(
PostAssessmentRequestModel postAssessmentRequestModel) async {
hasError = false;
await baseAppClient.post(POST_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postAssessmentRequestModel.toJson());
}
}

@ -1,8 +1,59 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
class BaseService { class BaseService {
String error; String error;
bool hasError = false; bool hasError = false;
BaseAppClient baseAppClient = BaseAppClient(); BaseAppClient baseAppClient = BaseAppClient();
//TODO add the user login model when we need it DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DoctorProfileModel doctorProfile;
List<PatientArrivalEntity> patientArrivalList = [];
//TODO add the user login model when we need it
Future<DoctorProfileModel> getDoctorProfile() async {
if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
return null;
} else {
return doctorProfile;
}
}
Future getPatientArrivalList(String date,{String fromDate}) async{
hasError = false;
Map<String, dynamic> body = Map();
body['From'] = fromDate == null ? date : fromDate;
body['To'] = date;
body['PageIndex'] = 0;
body['PageSize'] = 0;
await baseAppClient.post(
GET_PATIENT_ARRIVAL_LIST,
onSuccess: (dynamic response, int statusCode) {
patientArrivalList.clear();
response['patientArrivalList']['entityList'].forEach((v) {
PatientArrivalEntity item = PatientArrivalEntity.fromJson(v);
patientArrivalList.add(item);
});
},
onFailure: (String error, int statusCode) {
hasError = true;
this.error = error;
},
body: body,
);
}
} }

@ -0,0 +1,133 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'base_service.dart';
class LookupService extends BaseService {
List<MasterKeyModel> listOfAllergies = [];
List<MasterKeyModel> get allergySeverityList => _allergySeverityList;
List<MasterKeyModel> _allergySeverityList = [];
List<MasterKeyModel> get historyFamilyList => _historyFamilyList;
List<MasterKeyModel> _historyFamilyList = [];
List<MasterKeyModel> get historyMedicalList => _historyMedicalList;
List<MasterKeyModel> _historyMedicalList = [];
List<MasterKeyModel> get historySportList => _historySportList;
List<MasterKeyModel> _historySportList = [];
List<MasterKeyModel> get historySocialList => _historySocialList;
List<MasterKeyModel> _historySocialList = [];
List<MasterKeyModel> get historySurgicalList => _historySurgicalList;
List<MasterKeyModel> _historySurgicalList = [];
List<MasterKeyModel> listOfPhysiotherapyGoals = [];
List<MasterKeyModel> get physicalExaminationList => _physicalExaminationList;
List<MasterKeyModel> _physicalExaminationList = [];
// List<MasterKeyModel> listOfPhysiotherapyGoals = [];
List<MasterKeyModel> listOfDiagnosisType = [];
List<MasterKeyModel> listOfDiagnosisCondition = [];
List<MasterKeyModel> listOfICD10 = [];
Future getMasterLookup(MasterKeysService masterKeys) async {
hasError = false;
Map<String, dynamic> body = {
"MasterInput": masterKeys.getMasterKeyService()
};
await baseAppClient.post(GET_MASTER_LOOKUP_LIST,
onSuccess: (dynamic response, int statusCode) {
setMasterLookupInCorrectArray(
response['MasterLookUpList']['entityList'], masterKeys);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
setMasterLookupInCorrectArray(entryList, MasterKeysService masterKeys) {
switch (masterKeys) {
case MasterKeysService.Allergies:
listOfAllergies.clear();
entryList.forEach((v) {
listOfAllergies.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.HistoryFamily:
_historyFamilyList.clear();
entryList.forEach((v) {
_historyFamilyList.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.HistoryMedical:
_historyMedicalList.clear();
entryList.forEach((v) {
_historyMedicalList.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.HistorySocial:
historySocialList.clear();
entryList.forEach((v) {
historySocialList.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.HistorySports:
_historySportList.clear();
entryList.forEach((v) {
_historySportList.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.HistorySurgical:
_historySurgicalList.clear();
entryList.forEach((v) {
_historySurgicalList.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.PhysicalExamination:
_physicalExaminationList.clear();
entryList.forEach((v) {
_physicalExaminationList.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.AllergySeverity:
_allergySeverityList.clear();
entryList.forEach((v) {
_allergySeverityList.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.physiotherapyGoals:
listOfPhysiotherapyGoals.clear();
entryList.forEach((v) {
listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.DiagnosisType:
listOfDiagnosisType.clear();
entryList.forEach((v) {
listOfDiagnosisType
.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.DiagnosisCondition:
listOfDiagnosisCondition.clear();
entryList.forEach((v) {
listOfDiagnosisCondition
.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.ICD10:
listOfICD10.clear();
entryList.forEach((v) {
listOfICD10
.add(MasterKeyModel.fromJson(v));
});
break;
}
}
}

@ -0,0 +1,31 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class DashboardService extends BaseService {
List<DashboardModel> _dashboardItemsList = [];
List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
// DashboardModel _dashboard = DashboardModel();
Future getDashboard() async {
hasError = false;
await baseAppClient.post(
GET_DASHBOARD,
onSuccess: (dynamic response, int statusCode) {
_dashboardItemsList.clear();
response['listDoctorDashboarKPI'].forEach((v) {
_dashboardItemsList.add(DashboardModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
// "VidaAuthTokenID":
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiZDYxZmM5MTQtZWFhYy00YjQ4LTgyMmEtMmE3OTNlZDMzZGYwIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NTgwOCIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgwMjg0NzQsImV4cCI6MTYwODg5MjQ3NCwiaWF0IjoxNjA4MDI4NDc0fQ.8OJcy6vUuPnNTi_qSjip8YCrFdaRLtJKbNKXcMtnQxk"
},
);
}
}

@ -0,0 +1,231 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/lookups/hospital_lookup.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'base/lookup-service.dart';
class PatientReferralService extends LookupService {
List<dynamic> projectsList = [];
List<dynamic> clinicsList = [];
List<dynamic> doctorsList = [];
List<MyReferredPatientModel> listMyReferredPatientModel = [];
List<PendingReferral> pendingReferralList = [];
String setupID = "0";
Future getProjectsList() async {
hasError = false;
const url = GET_PROJECTS;
var info = {
"LanguageID": 1,
"stamp": "2020-02-26T13:51:44.111Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
"Channel": 9,
"TokenID": "",
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true
};
dynamic localRes;
await baseAppClient.post(url, onSuccess: (response, statusCode) async {
if (response['MessageStatus'] == 1) {
projectsList = response['ListProject'];
} else {
// handel error
projectsList = ListProject;
}
}, onFailure: (String error, int statusCode) {
projectsList = ListProject;
}, body: info);
}
Future getProjectInfo(int projectId) async {
Map<String, dynamic> body = Map();
body['ProjectID'] = projectId;
await baseAppClient.post(
PROJECT_GET_INFO,
onSuccess: (dynamic response, int statusCode) {
setupID = response['ProjectInfo'][0]['facilityGroupId'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
Future getClinicsList(int projectId) async {
hasError = false;
ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest();
_clinicByProjectIdRequest.projectID = projectId;
await baseAppClient.post(
PATIENT_GET_CLINIC_BY_PROJECT_URL,
onSuccess: (dynamic response, int statusCode) {
clinicsList = [];
clinicsList = response['List_Clinic_All'];
print(response['List_Clinic_All']);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _clinicByProjectIdRequest.toJson(),
);
}
Future getDoctorsList(String clinicId) async {
hasError = false;
DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest();
_doctorsByClinicIdRequest.clinicID = clinicId;
await baseAppClient.post(
PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
doctorsList = [];
doctorsList = response['List_Doctors_All'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _doctorsByClinicIdRequest.toJson(),
);
}
Future getMyReferredPatient() async {
hasError = false;
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
DoctorProfileModel doctorProfile = await getDoctorProfile();
await baseAppClient.post(
GET_MY_REFERRED_PATIENT,
onSuccess: (dynamic response, int statusCode) {
listMyReferredPatientModel.clear();
response['List_MyReferredPatient'].forEach((v) {
MyReferredPatientModel item = MyReferredPatientModel.fromJson(v);
if (doctorProfile != null) {
item.isReferralDoctorSameBranch =
doctorProfile.projectID == item.projectId;
} else {
item.isReferralDoctorSameBranch = false;
}
listMyReferredPatientModel.add(item);
});
// print(response['List_MyReferredPatient']);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _requestMyReferralPatient.toJson(),
);
}
Future getPendingReferralList() async {
hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile();
Map<String, dynamic> body = Map();
body['ClinicID'] = 0;
body['DoctorID'] = doctorProfile.doctorID;
await baseAppClient.post(
GET_PENDING_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) {
pendingReferralList.clear();
response['PendingReferralList'].forEach((v) {
PendingReferral item = PendingReferral.fromJson(v);
item.isReferralDoctorSameBranch =
item.targetProjectId == item.sourceProjectId;
pendingReferralList.add(item);
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile();
Map<String, dynamic> body = Map();
body['IsAccepted'] = isAccepted;
body['AppointmentNo'] = pendingReferral.sourceAppointmentNo;
body['PatientMRN'] = pendingReferral.patientID;
body['PatientName'] = pendingReferral.patientName;
body['ReferralResponse'] = pendingReferral.remarksFromSource;
body['SetupID'] = pendingReferral.sourceSetupID;
body['DoctorName'] = doctorProfile.doctorName;
await baseAppClient.post(
RESPONSE_PENDING_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) {
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
Future makeReferral(
PatientArrivalEntity patientArrivalEntity,
String isoStringDate,
int projectID,
int clinicID,
int doctorID,
String remarks) async {
hasError = false;
Map<String, dynamic> body = Map();
List<dynamic> physiotheraphyGoalsList = [];
listOfPhysiotherapyGoals.forEach((element) {
physiotheraphyGoalsList
.add({"goalId": element.id, "remarks": element.remarks});
});
body['PatientMRN'] = patientArrivalEntity.patientMRN;
body['AppointmentNo'] = patientArrivalEntity.appointmentNo;
body['SetupID'] = setupID;
body['appointmentDate'] = isoStringDate;
body['SlotStart'] = isoStringDate;
body['SlotEnd'] = isoStringDate;
body['Remarks'] = remarks;
body['ProjectID'] = projectID;
body['ClinicID'] = clinicID;
body['DoctorID'] = doctorID;
body['noOfSessions'] = 1;
body['physiotheraphyGoalsList'] = physiotheraphyGoalsList;
await baseAppClient.post(
CREATE_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) {
print(response.toString());
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
}

@ -0,0 +1,72 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
class VitalSignsService extends BaseService{
List<VitalSignResModel> patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
VitalSignData patientVitalSigns;
/*Future getPatientVitalSign(patient) async {
hasError = false;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignList = [];
response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignList.add(new VitalSignResModel.fromJson(v));
});
if (patientVitalSignList.length > 0) {
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
patientVitalSignOrderdSubListTemp = patientVitalSignList;
patientVitalSignOrderdSubListTemp
.sort((VitalSignResModel a, VitalSignResModel b) {
return b.vitalSignDate.microsecondsSinceEpoch -
a.vitalSignDate.microsecondsSinceEpoch;
});
patientVitalSignOrderdSubList.clear();
int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
} // Vit*/
Future getPatientVitalSign(PatientArrivalEntity patientArrivalEntity) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patientArrivalEntity.patientMRN;
body['AppointmentNo'] = patientArrivalEntity.appointmentNo;
body['EpisodeID'] = patientArrivalEntity.episodeNo;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) {
if(response['VitalSignsList'] != null){
if(response['VitalSignsList']['entityList'] = null && (response['VitalSignsList']['entityList'] as List).length > 0){
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList']['0']);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error.toString();
},
body: body,
);
}
}

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/request_schedule.dart'; import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart'; import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart';
@ -62,6 +63,10 @@ class PatientService extends BaseService {
// TODO: replace var with model // TODO: replace var with model
var _doctorsList = []; var _doctorsList = [];
var _arrivedList = [];
get arrivedList => _arrivedList;
get doctorsList => _doctorsList; get doctorsList => _doctorsList;
// TODO: replace var with model // TODO: replace var with model
@ -82,8 +87,6 @@ class PatientService extends BaseService {
ClinicByProjectIdRequest(); ClinicByProjectIdRequest();
ReferToDoctorRequest _referToDoctorRequest; ReferToDoctorRequest _referToDoctorRequest;
RequestSchedule _requestSchedule = RequestSchedule();
Future<dynamic> getPatientList( patient, patientType) async { Future<dynamic> getPatientList( patient, patientType) async {
hasError = false; hasError = false;
int val = int.parse(patientType); int val = int.parse(patientType);
@ -276,7 +279,7 @@ class PatientService extends BaseService {
); );
} }
Future getPatientInsuranceApprovals(patient) async { Future getPatientInsuranceApprovals(patient) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -293,7 +296,7 @@ class PatientService extends BaseService {
); );
} }
Future getPatientProgressNote(patient) async { Future getPatientProgressNote(patient) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -310,7 +313,6 @@ class PatientService extends BaseService {
); );
} }
Future getClinicsList() async { Future getClinicsList() async {
hasError = false; hasError = false;
@ -328,7 +330,6 @@ class PatientService extends BaseService {
); );
} }
Future getReferralFrequancyList() async { Future getReferralFrequancyList() async {
hasError = false; hasError = false;
@ -363,19 +364,19 @@ class PatientService extends BaseService {
); );
} }
// TODO send the total model insted of each parameter // TODO send the total model insted of each parameter
Future referToDoctor({String selectedDoctorID, Future referToDoctor(
String selectedClinicID, {String selectedDoctorID,
int admissionNo, String selectedClinicID,
String extension, int admissionNo,
String priority, String extension,
String frequency, String priority,
String referringDoctorRemarks, String frequency,
int patientID, String referringDoctorRemarks,
int patientTypeID, int patientID,
String roomID, int patientTypeID,
int projectID}) async { String roomID,
int projectID}) async {
hasError = false; hasError = false;
// TODO Change it to use it when we implement authentication user // TODO Change it to use it when we implement authentication user
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -409,4 +410,21 @@ class PatientService extends BaseService {
body: _referToDoctorRequest.toJson(), body: _referToDoctorRequest.toJson(),
); );
} }
Future getArrivedList() async {
hasError = false;
await baseAppClient.post(
ARRIVED_PATIENT_URL,
onSuccess: (dynamic response, int statusCode) {
_arrivedList = [];
_arrivedList = response['"patientArrivalList": '];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _doctorsByClinicIdRequest.toJson(),
);
}
} }

@ -0,0 +1,48 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class PrescriptionService extends BaseService {
List<PrescriptionModel> _prescriptionList = List();
List<PrescriptionModel> get prescriptionList => _prescriptionList;
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(
patientMRN: 1231755,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8",
);
PostPrescriptionReqModel _postPrescriptionReqModel =
PostPrescriptionReqModel();
Future getPrescription() async {
hasError = false;
_prescriptionList.clear();
await baseAppClient.post(GET_PRESCRIPTION_LIST,
onSuccess: (dynamic response, int statusCode) {
_prescriptionList
.add(PrescriptionModel.fromJson(response['PrescriptionList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _prescriptionReqModel.toJson());
}
Future postPrescription() async {
hasError = false;
//_prescriptionList.clear();
await baseAppClient.post(
GET_CATEGORISE_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
_prescriptionList
.add(PrescriptionModel.fromJson(response['PrescriptionList']));
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
);
}
}

@ -0,0 +1,74 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:flutter/foundation.dart';
class ProcedureService extends BaseService {
List<GetProcedureModel> _procedureList = List();
List<GetProcedureModel> get procedureList => _procedureList;
List<CategoriseProcedureModel> _categoriesList = List();
List<CategoriseProcedureModel> get categoriesList => _categoriesList;
List<Procedures> procedureslist = List();
Procedures t1 = Procedures(
category: '02',
procedure: '02011002',
);
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
clinicId: 0,
pageSize: 10,
pageIndex: 1,
patientMRN: 0,
//categoryId: null,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
search: ["lab"],
);
PostProcedureReqModel _postProcedureReqModel = PostProcedureReqModel();
Future getProcedure() async {
hasError = false;
_procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) {
_procedureList.add(GetProcedureModel.fromJson(response['ProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _getProcedureReqModel.toJson());
}
Future getCategories() async {
hasError = false;
_categoriesList.clear();
await baseAppClient.post(
GET_CATEGORISE_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
_categoriesList
.add(CategoriseProcedureModel.fromJson(response['listCategories']));
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
);
}
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false;
_procedureList.clear();
await baseAppClient.post(POST_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postProcedureReqModel.toJson());
}
}

@ -24,6 +24,7 @@ class ReferralPatientService extends BaseService {
response['List_MyReferralPatient'].forEach((v) { response['List_MyReferralPatient'].forEach((v) {
listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v)); listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v));
}); });
print(response['List_MyReferralPatient']);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -11,8 +11,6 @@ class ReferredPatientService extends BaseService {
List<MyReferredPatientModel> get listMyReferredPatientModel => List<MyReferredPatientModel> get listMyReferredPatientModel =>
_listMyReferredPatientModel; _listMyReferredPatientModel;
Helpers helpers = Helpers();
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel(); RequestMyReferralPatientModel();
VerifyReferralDoctorRemarks _verifyreferraldoctorremarks = VerifyReferralDoctorRemarks _verifyreferraldoctorremarks =
@ -26,6 +24,7 @@ class ReferredPatientService extends BaseService {
response['List_MyReferredPatient'].forEach((v) { response['List_MyReferredPatient'].forEach((v) {
listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v)); listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v));
}); });
// print(response['List_MyReferredPatient']);
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -0,0 +1,93 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class SickLeaveService extends BaseService {
Map get sickLeavestatisitics => _statistics;
Map _statistics = {};
List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave;
List<GetAllSickLeaveResponse> _getAllsickLeave = [];
Future getStatistics(appoNo, patientMRN) async {
hasError = false;
await baseAppClient.post(
GET_SICKLEAVE_STATISTIC,
onSuccess: (dynamic response, int statusCode) {
print(response);
_statistics = {};
_statistics = response['SickLeaveStatistics'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {"PatientMRN": patientMRN, "AppointmentNo": appoNo},
);
}
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
addSickLeaveRequest.appointmentNo = '2016054661';
addSickLeaveRequest.patientMRN = '3120746';
hasError = false;
await baseAppClient.post(
ADD_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
print(response);
// _statistics = {};
// _statistics = response['SickLeaveStatistics'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: addSickLeaveRequest.toJson(),
);
}
Future extendSickLeave(GetAllSickLeaveResponse request) async {
var extendSickLeaveRequest = ExtendSickLeaveRequest();
extendSickLeaveRequest.patientMRN =
request.patientMRN.toString(); //'3120746';
extendSickLeaveRequest.previousRequestNo = request.requestNo.toString();
extendSickLeaveRequest.noOfDays = request.noOfDays.toString();
extendSickLeaveRequest.remarks = request.remarks;
hasError = false;
await baseAppClient.post(
EXTEND_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
print(response);
// _statistics = {};
// _statistics = response['SickLeaveStatistics'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: extendSickLeaveRequest.toJson(),
);
}
Future getSickLeave() async {
hasError = false;
await baseAppClient.post(
GET_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
_getAllsickLeave.clear();
response['SickLeavesList']['entityList'].forEach((v) {
_getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {'PatientMRN': 3120772},
);
}
}

@ -0,0 +1,123 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/SOAP_service.dart';
import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class SOAPViewModel extends BaseViewModel {
SOAPService _SOAPService = locator<SOAPService>();
List<MasterKeyModel> get listOfAllergies => _SOAPService.listOfAllergies;
List<MasterKeyModel> get allergySeverityList =>
_SOAPService.allergySeverityList;
List<MasterKeyModel> get historyFamilyList => _SOAPService.historyFamilyList;
List<MasterKeyModel> get historyMedicalList => _SOAPService.historyMedicalList;
List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
List<MasterKeyModel> get historySocialList => _SOAPService.historySocialList;
List<MasterKeyModel> get historySurgicalList => _SOAPService.historySurgicalList;
List<MasterKeyModel> get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList,...historySportList];
List<MasterKeyModel> get physicalExaminationList => _SOAPService.physicalExaminationList;
List<MasterKeyModel> get listOfDiagnosisType => _SOAPService.listOfDiagnosisType;
List<MasterKeyModel> get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition;
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
setState(ViewState.Busy);
await _SOAPService.getAllergies(getAllergiesRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMasterLookup(MasterKeysService masterKeys) async {
setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAllergy(postAllergyRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postHistories(postHistoriesRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postProgressNote(postProgressNoteRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAssessment(postAssessmentRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart';
import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
@ -17,17 +19,16 @@ class AuthViewModel with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
DoctorProfileModel doctorProfile; DoctorProfileModel doctorProfile;
BaseAppClient baseAppClient = BaseAppClient(); BaseAppClient baseAppClient = BaseAppClient();
setDoctorProfile(DoctorProfileModel profileModel){ setDoctorProfile(DoctorProfileModel profileModel) {
doctorProfile = profileModel; doctorProfile = profileModel;
notifyListeners(); notifyListeners();
} }
AuthViewModel() { AuthViewModel() {
getUserAuthentication(); getUserAuthentication();
} }
getUserAuthentication() async { getUserAuthentication() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {
doctorProfile = new DoctorProfileModel.fromJson(profile); doctorProfile = new DoctorProfileModel.fromJson(profile);
@ -119,6 +120,22 @@ class AuthViewModel with ChangeNotifier {
} }
} }
Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async {
try {
var localRes;
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: activationCodeModel.toJson());
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> memberCheckActivationCodeNew(activationCodeModel) async { Future<dynamic> memberCheckActivationCodeNew(activationCodeModel) async {
try { try {
dynamic localRes; dynamic localRes;
@ -141,6 +158,29 @@ class AuthViewModel with ChangeNotifier {
} }
} }
Future<dynamic> checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async {
try {
dynamic localRes;
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
selectedClinicName =
ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName;
response['List_DoctorsClinic'].forEach((v) {
doctorsClinicList.add(new ClinicModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
throw error;
}, body: checkActivationCodeRequestModel.toJson());
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:17/5/2020 *@Date:17/5/2020
@ -154,7 +194,8 @@ class AuthViewModel with ChangeNotifier {
await baseAppClient.post(GET_DOC_PROFILES, await baseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
doctorProfile = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); doctorProfile =
DoctorProfileModel.fromJson(response['DoctorProfileList'][0]);
selectedClinicName = selectedClinicName =
response['DoctorProfileList'][0]['ClinicDescription']; response['DoctorProfileList'][0]['ClinicDescription'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -1,17 +1,39 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BaseViewModel extends ChangeNotifier { class BaseViewModel extends ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DoctorProfileModel doctorProfile;
ViewState _state = ViewState.Idle; ViewState _state = ViewState.Idle;
bool isInternetConnection = true; bool isInternetConnection = true;
ViewState get state => _state; ViewState get state => _state;
String error = ""; String error = "";
//TODO add the user login model when we need it //TODO add the user login model when we need it
void setState(ViewState viewState) { void setState(ViewState viewState) {
_state = viewState; _state = viewState;
notifyListeners(); notifyListeners();
} }
Future<DoctorProfileModel> getDoctorProfile() async {
if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
return null;
} else {
return doctorProfile;
}
}
} }

@ -0,0 +1,21 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel {
DashboardService _dashboardService = locator<DashboardService>();
get dashboardItemsList => _dashboardService.dashboardItemsList;
Future getDashboard() async {
setState(ViewState.Busy);
await _dashboardService.getDashboard();
if (_dashboardService.hasError) {
error = _dashboardService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,156 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import '../../locator.dart';
class PatientReferralViewModel extends BaseViewModel {
PatientReferralService _referralPatientService =
locator<PatientReferralService>();
List<dynamic> get branchesList => _referralPatientService.projectsList;
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get doctorsList => _referralPatientService.doctorsList;
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
List<PendingReferral> get pendingReferral =>
_referralPatientService.pendingReferralList;
List<PatientArrivalEntity> get patientArrivalList =>
_referralPatientService.patientArrivalList;
Future getMasterLookup(MasterKeysService masterKeys) async {
setState(ViewState.Busy);
await _referralPatientService.getMasterLookup(masterKeys);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
await getBranches();
}
Future getBranches() async {
setState(ViewState.Busy);
await _referralPatientService.getProjectsList();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getClinics(int projectId) async {
setState(ViewState.Busy);
await _referralPatientService.getClinicsList(projectId);
await _referralPatientService.getProjectInfo(projectId);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getClinicDoctors(String clinicId) async {
setState(ViewState.Busy);
await _referralPatientService.getDoctorsList(clinicId);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future<dynamic> getDoctorBranch() async {
DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) {
dynamic _selectedBranch = {
"ID": doctorProfile.projectID,
"Desciption": doctorProfile.projectName
};
return _selectedBranch;
}
return null;
}
Future getMyReferredPatient() async {
setState(ViewState.Busy);
await _referralPatientService.getMyReferredPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
MyReferredPatientModel getReferredPatientItem(int index) {
return listMyReferredPatientModel[index];
}
Future getPendingReferralPatients() async {
setState(ViewState.Busy);
await _referralPatientService.getPendingReferralList();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
setState(ViewState.Busy);
await _referralPatientService.responseReferral(pendingReferral, isAccepted);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientArrivalList(String date) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(date);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
List<dynamic> getAppointmentsByPatientName(String patientName) {
List<dynamic> appointments = [];
patientArrivalList.forEach((element) {
if (element.patientName == patientName) {
appointments.add(element.toJson());
}
});
return appointments;
}
Future makeReferral(PatientArrivalEntity patientArrivalEntity,
String isoStringDate,
int projectID,
int clinicID,
int doctorID,
String remarks) async {
setState(ViewState.Busy);
await _referralPatientService.makeReferral(patientArrivalEntity, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -0,0 +1,100 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
import '../../locator.dart';
class VitalSignsViewModel extends BaseViewModel {
VitalSignsService _vitalSignService = locator<VitalSignsService>();
List<PatientArrivalEntity> get patientArrivalList =>
_vitalSignService.patientArrivalList;
VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns;
Future getPatientArrivalList(String date, PatiantInformtion patient,
{String fromDate}) async {
setState(ViewState.Busy);
await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate);
if (_vitalSignService.hasError) {
error = _vitalSignService.error;
setState(ViewState.Error);
} else {
await getPatientVitalSign(patient);
}
}
PatientArrivalEntity getPatientAppointmentEntity(PatiantInformtion patient) {
String ffName = "${patient.firstName} ${patient.lastName}";
String fmfName =
"${patient.firstName} ${patient.middleName} ${patient.lastName}";
for (var element in patientArrivalList) {
int index = patientArrivalList.indexOf(element);
if (element.patientName == ffName || element.patientName == fmfName) {
return element;
}
// print("patient index: $index");
}
return null;
}
Future getPatientVitalSign(PatiantInformtion patient) async {
setState(ViewState.Busy);
PatientArrivalEntity patientArrivalEntity =
getPatientAppointmentEntity(patient);
if (patientArrivalEntity == null) {
_vitalSignService.hasError = true;
error = "There is no appointments for this patient";
setState(ViewState.Error);
return;
}
await _vitalSignService.getPatientVitalSign(patientArrivalEntity);
// TODO remove (not) from below condition
if (!_vitalSignService.hasError) {
error = _vitalSignService.error;
setState(ViewState.Error);
} else {
if (patientVitalSigns == null) {
_vitalSignService.patientVitalSigns = VitalSignData(
appointmentNo: 2016053265,
bloodPressureCuffLocation: 0,
bloodPressureCuffSize: 0,
bloodPressureHigher: 38,
bloodPressureLower: 32,
bloodPressurePatientPosition: 1,
bodyMassIndex: 31.11,
fio2: 0,
headCircumCm: 0,
heightCm: 150,
idealBodyWeightLbs: -2,
isPainManagementDone: false,
isVitalsRequired: true,
leanBodyWeightLbs: 0,
painCharacter: null,
painDuration: null,
painFrequency: null,
painLocation: null,
painScore: 0,
patientMRN: 3333274,
patientType: 1,
pulseBeatPerMinute: 0,
pulseRhythm: 0,
respirationBeatPerMinute: 0,
respirationPattern: 0,
sao2: 0,
status: 47,
temperatureCelcius: 40,
temperatureCelciusMethod: 1,
waistSizeInch: 39,
weightKg: 70,
);
}
setState(ViewState.Idle);
}
}
}

@ -42,13 +42,16 @@ class PatientViewModel extends BaseViewModel {
get patientProgressNoteList => _patientService.patientProgressNoteList; get patientProgressNoteList => _patientService.patientProgressNoteList;
get clinicsList => _patientService.clinicsList; List<dynamic> get clinicsList => _patientService.clinicsList;
get doctorsList => _patientService.doctorsList;
get referalFrequancyList => _patientService.referalFrequancyList; List<dynamic> get doctorsList => _patientService.doctorsList;
Future getPatientList( patient, patientType,
List<dynamic> get referralFrequencyList =>
_patientService.referalFrequancyList;
Future getPatientList(PatientModel patient, patientType,
{bool isBusyLocal = false}) async { {bool isBusyLocal = false}) async {
if(isBusyLocal) { if (isBusyLocal) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -56,11 +59,12 @@ class PatientViewModel extends BaseViewModel {
return _patientService.getPatientList(patient, patientType); return _patientService.getPatientList(patient, patientType);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;
if(isBusyLocal) { if (isBusyLocal) {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
setState(ViewState.Error); setState(ViewState.Error);
} } else }
} else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -167,6 +171,7 @@ class PatientViewModel extends BaseViewModel {
} }
} }
} }
Future getDoctorsList(String clinicId) async { Future getDoctorsList(String clinicId) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _patientService.getDoctorsList(clinicId); await _patientService.getDoctorsList(clinicId);
@ -182,8 +187,9 @@ class PatientViewModel extends BaseViewModel {
} }
List getDoctorNameList() { List getDoctorNameList() {
var doctorNamelist = var doctorNamelist = _patientService.doctorsList
_patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList(); .map((value) => value['DoctorName'].toString())
.toList();
return doctorNamelist; return doctorNamelist;
} }
@ -193,6 +199,7 @@ class PatientViewModel extends BaseViewModel {
.toList(); .toList();
return clinicsNameslist; return clinicsNameslist;
} }
Future getReferralFrequancyList() async { Future getReferralFrequancyList() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _patientService.getReferralFrequancyList(); await _patientService.getReferralFrequancyList();
@ -241,4 +248,14 @@ class PatientViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getArrivedList() async {
setState(ViewState.Busy);
await _patientService.getArrivedList();
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
} }

@ -0,0 +1,38 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
class PrescriptionViewModel extends BaseViewModel {
bool hasError = false;
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList;
Future getPrescription() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postPrescription() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _prescriptionService.postPrescription();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,51 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
class ProcedureViewModel extends BaseViewModel {
bool hasError = false;
ProcedureService _procedureService = locator<ProcedureService>();
List<GetProcedureModel> get procedureList => _procedureService.procedureList;
List<CategoriseProcedureModel> get categoriesList =>
_procedureService.categoriesList;
Future getProcedure() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getProcedure();
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getCategories() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getCategories();
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.postProcedure(postProcedureReqModel);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -15,7 +15,7 @@ import 'package:provider/provider.dart';
Helpers helpers = Helpers(); Helpers helpers = Helpers();
class ProjectProvider with ChangeNotifier { class ProjectViewModel with ChangeNotifier {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
Locale _appLocale; Locale _appLocale;
String currentLanguage = 'ar'; String currentLanguage = 'ar';
@ -31,7 +31,7 @@ class ProjectProvider with ChangeNotifier {
bool get isArabic => _isArabic; bool get isArabic => _isArabic;
StreamSubscription subscription; StreamSubscription subscription;
ProjectProvider() { ProjectViewModel() {
loadSharedPrefLanguage(); loadSharedPrefLanguage();
subscription = Connectivity() subscription = Connectivity()
@ -69,7 +69,7 @@ class ProjectProvider with ChangeNotifier {
sharedPref.setString(APP_Language, 'ar'); sharedPref.setString(APP_Language, 'ar');
} else if (lan != "ar" && currentLanguage != lan) { } else if (lan != "ar" && currentLanguage != lan) {
_appLocale = Locale("en"); _appLocale = Locale("en");
_isArabic = false; _isArabic = false;
currentLanguage = 'en'; currentLanguage = 'en';
sharedPref.setString(APP_Language, 'en'); sharedPref.setString(APP_Language, 'en');
} }
@ -101,7 +101,7 @@ class ProjectProvider with ChangeNotifier {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: {}); }, body: Map());
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
@ -111,18 +111,18 @@ class ProjectProvider with ChangeNotifier {
} }
void getProfile() async { void getProfile() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
ProfileReqModel docInfo = new ProfileReqModel( // ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID, // doctorID: doctorProfile.doctorID,
clinicID: doctorProfile.clinicID, // clinicID: doctorProfile.clinicID,
license: true, // license: true,
projectID: doctorProfile.projectID, // projectID: doctorProfile.projectID,
tokenID: '', // tokenID: '',
languageID: 2); // languageID: 2);
Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false) Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false)
.getDocProfiles(docInfo.toJson()) .getDocProfiles(ProfileReqModel().toJson())
.then((res) async { .then((res) async {
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
}).catchError((err) { }).catchError((err) {

@ -0,0 +1,54 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/sickleave_service.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>();
get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.Busy);
await _sickLeaveService.addSickLeave(addSickLeaveRequest);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future extendSickLeave(GetAllSickLeaveResponse extendSickLeaveRequest) async {
setState(ViewState.Busy);
await _sickLeaveService.extendSickLeave(extendSickLeaveRequest);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future preSickLeaveStatistics(appoNo, patientMRN) async {
setState(ViewState.Busy);
await _sickLeaveService.getStatistics(appoNo, patientMRN);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getSickLeave() async {
setState(ViewState.Busy);
await _sickLeaveService.getSickLeave();
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/screens/dashboard_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/message_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/message_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/services_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/services_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart';
@ -40,9 +41,7 @@ class _LandingPageState extends State<LandingPage> {
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
backgroundColor: HexColor('#515B5D'), backgroundColor: HexColor('#515B5D'),
textTheme: TextTheme( textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),
headline6:
TextStyle(color: Colors.white)),
title: Text(getText(currentTab).toUpperCase()), title: Text(getText(currentTab).toUpperCase()),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
@ -66,7 +65,8 @@ class _LandingPageState extends State<LandingPage> {
builder: Builder(builder: (context) => DashboardScreen()), builder: Builder(builder: (context) => DashboardScreen()),
), ),
MessagesScreen(), MessagesScreen(),
MyScheduleScreen(), //MyScheduleScreen(),
NewPrescriptionScreen(),
ServicesScreen() ServicesScreen()
], ],
), ),

@ -1,14 +1,28 @@
import 'package:doctor_app_flutter/core/service/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/service/sickleave_service.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/SOAP_service.dart';
import 'core/service/doctor_reply_service.dart'; import 'core/service/doctor_reply_service.dart';
import 'core/service/medicine_service.dart'; import 'core/service/medicine_service.dart';
import 'core/service/patient-vital-signs-service.dart';
import 'core/service/patient-doctor-referral-service.dart';
import 'core/service/referral_patient_service.dart'; import 'core/service/referral_patient_service.dart';
import 'core/service/referred_patient_service.dart'; import 'core/service/referred_patient_service.dart';
import 'core/service/schedule_service.dart'; import 'core/service/schedule_service.dart';
import 'core/viewModel/SOAP_view_model.dart';
import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart';
import 'core/viewModel/medicine_view_model.dart'; import 'core/viewModel/medicine_view_model.dart';
import 'core/viewModel/patient-vital-sign-viewmodel.dart';
import 'core/viewModel/patient-referral-viewmodel.dart';
import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referral_view_model.dart';
import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/referred_view_model.dart';
import 'core/viewModel/schedule_view_model.dart'; import 'core/viewModel/schedule_view_model.dart';
@ -24,6 +38,13 @@ void setupLocator() {
locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => ReferredPatientService());
locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => MedicineService());
locator.registerLazySingleton(() => PatientService()); locator.registerLazySingleton(() => PatientService());
locator.registerLazySingleton(() => DashboardService());
locator.registerLazySingleton(() => SickLeaveService());
locator.registerLazySingleton(() => SOAPService());
locator.registerLazySingleton(() => PatientReferralService());
locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => ProcedureService());
locator.registerLazySingleton(() => VitalSignsService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
@ -32,4 +53,11 @@ void setupLocator() {
locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => ReferredPatientViewModel());
locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => MedicineViewModel());
locator.registerFactory(() => PatientViewModel()); locator.registerFactory(() => PatientViewModel());
locator.registerFactory(() => DashboardViewModel());
locator.registerFactory(() => SickLeaveViewModel());
locator.registerFactory(() => SOAPViewModel());
locator.registerFactory(() => PatientReferralViewModel());
locator.registerFactory(() => PrescriptionViewModel());
locator.registerFactory(() => ProcedureViewModel());
locator.registerFactory(() => VitalSignsViewModel());
} }

@ -33,14 +33,14 @@ class MyApp extends StatelessWidget {
create: (context) => AuthViewModel()), create: (context) => AuthViewModel()),
ChangeNotifierProvider<HospitalViewModel>( ChangeNotifierProvider<HospitalViewModel>(
create: (context) => HospitalViewModel()), create: (context) => HospitalViewModel()),
ChangeNotifierProvider<ProjectProvider>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectProvider(), create: (context) => ProjectViewModel(),
), ),
ChangeNotifierProvider<LiveCareViewModel>( ChangeNotifierProvider<LiveCareViewModel>(
create: (context) => LiveCareViewModel(), create: (context) => LiveCareViewModel(),
), ),
], ],
child: Consumer<ProjectProvider>( child: Consumer<ProjectViewModel>(
builder: (context,projectProvider,child) => MaterialApp( builder: (context,projectProvider,child) => MaterialApp(
showSemanticsDebugger: false, showSemanticsDebugger: false,
title: 'Flutter Demo', title: 'Flutter Demo',
@ -60,7 +60,7 @@ class MyApp extends StatelessWidget {
buttonColor: HexColor('#B8382C'), buttonColor: HexColor('#B8382C'),
fontFamily: 'WorkSans', fontFamily: 'WorkSans',
dividerColor: Colors.grey[350], dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255,255,255, 1) backgroundColor: Color.fromRGBO(255,255,255, 1),
), ),
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,
routes: routes, routes: routes,

@ -0,0 +1,60 @@
class AllergyModel {
int allergyDiseaseId;
String allergyDiseaseName;
int allergyDiseaseType;
int appointmentNo;
int createdBy;
String createdByName;
String createdOn;
int episodeID;
bool isChecked;
bool isUpdatedByNurse;
int severity;
String severityName;
AllergyModel(
{this.allergyDiseaseId,
this.allergyDiseaseName,
this.allergyDiseaseType,
this.appointmentNo,
this.createdBy,
this.createdByName,
this.createdOn,
this.episodeID,
this.isChecked,
this.isUpdatedByNurse,
this.severity,
this.severityName});
AllergyModel.fromJson(Map<String, dynamic> json) {
allergyDiseaseId = json['allergyDiseaseId'];
allergyDiseaseName = json['allergyDiseaseName'];
allergyDiseaseType = json['allergyDiseaseType'];
appointmentNo = json['appointmentNo'];
createdBy = json['createdBy'];
createdByName = json['createdByName'];
createdOn = json['createdOn'];
episodeID = json['episodeID'];
isChecked = json['isChecked'];
isUpdatedByNurse = json['isUpdatedByNurse'];
severity = json['severity'];
severityName = json['severityName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['allergyDiseaseId'] = this.allergyDiseaseId;
data['allergyDiseaseName'] = this.allergyDiseaseName;
data['allergyDiseaseType'] = this.allergyDiseaseType;
data['appointmentNo'] = this.appointmentNo;
data['createdBy'] = this.createdBy;
data['createdByName'] = this.createdByName;
data['createdOn'] = this.createdOn;
data['episodeID'] = this.episodeID;
data['isChecked'] = this.isChecked;
data['isUpdatedByNurse'] = this.isUpdatedByNurse;
data['severity'] = this.severity;
data['severityName'] = this.severityName;
return data;
}
}

@ -0,0 +1,32 @@
class GetAllergiesRequestModel {
String vidaAuthTokenID;
int patientMRN;
int appointmentNo;
int episodeId;
String doctorID;
GetAllergiesRequestModel(
{this.vidaAuthTokenID,
this.patientMRN,
this.appointmentNo,
this.episodeId,
this.doctorID});
GetAllergiesRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId;
data['DoctorID'] = this.doctorID;
return data;
}
}

@ -0,0 +1,76 @@
class MasterKeyModel {
String alias;
String aliasN;
dynamic code;
dynamic description;
dynamic detail1;
dynamic detail2;
dynamic detail3;
dynamic detail4;
dynamic detail5;
int groupID;
int id;
String nameAr;
String nameEn;
dynamic remarks;
int typeId;
String valueList;
MasterKeyModel(
{this.alias,
this.aliasN,
this.code,
this.description,
this.detail1,
this.detail2,
this.detail3,
this.detail4,
this.detail5,
this.groupID,
this.id,
this.nameAr,
this.nameEn,
this.remarks,
this.typeId,
this.valueList});
MasterKeyModel.fromJson(Map<String, dynamic> json) {
alias = json['alias'];
aliasN = json['aliasN'];
code = json['code'];
description = json['description'];
detail1 = json['detail1'];
detail2 = json['detail2'];
detail3 = json['detail3'];
detail4 = json['detail4'];
detail5 = json['detail5'];
groupID = json['groupID'];
id = json['id'];
nameAr = json['nameAr'];
nameEn = json['nameEn'];
remarks = json['remarks'];
typeId = json['typeId'];
valueList = json['valueList'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['alias'] = this.alias;
data['aliasN'] = this.aliasN;
data['code'] = this.code;
data['description'] = this.description;
data['detail1'] = this.detail1;
data['detail2'] = this.detail2;
data['detail3'] = this.detail3;
data['detail4'] = this.detail4;
data['detail5'] = this.detail5;
data['groupID'] = this.groupID;
data['id'] = this.id;
data['nameAr'] = this.nameAr;
data['nameEn'] = this.nameEn;
data['remarks'] = this.remarks;
data['typeId'] = this.typeId;
data['valueList'] = this.valueList;
return data;
}
}

@ -0,0 +1,32 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedAllergy {
MasterKeyModel selectedAllergySeverity;
MasterKeyModel selectedAllergy;
String remark;
MySelectedAllergy(
{this.selectedAllergySeverity, this.selectedAllergy, this.remark});
MySelectedAllergy.fromJson(Map<String, dynamic> json) {
selectedAllergySeverity = json['selectedAllergySeverity'] != null
? new MasterKeyModel.fromJson(json['selectedAllergySeverity'])
: null;
selectedAllergy = json['selectedAllergy'] != null
? new MasterKeyModel.fromJson(json['selectedAllergy'])
: null;
remark = json['remark'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedAllergySeverity != null) {
data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson();
}
if (this.selectedAllergy != null) {
data['selectedAllergy'] = this.selectedAllergy.toJson();
}
data['remark'] = this.remark;
return data;
}
}

@ -0,0 +1,47 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedAssessment {
MasterKeyModel selectedICD;
MasterKeyModel selectedDiagnosisCondition;
MasterKeyModel selectedDiagnosisType;
String remark;
int appointmentId;
MySelectedAssessment(
{this.selectedICD,
this.selectedDiagnosisCondition,
this.selectedDiagnosisType,
this.remark, this.appointmentId});
MySelectedAssessment.fromJson(Map<String, dynamic> json) {
selectedICD = json['selectedICD'] != null
? new MasterKeyModel.fromJson(json['selectedICD'])
: null;
selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null
? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition'])
: null;
selectedDiagnosisType = json['selectedDiagnosisType'] != null
? new MasterKeyModel.fromJson(json['selectedDiagnosisType'])
: null;
remark = json['remark'];
appointmentId = json['appointmentId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedICD != null) {
data['selectedICD'] = this.selectedICD.toJson();
}
if (this.selectedDiagnosisCondition != null) {
data['selectedICD'] = this.selectedDiagnosisCondition.toJson();
}
if (this.selectedDiagnosisType != null) {
data['selectedICD'] = this.selectedDiagnosisType.toJson();
}
data['remark'] = this.remark;
data['appointmentId'] = this.appointmentId;
return data;
}
}

@ -0,0 +1,33 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination {
MasterKeyModel selectedExamination;
String remark;
bool isNormal;
bool isAbnormal;
MySelectedExamination(
{this.selectedExamination, this.remark, this.isNormal = true, this.isAbnormal = false});
MySelectedExamination.fromJson(Map<String, dynamic> json) {
selectedExamination = json['selectedExamination'] != null
? new MasterKeyModel.fromJson(json['selectedExamination'])
: null;
remark = json['remark'];
remark = json['isNormal'];
remark = json['isAbnormal'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedExamination != null) {
data['selectedExamination'] = this.selectedExamination.toJson();
}
data['remark'] = this.remark;
data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal;
return data;
}
}

@ -0,0 +1,93 @@
class PostAllergyRequestModel {
List<ListHisProgNotePatientAllergyDiseaseVM>
listHisProgNotePatientAllergyDiseaseVM;
PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM});
PostAllergyRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) {
listHisProgNotePatientAllergyDiseaseVM =
new List<ListHisProgNotePatientAllergyDiseaseVM>();
json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) {
listHisProgNotePatientAllergyDiseaseVM
.add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listHisProgNotePatientAllergyDiseaseVM != null) {
data['listHisProgNotePatientAllergyDiseaseVM'] = this
.listHisProgNotePatientAllergyDiseaseVM
.map((v) => v.toJson())
.toList();
}
return data;
}
}
class ListHisProgNotePatientAllergyDiseaseVM {
int patientMRN;
int allergyDiseaseType;
int allergyDiseaseId;
int episodeId;
int appointmentNo;
int severity;
bool isChecked;
bool isUpdatedByNurse;
String remarks;
int createdBy;
String createdOn;
int editedBy;
String editedOn;
ListHisProgNotePatientAllergyDiseaseVM(
{this.patientMRN,
this.allergyDiseaseType,
this.allergyDiseaseId,
this.episodeId,
this.appointmentNo,
this.severity,
this.isChecked,
this.isUpdatedByNurse,
this.remarks,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn});
ListHisProgNotePatientAllergyDiseaseVM.fromJson(Map<String, dynamic> json) {
patientMRN = json['patientMRN'];
allergyDiseaseType = json['allergyDiseaseType'];
allergyDiseaseId = json['allergyDiseaseId'];
episodeId = json['episodeId'];
appointmentNo = json['appointmentNo'];
severity = json['severity'];
isChecked = json['isChecked'];
isUpdatedByNurse = json['isUpdatedByNurse'];
remarks = json['remarks'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedBy = json['editedBy'];
editedOn = json['editedOn'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['patientMRN'] = this.patientMRN;
data['allergyDiseaseType'] = this.allergyDiseaseType;
data['allergyDiseaseId'] = this.allergyDiseaseId;
data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo;
data['severity'] = this.severity;
data['isChecked'] = this.isChecked;
data['isUpdatedByNurse'] = this.isUpdatedByNurse;
data['remarks'] = this.remarks;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
return data;
}
}

@ -0,0 +1,69 @@
class PostAssessmentRequestModel {
int patientMRN;
int appointmentNo;
int episodeId;
List<IcdCodeDetails> icdCodeDetails;
PostAssessmentRequestModel(
{this.patientMRN,
this.appointmentNo,
this.episodeId,
this.icdCodeDetails});
PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId'];
if (json['icdCodeDetails'] != null) {
icdCodeDetails = new List<IcdCodeDetails>();
json['icdCodeDetails'].forEach((v) {
icdCodeDetails.add(new IcdCodeDetails.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId;
if (this.icdCodeDetails != null) {
data['icdCodeDetails'] =
this.icdCodeDetails.map((v) => v.toJson()).toList();
}
return data;
}
}
class IcdCodeDetails {
String icdcode10Id;
int conditionId;
int diagnosisTypeId;
bool complexDiagnosis;
String remarks;
IcdCodeDetails(
{this.icdcode10Id,
this.conditionId,
this.diagnosisTypeId,
this.complexDiagnosis,
this.remarks});
IcdCodeDetails.fromJson(Map<String, dynamic> json) {
icdcode10Id = json['icdcode10Id'];
conditionId = json['conditionId'];
diagnosisTypeId = json['diagnosisTypeId'];
complexDiagnosis = json['complexDiagnosis'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['icdcode10Id'] = this.icdcode10Id;
data['conditionId'] = this.conditionId;
data['diagnosisTypeId'] = this.diagnosisTypeId;
data['complexDiagnosis'] = this.complexDiagnosis;
data['remarks'] = this.remarks;
return data;
}
}

@ -0,0 +1,48 @@
class PostChiefComplaintRequestModel {
int appointmentNo;
int episodeID;
int patientMRN;
String chiefComplaint;
String hopi;
String currentMedication;
bool ispregnant;
bool isLactation;
int numberOfWeeks;
PostChiefComplaintRequestModel(
{this.appointmentNo,
this.episodeID,
this.patientMRN,
this.chiefComplaint,
this.hopi,
this.currentMedication,
this.ispregnant,
this.isLactation,
this.numberOfWeeks});
PostChiefComplaintRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
patientMRN = json['PatientMRN'];
chiefComplaint = json['chiefComplaint'];
hopi = json['Hopi'];
currentMedication = json['CurrentMedication'];
ispregnant = json['ispregnant'];
isLactation = json['isLactation'];
numberOfWeeks = json['numberOfWeeks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['PatientMRN'] = this.patientMRN;
data['chiefComplaint'] = this.chiefComplaint;
data['Hopi'] = this.hopi;
data['CurrentMedication'] = this.currentMedication;
data['ispregnant'] = this.ispregnant;
data['isLactation'] = this.isLactation;
data['numberOfWeeks'] = this.numberOfWeeks;
return data;
}
}

@ -0,0 +1,64 @@
class PostHistoriesRequestModel {
List<ListMedicalHistoryVM> listMedicalHistoryVM;
PostHistoriesRequestModel({this.listMedicalHistoryVM});
PostHistoriesRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listMedicalHistoryVM'] != null) {
listMedicalHistoryVM = new List<ListMedicalHistoryVM>();
json['listMedicalHistoryVM'].forEach((v) {
listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listMedicalHistoryVM != null) {
data['listMedicalHistoryVM'] =
this.listMedicalHistoryVM.map((v) => v.toJson()).toList();
}
return data;
}
}
class ListMedicalHistoryVM {
int patientMRN;
int historyType;
int historyId;
int episodeId;
int appointmentNo;
bool isChecked;
String remarks;
ListMedicalHistoryVM(
{this.patientMRN,
this.historyType,
this.historyId,
this.episodeId,
this.appointmentNo,
this.isChecked,
this.remarks});
ListMedicalHistoryVM.fromJson(Map<String, dynamic> json) {
patientMRN = json['patientMRN'];
historyType = json['historyType'];
historyId = json['historyId'];
episodeId = json['episodeId'];
appointmentNo = json['appointmentNo'];
isChecked = json['isChecked'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['patientMRN'] = this.patientMRN;
data['historyType'] = this.historyType;
data['historyId'] = this.historyId;
data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo;
data['isChecked'] = this.isChecked;
data['remarks'] = this.remarks;
return data;
}
}

@ -0,0 +1,99 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class PostPhysicalExamRequestModel {
List<ListHisProgNotePhysicalExaminationVM> listHisProgNotePhysicalExaminationVM;
PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM});
PostPhysicalExamRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listHisProgNotePhysicalExaminationVM'] != null) {
listHisProgNotePhysicalExaminationVM = new List<ListHisProgNotePhysicalExaminationVM>();
json['listHisProgNotePhysicalExaminationVM'].forEach((v) {
listHisProgNotePhysicalExaminationVM
.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listHisProgNotePhysicalExaminationVM != null) {
data['listHisProgNotePhysicalExaminationVM'] =
this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList();
}
return data;
}
}
class ListHisProgNotePhysicalExaminationVM {
int episodeId;
int appointmentNo;
int examType;
int examId;
int patientMRN;
bool isNormal;
bool isAbnormal;
String remarks;
int createdBy;
String createdOn;
int editedBy;
String editedOn;
bool notExamined;
MasterKeyModel masterDescription;
ListHisProgNotePhysicalExaminationVM(
{this.episodeId,
this.appointmentNo,
this.examType,
this.examId,
this.patientMRN,
this.isNormal,
this.isAbnormal,
this.remarks,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.notExamined,
this.masterDescription});
ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) {
episodeId = json['episodeId'];
appointmentNo = json['appointmentNo'];
examType = json['examType'];
examId = json['examId'];
patientMRN = json['patientMRN'];
isNormal = json['isNormal'];
isAbnormal = json['isAbnormal'];
remarks = json['remarks'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedBy = json['editedBy'];
editedOn = json['editedOn'];
notExamined = json['notExamined'];
masterDescription = json['masterDescription'] != null
? new MasterKeyModel.fromJson(json['masterDescription'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo;
data['examType'] = this.examType;
data['examId'] = this.examId;
data['patientMRN'] = this.patientMRN;
data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal;
data['remarks'] = this.remarks;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['notExamined'] = this.notExamined;
if (this.masterDescription != null) {
data['masterDescription'] = this.masterDescription.toJson();
}
return data;
}
}

@ -0,0 +1,25 @@
class PostProgressNoteRequestModel {
int appointmentNo;
int episodeId;
int patientMRN;
String planNote;
PostProgressNoteRequestModel(
{this.appointmentNo, this.episodeId, this.patientMRN, this.planNote});
PostProgressNoteRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId'];
patientMRN = json['PatientMRN'];
planNote = json['PlanNote'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId;
data['PatientMRN'] = this.patientMRN;
data['PlanNote'] = this.planNote;
return data;
}
}

@ -0,0 +1,48 @@
class ActivationCodeModel {
String mobileNumber;
String zipCode;
int channel;
int languageID;
double versionID;
int memberID;
String password;
int facilityId;
String generalid;
ActivationCodeModel(
{this.mobileNumber,
this.zipCode,
this.channel,
this.languageID,
this.versionID,
this.memberID,
this.password,
this.facilityId,
this.generalid});
ActivationCodeModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber'];
zipCode = json['ZipCode'];
channel = json['Channel'];
languageID = json['LanguageID'];
versionID = json['VersionID'];
memberID = json['MemberID'];
password = json['Password'];
facilityId = json['facilityId'];
generalid = json['generalid'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['MobileNumber'] = this.mobileNumber;
data['ZipCode'] = this.zipCode;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['VersionID'] = this.versionID;
data['MemberID'] = this.memberID;
data['Password'] = this.password;
data['facilityId'] = this.facilityId;
data['generalid'] = this.generalid;
return data;
}
}

@ -0,0 +1,64 @@
class CheckActivationCodeRequestModel {
String mobileNumber;
String zipCode;
int doctorID;
String iPAdress;
int channel;
int languageID;
int projectID;
double versionID;
String generalid;
String logInTokenID;
String activationCode;
String vidaAuthTokenID;
String vidaRefreshTokenID;
CheckActivationCodeRequestModel(
{this.mobileNumber,
this.zipCode,
this.doctorID,
this.iPAdress,
this.channel,
this.languageID,
this.projectID,
this.versionID,
this.generalid,
this.logInTokenID,
this.activationCode,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber'];
zipCode = json['ZipCode'];
doctorID = json['DoctorID'];
iPAdress = json['IPAdress'];
channel = json['Channel'];
languageID = json['LanguageID'];
projectID = json['ProjectID'];
versionID = json['VersionID'];
generalid = json['generalid'];
logInTokenID = json['LogInTokenID'];
activationCode = json['activationCode'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['MobileNumber'] = this.mobileNumber;
data['ZipCode'] = this.zipCode;
data['DoctorID'] = this.doctorID;
data['IPAdress'] = this.iPAdress;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['ProjectID'] = this.projectID;
data['VersionID'] = this.versionID;
data['generalid'] = this.generalid;
data['LogInTokenID'] = this.logInTokenID;
data['activationCode'] = this.activationCode;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
return data;
}
}

@ -0,0 +1,70 @@
class DashboardModel {
String kPIName;
int displaySequence;
List<Summaryoptions> summaryoptions;
DashboardModel({this.kPIName, this.displaySequence, this.summaryoptions});
DashboardModel.fromJson(Map<String, dynamic> json) {
kPIName = json['KPIName'];
displaySequence = json['displaySequence'];
if (json['summaryoptions'] != null) {
summaryoptions = new List<Summaryoptions>();
json['summaryoptions'].forEach((v) {
summaryoptions.add(new Summaryoptions.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['KPIName'] = this.kPIName;
data['displaySequence'] = this.displaySequence;
if (this.summaryoptions != null) {
data['summaryoptions'] =
this.summaryoptions.map((v) => v.toJson()).toList();
}
return data;
}
}
class Summaryoptions {
String kPIParameter;
String captionColor;
bool isCaptionBold;
bool isValueBold;
int order;
int value;
String valueColor;
Summaryoptions(
{this.kPIParameter,
this.captionColor,
this.isCaptionBold,
this.isValueBold,
this.order,
this.value,
this.valueColor});
Summaryoptions.fromJson(Map<String, dynamic> json) {
kPIParameter = json['KPIParameter'];
captionColor = json['captionColor'];
isCaptionBold = json['isCaptionBold'];
isValueBold = json['isValueBold'];
order = json['order'];
value = json['value'];
valueColor = json['valueColor'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['KPIParameter'] = this.kPIParameter;
data['captionColor'] = this.captionColor;
data['isCaptionBold'] = this.isCaptionBold;
data['isValueBold'] = this.isValueBold;
data['order'] = this.order;
data['value'] = this.value;
data['valueColor'] = this.valueColor;
return data;
}
}

@ -5,10 +5,14 @@ class ListDoctorWorkingHoursTable {
String dayName; String dayName;
String workingHours; String workingHours;
ListDoctorWorkingHoursTable({this.date, this.dayName, this.workingHours}); ListDoctorWorkingHoursTable({
this.date,
this.dayName,
this.workingHours,
});
ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) { ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) {
date = Helpers.convertStringToDate(json['Date']) ; date = Helpers.convertStringToDate(json['Date']);
dayName = json['DayName']; dayName = json['DayName'];
workingHours = json['WorkingHours']; workingHours = json['WorkingHours'];
} }
@ -18,6 +22,7 @@ class ListDoctorWorkingHoursTable {
data['Date'] = this.date; data['Date'] = this.date;
data['DayName'] = this.dayName; data['DayName'] = this.dayName;
data['WorkingHours'] = this.workingHours; data['WorkingHours'] = this.workingHours;
return data; return data;
} }
} }
@ -25,6 +30,5 @@ class ListDoctorWorkingHoursTable {
class WorkingHours { class WorkingHours {
String from; String from;
String to; String to;
WorkingHours({this.from,this.to}); WorkingHours({this.from, this.to});
} }

@ -0,0 +1,84 @@
class PatientArrivalEntity {
String age;
String appointmentDate;
int appointmentNo;
String appointmentType;
String arrivedOn;
String companyName;
String endTime;
int episodeNo;
int fallRiskScore;
String gender;
int medicationOrders;
String mobileNumber;
String nationality;
int patientMRN;
String patientName;
int rowCount;
String startTime;
String visitType;
PatientArrivalEntity(
{this.age,
this.appointmentDate,
this.appointmentNo,
this.appointmentType,
this.arrivedOn,
this.companyName,
this.endTime,
this.episodeNo,
this.fallRiskScore,
this.gender,
this.medicationOrders,
this.mobileNumber,
this.nationality,
this.patientMRN,
this.patientName,
this.rowCount,
this.startTime,
this.visitType});
PatientArrivalEntity.fromJson(Map<String, dynamic> json) {
age = json['age'];
appointmentDate = json['appointmentDate'];
appointmentNo = json['appointmentNo'];
appointmentType = json['appointmentType'];
arrivedOn = json['arrivedOn'];
companyName = json['companyName'];
endTime = json['endTime'];
episodeNo = json['episodeNo'];
fallRiskScore = json['fallRiskScore'];
gender = json['gender'];
medicationOrders = json['medicationOrders'];
mobileNumber = json['mobileNumber'];
nationality = json['nationality'];
patientMRN = json['patientMRN'];
patientName = json['patientName'];
rowCount = json['rowCount'];
startTime = json['startTime'];
visitType = json['visitType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['age'] = this.age;
data['appointmentDate'] = this.appointmentDate;
data['appointmentNo'] = this.appointmentNo;
data['appointmentType'] = this.appointmentType;
data['arrivedOn'] = this.arrivedOn;
data['companyName'] = this.companyName;
data['endTime'] = this.endTime;
data['episodeNo'] = this.episodeNo;
data['fallRiskScore'] = this.fallRiskScore;
data['gender'] = this.gender;
data['medicationOrders'] = this.medicationOrders;
data['mobileNumber'] = this.mobileNumber;
data['nationality'] = this.nationality;
data['patientMRN'] = this.patientMRN;
data['patientName'] = this.patientName;
data['rowCount'] = this.rowCount;
data['startTime'] = this.startTime;
data['visitType'] = this.visitType;
return data;
}
}

@ -0,0 +1,119 @@
class PendingReferral {
String responded;
String answerFromTarget;
String createdOn;
int data;
String editedOn;
int interBranchReferral;
int patientID;
String patientName;
int patientType;
int referralNo;
String referralStatus;
String referredByDoctorInfo;
String referredFromBranchName;
String referredOn;
String referredType;
String remarksFromSource;
String respondedOn;
int sourceAppointmentNo;
int sourceProjectId;
String sourceSetupID;
String startDate;
int targetAppointmentNo;
String targetClinicID;
String targetDoctorID;
int targetProjectId;
String targetSetupID;
bool isReferralDoctorSameBranch;
PendingReferral(
{this.responded,
this.answerFromTarget,
this.createdOn,
this.data,
this.editedOn,
this.interBranchReferral,
this.patientID,
this.patientName,
this.patientType,
this.referralNo,
this.referralStatus,
this.referredByDoctorInfo,
this.referredFromBranchName,
this.referredOn,
this.referredType,
this.remarksFromSource,
this.respondedOn,
this.sourceAppointmentNo,
this.sourceProjectId,
this.sourceSetupID,
this.startDate,
this.targetAppointmentNo,
this.targetClinicID,
this.targetDoctorID,
this.targetProjectId,
this.targetSetupID,
this.isReferralDoctorSameBranch,
});
PendingReferral.fromJson(Map<String, dynamic> json) {
responded = json['Responded'];
answerFromTarget = json['answerFromTarget'];
createdOn = json['createdOn'];
data = json['data'];
editedOn = json['editedOn'];
interBranchReferral = json['interBranchReferral'];
patientID = json['patientID'];
patientName = json['patientName'];
patientType = json['patientType'];
referralNo = json['referralNo'];
referralStatus = json['referralStatus'];
referredByDoctorInfo = json['referredByDoctorInfo'];
referredFromBranchName = json['referredFromBranchName'];
referredOn = json['referredOn'];
referredType = json['referredType'];
remarksFromSource = json['remarksFromSource'];
respondedOn = json['respondedOn'];
sourceAppointmentNo = json['sourceAppointmentNo'];
sourceProjectId = json['sourceProjectId'];
sourceSetupID = json['sourceSetupID'];
startDate = json['startDate'];
targetAppointmentNo = json['targetAppointmentNo'];
targetClinicID = json['targetClinicID'];
targetDoctorID = json['targetDoctorID'];
targetProjectId = json['targetProjectId'];
targetSetupID = json['targetSetupID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Responded'] = this.responded;
data['answerFromTarget'] = this.answerFromTarget;
data['createdOn'] = this.createdOn;
data['data'] = this.data;
data['editedOn'] = this.editedOn;
data['interBranchReferral'] = this.interBranchReferral;
data['patientID'] = this.patientID;
data['patientName'] = this.patientName;
data['patientType'] = this.patientType;
data['referralNo'] = this.referralNo;
data['referralStatus'] = this.referralStatus;
data['referredByDoctorInfo'] = this.referredByDoctorInfo;
data['referredFromBranchName'] = this.referredFromBranchName;
data['referredOn'] = this.referredOn;
data['referredType'] = this.referredType;
data['remarksFromSource'] = this.remarksFromSource;
data['respondedOn'] = this.respondedOn;
data['sourceAppointmentNo'] = this.sourceAppointmentNo;
data['sourceProjectId'] = this.sourceProjectId;
data['sourceSetupID'] = this.sourceSetupID;
data['startDate'] = this.startDate;
data['targetAppointmentNo'] = this.targetAppointmentNo;
data['targetClinicID'] = this.targetClinicID;
data['targetDoctorID'] = this.targetDoctorID;
data['targetProjectId'] = this.targetProjectId;
data['targetSetupID'] = this.targetSetupID;
return data;
}
}

@ -59,6 +59,7 @@ class MyReferredPatientModel {
this.priorityDescription, this.priorityDescription,
this.referralClinicDescription, this.referralClinicDescription,
this.referralDoctorName, this.referralDoctorName,
this.isReferralDoctorSameBranch,
}); });
int projectId; int projectId;
@ -111,6 +112,7 @@ class MyReferredPatientModel {
String priorityDescription; String priorityDescription;
String referralClinicDescription; String referralClinicDescription;
String referralDoctorName; String referralDoctorName;
bool isReferralDoctorSameBranch;
factory MyReferredPatientModel.fromJson(Map<String, dynamic> json) => MyReferredPatientModel( factory MyReferredPatientModel.fromJson(Map<String, dynamic> json) => MyReferredPatientModel(
projectId: json["ProjectID"], projectId: json["ProjectID"],

@ -0,0 +1,136 @@
class VitalSignData {
int appointmentNo;
int bloodPressureCuffLocation;
int bloodPressureCuffSize;
int bloodPressureHigher;
int bloodPressureLower;
int bloodPressurePatientPosition;
double bodyMassIndex;
int fio2;
int headCircumCm;
int heightCm;
int idealBodyWeightLbs;
bool isPainManagementDone;
bool isVitalsRequired;
int leanBodyWeightLbs;
String painCharacter;
String painDuration;
String painFrequency;
String painLocation;
int painScore;
int patientMRN;
int patientType;
int pulseBeatPerMinute;
int pulseRhythm;
int respirationBeatPerMinute;
int respirationPattern;
int sao2;
int status;
int temperatureCelcius;
int temperatureCelciusMethod;
int waistSizeInch;
int weightKg;
VitalSignData(
{this.appointmentNo,
this.bloodPressureCuffLocation,
this.bloodPressureCuffSize,
this.bloodPressureHigher,
this.bloodPressureLower,
this.bloodPressurePatientPosition,
this.bodyMassIndex,
this.fio2,
this.headCircumCm,
this.heightCm,
this.idealBodyWeightLbs,
this.isPainManagementDone,
this.isVitalsRequired,
this.leanBodyWeightLbs,
this.painCharacter,
this.painDuration,
this.painFrequency,
this.painLocation,
this.painScore,
this.patientMRN,
this.patientType,
this.pulseBeatPerMinute,
this.pulseRhythm,
this.respirationBeatPerMinute,
this.respirationPattern,
this.sao2,
this.status,
this.temperatureCelcius,
this.temperatureCelciusMethod,
this.waistSizeInch,
this.weightKg});
VitalSignData.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo'];
bloodPressureCuffLocation = json['bloodPressureCuffLocation'];
bloodPressureCuffSize = json['bloodPressureCuffSize'];
bloodPressureHigher = json['bloodPressureHigher'];
bloodPressureLower = json['bloodPressureLower'];
bloodPressurePatientPosition = json['bloodPressurePatientPosition'];
bodyMassIndex = json['bodyMassIndex'];
fio2 = json['fio2'];
headCircumCm = json['headCircumCm'];
heightCm = json['heightCm'];
idealBodyWeightLbs = json['idealBodyWeightLbs'];
isPainManagementDone = json['isPainManagementDone'];
isVitalsRequired = json['isVitalsRequired'];
leanBodyWeightLbs = json['leanBodyWeightLbs'];
painCharacter = json['painCharacter'];
painDuration = json['painDuration'];
painFrequency = json['painFrequency'];
painLocation = json['painLocation'];
painScore = json['painScore'];
patientMRN = json['patientMRN'];
patientType = json['patientType'];
pulseBeatPerMinute = json['pulseBeatPerMinute'];
pulseRhythm = json['pulseRhythm'];
respirationBeatPerMinute = json['respirationBeatPerMinute'];
respirationPattern = json['respirationPattern'];
sao2 = json['sao2'];
status = json['status'];
temperatureCelcius = json['temperatureCelcius'];
temperatureCelciusMethod = json['temperatureCelciusMethod'];
waistSizeInch = json['waistSizeInch'];
weightKg = json['weightKg'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo;
data['bloodPressureCuffLocation'] = this.bloodPressureCuffLocation;
data['bloodPressureCuffSize'] = this.bloodPressureCuffSize;
data['bloodPressureHigher'] = this.bloodPressureHigher;
data['bloodPressureLower'] = this.bloodPressureLower;
data['bloodPressurePatientPosition'] = this.bloodPressurePatientPosition;
data['bodyMassIndex'] = this.bodyMassIndex;
data['fio2'] = this.fio2;
data['headCircumCm'] = this.headCircumCm;
data['heightCm'] = this.heightCm;
data['idealBodyWeightLbs'] = this.idealBodyWeightLbs;
data['isPainManagementDone'] = this.isPainManagementDone;
data['isVitalsRequired'] = this.isVitalsRequired;
data['leanBodyWeightLbs'] = this.leanBodyWeightLbs;
data['painCharacter'] = this.painCharacter;
data['painDuration'] = this.painDuration;
data['painFrequency'] = this.painFrequency;
data['painLocation'] = this.painLocation;
data['painScore'] = this.painScore;
data['patientMRN'] = this.patientMRN;
data['patientType'] = this.patientType;
data['pulseBeatPerMinute'] = this.pulseBeatPerMinute;
data['pulseRhythm'] = this.pulseRhythm;
data['respirationBeatPerMinute'] = this.respirationBeatPerMinute;
data['respirationPattern'] = this.respirationPattern;
data['sao2'] = this.sao2;
data['status'] = this.status;
data['temperatureCelcius'] = this.temperatureCelcius;
data['temperatureCelciusMethod'] = this.temperatureCelciusMethod;
data['waistSizeInch'] = this.waistSizeInch;
data['weightKg'] = this.weightKg;
return data;
}
}

@ -0,0 +1,32 @@
class AddSickLeaveRequest {
String patientMRN;
String appointmentNo;
String startDate;
String noOfDays;
String remarks;
AddSickLeaveRequest(
{this.patientMRN,
this.appointmentNo,
this.startDate,
this.noOfDays,
this.remarks});
AddSickLeaveRequest.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
startDate = json['StartDate'];
noOfDays = json['NoOfDays'];
remarks = json['Remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['StartDate'] = this.startDate;
data['NoOfDays'] = this.noOfDays;
data['Remarks'] = this.remarks;
return data;
}
}

@ -0,0 +1,25 @@
class ExtendSickLeaveRequest {
String patientMRN;
String previousRequestNo;
String noOfDays;
String remarks;
ExtendSickLeaveRequest(
{this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks});
ExtendSickLeaveRequest.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
previousRequestNo = json['PreviousRequestNo'];
noOfDays = json['NoOfDays'];
remarks = json['Remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['PreviousRequestNo'] = this.previousRequestNo;
data['NoOfDays'] = this.noOfDays;
data['Remarks'] = this.remarks;
return data;
}
}

@ -0,0 +1,44 @@
class GetAllSickLeaveResponse {
int appointmentNo;
bool isExtendedLeave;
int noOfDays;
int patientMRN;
String remarks;
int requestNo;
String startDate;
int status;
GetAllSickLeaveResponse(
{this.appointmentNo,
this.isExtendedLeave,
this.noOfDays,
this.patientMRN,
this.remarks,
this.requestNo,
this.startDate,
this.status});
GetAllSickLeaveResponse.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo'];
isExtendedLeave = json['isExtendedLeave'];
noOfDays = json['noOfDays'];
patientMRN = json['patientMRN'];
remarks = json['remarks'];
requestNo = json['requestNo'];
startDate = json['startDate'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo;
data['isExtendedLeave'] = this.isExtendedLeave;
data['noOfDays'] = this.noOfDays;
data['patientMRN'] = this.patientMRN;
data['remarks'] = this.remarks;
data['requestNo'] = this.requestNo;
data['startDate'] = this.startDate;
data['status'] = this.status;
return data;
}
}

@ -22,7 +22,7 @@ class RootPage extends StatelessWidget {
); );
break; break;
case APP_STATUS.UNAUTHENTICATED: case APP_STATUS.UNAUTHENTICATED:
return Loginsreen(); return LandingPage();
break; break;
case APP_STATUS.AUTHENTICATED: case APP_STATUS.AUTHENTICATED:
return LandingPage(); return LandingPage();

@ -7,6 +7,10 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart';
import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart';
import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/add_SOAP_index.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart';
import './screens/QR_reader_screen.dart'; import './screens/QR_reader_screen.dart';
import './screens/auth/change_password_screen.dart'; import './screens/auth/change_password_screen.dart';
@ -37,6 +41,10 @@ import './screens/settings/settings_screen.dart';
import 'landing_page.dart'; import 'landing_page.dart';
import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/doctor/doctor_reply_screen.dart';
import 'screens/live_care/panding_list.dart'; import 'screens/live_care/panding_list.dart';
import 'screens/patients/profile/referral/my-referral-detail-screen.dart';
import 'screens/patients/profile/referral/refer-patient-screen.dart';
import 'screens/prescription/prescription_screen.dart';
import 'screens/patients/profile/vital_sign/vital-signs-screen.dart';
const String INIT_ROUTE = ROOT; const String INIT_ROUTE = ROOT;
const String ROOT = 'root'; const String ROOT = 'root';
@ -65,15 +73,26 @@ const String PRESCRIPTIONS = 'patients/prescription';
const String RADIOLOGY = 'patients/radiology'; const String RADIOLOGY = 'patients/radiology';
const String PROGRESS_NOTE = 'patients/progress-note'; const String PROGRESS_NOTE = 'patients/progress-note';
const String REFER_PATIENT = 'patients/refer-patient'; const String REFER_PATIENT = 'patients/refer-patient';
const String MY_REFERRAL_DETAIL = 'my_referral_detail';
const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor';
const String PATIENT_ORDERS = 'patients/patient_orders'; const String PATIENT_ORDERS = 'patients/patient_orders';
const String PATIENT_INSURANCE_APPROVALS = const String PATIENT_INSURANCE_APPROVALS =
'patients/patient_insurance_approvals'; 'patients/patient_insurance_approvals';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String CREATE_EPISODE = 'patients/create-episode';
const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data';
const String UPDATE_EPISODE = 'patients/create-episode';
const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String BODY_MEASUREMENTS = 'patients/body-measurements';
const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
// const String VIDEO_CALL = 'video-call'; // const String VIDEO_CALL = 'video-call';
const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist';
const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss';
const String ORDER_PROCEDURE = 'procedure/procedure';
// const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox';
const String PATIENT_SICKLEAVE = 'patients/patient_sickleave';
const String ADD_SICKLEAVE = 'add-sickleave';
//todo: change the routing way.
var routes = { var routes = {
ROOT: (_) => RootPage(), ROOT: (_) => RootPage(),
HOME: (_) => LandingPage(), HOME: (_) => LandingPage(),
@ -102,12 +121,23 @@ var routes = {
RADIOLOGY: (_) => RadiologyScreen(), RADIOLOGY: (_) => RadiologyScreen(),
PROGRESS_NOTE: (_) => ProgressNoteScreen(), PROGRESS_NOTE: (_) => ProgressNoteScreen(),
REFER_PATIENT: (_) => ReferPatientScreen(), REFER_PATIENT: (_) => ReferPatientScreen(),
REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(),
PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_ORDERS: (_) => PatientsOrdersScreen(),
PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(),
CREATE_EPISODE: (_) => AddSOAPIndex(),
UPDATE_EPISODE: (_) => AddSOAPIndex(isUpdate: true,),
BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(),
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
// VIDEO_CALL: (_) => VideoCallPage(patientData: null), // VIDEO_CALL: (_) => VideoCallPage(patientData: null),
LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(), LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(),
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox(),
PATIENT_SICKLEAVE: (_) => SickLeaveScreen(),
ADD_SICKLEAVE: (_) => AddSickLeavScreen(),
ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(),
ORDER_PROCEDURE: (_) => ProcedureScreen(),
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox() // LIVECARE_END_DIALOG: (_) => EndCallDialogBox()
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
}; };

@ -13,9 +13,13 @@ import '../../widgets/auth/verification_methods.dart';
*@desc: Verification Methods screen *@desc: Verification Methods screen
*/ */
class VerificationMethodsScreen extends StatefulWidget { class VerificationMethodsScreen extends StatefulWidget {
const VerificationMethodsScreen({Key key, this.password}) : super(key: key);
@override @override
_VerificationMethodsScreenState createState() => _VerificationMethodsScreenState createState() =>
_VerificationMethodsScreenState(); _VerificationMethodsScreenState();
final password;
} }
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> { class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
@ -47,6 +51,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: <Widget>[ children: <Widget>[
AuthHeader(loginType.verificationMethods), AuthHeader(loginType.verificationMethods),
VerificationMethods( VerificationMethods(
password: widget.password,
changeLoadingStata: changeLoadingStata, changeLoadingStata: changeLoadingStata,
), ),
], ],

File diff suppressed because it is too large Load Diff

@ -34,7 +34,7 @@ class PharmaciesListScreen extends StatefulWidget {
class _PharmaciesListState extends State<PharmaciesListScreen> { class _PharmaciesListState extends State<PharmaciesListScreen> {
var _data; var _data;
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectProvider projectsProvider; ProjectViewModel projectsProvider;
bool _isInit = true; bool _isInit = true;
//bool _isOutOfStuck = false; //bool _isOutOfStuck = false;

@ -39,7 +39,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
String _selectedType = '1'; String _selectedType = '1';
String _selectedLocation = '1'; String _selectedLocation = '1';
String error = ''; String error = '';
ProjectProvider projectsProvider; ProjectViewModel projectsProvider;
String itemText = ''; String itemText = '';
String itemText2 = ''; String itemText2 = '';
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
@ -534,7 +534,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
), ),
], ],
), ),
) ),
], ],
)); ));
} }

@ -46,6 +46,7 @@ class _PatientReferredScreenState extends State<PatientReferredScreen> {
List<String>list=List(); List<String>list=List();
return AppScaffold( return AppScaffold(
//TODO : add Translation
appBarTitle: "My Referred Patients",//patientTypetitle, appBarTitle: "My Referred Patients",//patientTypetitle,
body: Center( body: Center(

@ -60,7 +60,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
bool _isError = false; bool _isError = false;
String error = ""; String error = "";
ProjectProvider projectsProvider; ProjectViewModel projectsProvider;
final _controller = TextEditingController(); final _controller = TextEditingController();
@ -238,24 +238,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_locations = [ _locations = [
TranslationBase TranslationBase.of(context).all,
.of(context) TranslationBase.of(context).today,
.all, TranslationBase.of(context).tomorrow,
TranslationBase TranslationBase.of(context).nextWeek,
.of(context)
.today,
TranslationBase
.of(context)
.tomorrow,
TranslationBase
.of(context)
.nextWeek,
]; ];
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
final routeArgs = ModalRoute final routeArgs = ModalRoute.of(context).settings.arguments as Map;
.of(context)
.settings
.arguments as Map;
patient = routeArgs['patientSearchForm']; patient = routeArgs['patientSearchForm'];
@ -315,12 +304,11 @@ class _PatientsScreenState extends State<PatientsScreen> {
}); });
}); });
}, },
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold( appBarTitle: patientTypeTitle,
appBarTitle: patientTypeTitle, body: _isLoading
body: _isLoading ? DrAppCircularProgressIndeicator()
? DrAppCircularProgressIndeicator() : _isError
: _isError
? DrAppEmbeddedError(error: error) ? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0 : lItems == null || lItems.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
@ -332,379 +320,378 @@ class _PatientsScreenState extends State<PatientsScreen> {
children: <Widget>[ children: <Widget>[
Container( Container(
child: lItems == null child: lItems == null
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(
0, 0, 0, 0), //250 0, 0, 0, 0), //250
child: child:
DrAppCircularProgressIndeicator(), DrAppCircularProgressIndeicator(),
)), )),
),
],
)
: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context)
.size
.height *
0.03),
child: SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient"
? _locationBar(context)
: Container(),
),
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: SizeConfig.screenHeight * 0.05,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str);
},
decoration: buildInputDecoration(
context,
TranslationBase.of(context)
.searchPatient),
), ),
), ],
SizedBox( )
height: 10.0, : Column(
), children: <Widget>[
Divider( Padding(
thickness: 0.8, padding: EdgeInsets.only(
color: Color(0xffCCCCCC), top: MediaQuery.of(context)
), .size
Container( .height *
decoration: BoxDecoration( 0.03),
color: Color(0Xffffffff), child: SERVICES_PATIANT2[
borderRadius: int.parse(patientType)] ==
BorderRadius.circular(20)), "List_MyOutPatient"
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), ? _locationBar(context)
child: (responseModelList.length > 0) : Container(),
? Column( ),
// mainAxisAlignment: MainAxisAlignment.center, SizedBox(height: 18.5),
children: responseModelList.map( Container(
(PatiantInformtion item) { width: SizeConfig.screenWidth * 0.9,
return Container( height:
decoration: SizeConfig.screenHeight * 0.05,
myBoxDecoration(), child: TextField(
child: InkWell( controller: _controller,
child: Row( onChanged: (String str) {
children: <Widget>[ this.searchData(str);
Column( },
mainAxisAlignment: decoration: buildInputDecoration(
MainAxisAlignment context,
.start, TranslationBase.of(context)
children: <Widget>[ .searchPatient),
Padding( ),
padding: EdgeInsets ),
.only( SizedBox(
left: height: 10.0,
12.0), ),
child: Divider(
Container( thickness: 0.8,
decoration: color: Color(0xffCCCCCC),
BoxDecoration( ),
boxShadow: [ Container(
BoxShadow( decoration: BoxDecoration(
color: Color.fromRGBO( color: Color(0Xffffffff),
0, borderRadius:
0, BorderRadius.circular(20)),
0, margin:
0.08), EdgeInsets.fromLTRB(0, 0, 0, 0),
offset: Offset( child: (responseModelList.length > 0)
0.0, ? Column(
5.0), // mainAxisAlignment: MainAxisAlignment.center,
blurRadius: children: responseModelList
16.0) .map((PatiantInformtion
], item) {
borderRadius: return Container(
BorderRadius.all( decoration:
Radius.circular(35.0)), myBoxDecoration(),
color: Color( child: InkWell(
0xffCCCCCC), child: Row(
), children: <Widget>[
width: 70, Column(
height: 70, mainAxisAlignment:
child: Icon( MainAxisAlignment
item.genderDescription == .start,
"Male" children: <
? DoctorApp Widget>[
.male Padding(
: DoctorApp padding: EdgeInsets
.female_icon, .only(
size: 70, left:
color: Colors 12.0),
.white, child:
Container(
decoration:
BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset: Offset(0.0,
5.0),
blurRadius:
16.0)
],
borderRadius:
BorderRadius.all(
Radius.circular(35.0)),
color: Color(
0xffCCCCCC),
),
width: 70,
height: 70,
child: Icon(
item.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 70,
color: Colors
.white,
),
), ),
), ),
), ],
], ),
),
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment
.start, .start,
children: [ children: [
Column( Column(
children: [ children: [
SizedBox( SizedBox(
height: height:
10.0, 10.0,
),
Padding(
padding: EdgeInsets.symmetric(
vertical:
5.5,
horizontal:
22.5),
child:
AppText(
item.firstName +
" " +
item.lastName,
fontSize:
2.0 *
SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
), ),
), Padding(
], padding: EdgeInsets.symmetric(
), vertical:
Row( 5.5,
mainAxisAlignment: horizontal:
MainAxisAlignment 22.5),
.spaceAround, child:
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Wrap(
children: [
AppText( AppText(
TranslationBase.of(context).fileNo, item.firstName +
fontSize: 1.8 * SizeConfig.textMultiplier, " " +
fontWeight: FontWeight.bold, item.lastName,
backGroundcolor: Colors.white,
),
AppText(
item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
AppText(
'NATIONALITY: ' +
item.nationalityName.toString(),
fontSize: fontSize:
1.8 * SizeConfig.textMultiplier, 2.0 * SizeConfig.textMultiplier,
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
backGroundcolor: backGroundcolor:
Colors.white, Colors.white,
), ),
SizedBox( ),
height: ],
15.5, ),
), Row(
SERVICES_PATIANT2[int.parse(patientType)] == mainAxisAlignment:
"List_MyOutPatient" MainAxisAlignment
? Row( .spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: <Widget>[ Column(
Container( crossAxisAlignment:
height: 15, CrossAxisAlignment.start,
width: 60, children: <
decoration: BoxDecoration( Widget>[
borderRadius: BorderRadius.circular(25), Wrap(
color: HexColor("#20A169"), children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
AppText(
'NATIONALITY: ' +
item.nationalityName.toString(),
fontSize:
1.8 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(
height:
15.5,
),
SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
), ),
child: AppText( SizedBox(
item.startTime, width: 3.5,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
), ),
), Container(
SizedBox( child: AppText(
width: 3.5, convertDateFormat2(item.appointmentDate.toString()),
), fontSize: 1.5 * SizeConfig.textMultiplier,
Container( fontWeight: FontWeight.bold,
child: AppText( ),
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
), ),
), SizedBox(
SizedBox( height: 0.5,
height: 0.5, )
) ],
], )
) : SizedBox(
: SizedBox( height: 5,
height: 5, ),
],
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
// mainAxisAlignment:
// MainAxisAlignment
// .spaceBetween,
children: <
Widget>[
SizedBox(
height:
0.5,
),
SizedBox(
height:
0,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).age2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
), ),
], AppText(
), item.age.toString(),
Column( fontSize: 1.8 * SizeConfig.textMultiplier,
crossAxisAlignment: fontWeight: FontWeight.w300,
CrossAxisAlignment backGroundcolor: Colors.white,
.start, ),
// mainAxisAlignment: ],
// MainAxisAlignment ),
// .spaceBetween, SizedBox(
children: < height:
Widget>[ 2.5,
SizedBox( ),
height: Wrap(
0.5, children: [
), AppText(
SizedBox( TranslationBase.of(context).gender2,
height: fontSize: 1.8 * SizeConfig.textMultiplier,
0, fontWeight: FontWeight.bold,
), backGroundcolor: Colors.white,
Wrap( ),
children: [ AppText(
AppText( item.gender.toString() == '1' ? 'Male' : 'Female',
TranslationBase.of(context).age2, fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300,
fontWeight: FontWeight.bold, backGroundcolor: Colors.white,
backGroundcolor: Colors.white, ),
), ],
AppText( ),
item.age.toString(), SizedBox(
fontSize: 1.8 * SizeConfig.textMultiplier, height:
fontWeight: FontWeight.w300, 8,
backGroundcolor: Colors.white, ),
), SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
], ? Row(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
SizedBox( children: <Widget>[
height: Container(
2.5, height: 15,
), width: 60,
Wrap( decoration: BoxDecoration(
children: [ borderRadius: BorderRadius.circular(25),
AppText( color: HexColor("#20A169"),
TranslationBase.of(context).gender2, ),
fontSize: 1.8 * SizeConfig.textMultiplier, child: AppText(
fontWeight: FontWeight.bold, item.startTime,
backGroundcolor: Colors.white, color: Colors.white,
), fontSize: 1.5 * SizeConfig.textMultiplier,
AppText( textAlign: TextAlign.center,
item.gender.toString() == '1' ? 'Male' : 'Female', fontWeight: FontWeight.bold,
fontSize: 1.8 * SizeConfig.textMultiplier, ),
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
8,
),
SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
), ),
child: AppText( SizedBox(
item.startTime, width: 3.5,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
), ),
), Container(
SizedBox( child: AppText(
width: 3.5, convertDateFormat2(item.appointmentDate.toString()),
), fontSize: 1.5 * SizeConfig.textMultiplier,
Container( fontWeight: FontWeight.bold,
child: AppText( ),
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
), ),
), SizedBox(
SizedBox( height: 25.5,
height: 25.5, ),
), ],
], )
) : SizedBox(
: SizedBox( height: 15,
height: 15, ),
), ],
], ),
), ],
], ),
), ],
], ),
), ),
), // Divider(color: Colors.grey)
// Divider(color: Colors.grey) ],
], ),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item
});
},
), ),
onTap: () { );
Navigator.of(context) }).toList(),
.pushNamed( )
PATIENTS_PROFILE, : Center(
arguments: { child: DrAppEmbeddedError(
"patient": item error: TranslationBase.of(
}); context)
}, .youDontHaveAnyPatient),
), ),
);
}).toList(),
)
: Center(
child: DrAppEmbeddedError(
error: TranslationBase.of(
context)
.youDontHaveAnyPatient),
), ),
), ],
], ),
), )
) ],
], ),
), ),
), ),
),); );
} }
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -774,7 +761,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
), ),
), ),
onTap: () { onTap: () {
filterBooking(item.toString()); filterBooking(item.toString());
setState(() { setState(() {

@ -6,9 +6,11 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -34,427 +36,275 @@ class ReferPatientScreen extends StatefulWidget {
} }
class _ReferPatientState extends State<ReferPatientScreen> { class _ReferPatientState extends State<ReferPatientScreen> {
var doctorsList; dynamic _selectedClinic;
final _remarksController = TextEditingController(); dynamic _selectedDoctor;
final _extController = TextEditingController(); final _extController = TextEditingController();
var _isInit = true;
bool isValid;
var clinicId;
var doctorId;
var freqId;
String _selectedClinic;
String _selectedDoctor;
String _selectedReferralFrequancy;
int _activePriority = 1; int _activePriority = 1;
dynamic _selectedFrequency;
FocusNode myFocusNode = FocusNode(); final _remarksController = TextEditingController();
bool isValid;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).myReferralPatient, appBarTitle: TranslationBase.of(context).referralPatient,
body: model.clinicsList == null body: model.clinicsList == null
? DrAppEmbeddedError(error: 'Something Wrong!') ? DrAppEmbeddedError(error: 'Something Wrong!')
: SingleChildScrollView( : SingleChildScrollView(
child: Column( child: Container(
mainAxisAlignment: MainAxisAlignment.start, margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.start,
AppText( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).clinic, children: <Widget>[
fontSize: 18, Container(
fontWeight: FontWeight.bold, height: screenSize.height * 0.070,
marginLeft: 15, child: InkWell(
marginTop: 15, onTap: model.clinicsList != null &&
), model.clinicsList.length > 0
RoundedContainer( ? () {
margin: 10, ListSelectDialog dialog = ListSelectDialog(
showBorder: true, list: model.clinicsList,
raduis: 30, attributeName: 'ClinicDescription',
borderColor: Color(0xff707070), attributeValueId: 'ClinicID',
width: double.infinity, okText: TranslationBase.of(context).ok,
child: Padding( okFunction: (selectedValue) {
padding: EdgeInsets.only( setState(() {
top: SizeConfig.widthMultiplier * 0.9, _selectedDoctor = null;
bottom: SizeConfig.widthMultiplier * 0.9, _selectedClinic = selectedValue;
right: SizeConfig.widthMultiplier * 3, model.getDoctorsList(
left: SizeConfig.widthMultiplier * 3), _selectedClinic['ClinicID']
child: Row( .toString());
mainAxisSize: MainAxisSize.max, });
children: <Widget>[ },
Expanded( );
// add Expanded to have your dropdown button fill remaining space showDialog(
child: DropdownButton( barrierDismissible: false,
isExpanded: true, context: context,
value: _selectedClinic, builder: (BuildContext context) {
iconSize: 40, return dialog;
elevation: 16, },
selectedItemBuilder: );
(BuildContext context) { }
return model : null,
.getClinicNameList() child: TextField(
.map((item) { decoration: textFieldSelectorDecoration(
return Row( TranslationBase.of(context).clinicSelect,
mainAxisSize: MainAxisSize.max, _selectedClinic != null
children: <Widget>[ ? _selectedClinic['ClinicDescription']
AppText( : null,
item, true),
fontSize: enabled: false,
SizeConfig.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
_selectedDoctor = null;
_selectedClinic = newValue;
var clinicInfo = model
.clinicsList
.where((i) =>
i['ClinicDescription']
.toString()
.contains(
_selectedClinic))
.toList();
clinicId = clinicInfo[0]['ClinicID']
.toString();
model.getDoctorsList(clinicId);
})
},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign: TextAlign.end,
),
);
}).toList(),
),
),
],
),
),
),
//--------------------------------------------------------------------//
AppText(
TranslationBase.of(context).doctor,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
RoundedContainer(
margin: 10,
showBorder: true,
raduis: 30,
borderColor: Color(0xff707070),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButton(
isExpanded: true,
value: _selectedDoctor,
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model
.getDoctorNameList()
.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
AppText(
item,
fontSize:
SizeConfig.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
_selectedDoctor = newValue;
doctorsList =
model.doctorsList;
var doctorInfo = doctorsList
.where((i) => i['DoctorName']
.toString()
.contains(_selectedDoctor))
.toList();
doctorId = doctorInfo[0]['DoctorID']
.toString();
})
},
items: model
.getDoctorNameList()
.map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign: TextAlign.end,
),
);
}).toList(),
),
),
],
),
),
), //-----------------------------///
AppText(
TranslationBase.of(context).ext,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: AppTextFormField(
hintText: TranslationBase.of(context).ext,
controller: _extController,
inputFormatter: ONLY_NUMBERS,
textInputType: TextInputType.number,
onChanged: (value) => {},
),
),
AppText(
TranslationBase.of(context).priority,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
priorityBar(context),
AppText(
TranslationBase.of(context).referralFrequency +
getPriority(),
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
), ),
),
AppText( ),
TranslationBase.of(context).referralFrequency, SizedBox(
fontSize: 18, height: 10,
fontWeight: FontWeight.bold, ),
marginLeft: 15, Container(
marginTop: 15, height: screenSize.height * 0.070,
child: InkWell(
onTap: model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctorSelect,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
), ),
RoundedContainer( ),
margin: 10, ),
showBorder: true, SizedBox(
raduis: 30, height: 10,
borderColor: Color(0xff707070), ),
width: double.infinity, Container(
child: Padding( height: screenSize.height * 0.070,
padding: EdgeInsets.only( child: TextField(
top: SizeConfig.widthMultiplier * 0.9, decoration: textFieldSelectorDecoration(
bottom: SizeConfig.widthMultiplier * 0.9, TranslationBase.of(context).ext, null, false),
right: SizeConfig.widthMultiplier * 3, enabled: true,
left: SizeConfig.widthMultiplier * 3), controller: _extController,
child: Row( inputFormatters: [
mainAxisSize: MainAxisSize.max, FilteringTextInputFormatter.allow(
children: <Widget>[ RegExp(ONLY_NUMBERS))
Expanded( ],
// add Expanded to have your dropdown button fill remaining space keyboardType: TextInputType.number,
child: DropdownButton( )),
isExpanded: true, SizedBox(
value: _selectedReferralFrequancy, height: 10,
iconSize: 40, ),
elevation: 16, priorityBar(context, screenSize),
selectedItemBuilder: SizedBox(
(BuildContext context) { height: 20,
return model ),
.getReferralNamesList() AppText(
.map((item) { "${TranslationBase.of(context).referralFrequency} ${getPriority()}",
return Row( fontWeight: FontWeight.bold,
mainAxisSize: MainAxisSize.max, fontSize: 16,
children: <Widget>[ ),
AppText( SizedBox(
item, height: 20,
fontSize: ),
SizeConfig.textMultiplier * Container(
2.1, height: screenSize.height * 0.070,
), child: InkWell(
], onTap: model.referralFrequencyList != null &&
); model.referralFrequencyList.length > 0
}).toList(); ? () {
}, ListSelectDialog dialog = ListSelectDialog(
onChanged: (newValue) => { list: model.referralFrequencyList,
setState(() { attributeName: 'Description',
_selectedReferralFrequancy = newValue; attributeValueId: 'ParameterCode',
var freqInfo = model okText: TranslationBase.of(context).ok,
.referalFrequancyList okFunction: (selectedValue) {
.singleWhere((i) => i[ setState(() {
'Description'] _selectedFrequency = selectedValue;
.toString() });
.contains( },
_selectedReferralFrequancy)); );
freqId = freqInfo['ParameterCode'] showDialog(
.toString(); barrierDismissible: false,
myFocusNode.requestFocus(); context: context,
}) builder: (BuildContext context) {
}, return dialog;
items: model },
.getReferralNamesList() );
.map((item) { }
return DropdownMenuItem( : null,
value: item.toString(), child: TextField(
child: Text( decoration: textFieldSelectorDecoration(
item, TranslationBase.of(context)
textAlign: TextAlign.end, .selectReferralFrequency,
), _selectedFrequency != null
); ? _selectedFrequency['Description']
}).toList(), : null,
), true),
), enabled: false,
],
),
),
), ),
AppText( ),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinicDetailsandRemarks, TranslationBase.of(context).clinicDetailsandRemarks,
fontSize: 18, null,
fontWeight: FontWeight.bold, false),
marginLeft: 15, enabled: true,
marginTop: 15, controller: _remarksController,
), inputFormatters: [
Padding( FilteringTextInputFormatter.allow(
padding: const EdgeInsets.all(10.0), RegExp(ONLY_LETTERS))
child: AppTextFormField( ],
hintText: TranslationBase.of(context).remarks, keyboardType: TextInputType.text,
focusNode: myFocusNode, minLines: 4,
controller: _remarksController, maxLines: 6,
inputFormatter: ONLY_LETTERS, )),
textInputType: TextInputType.text, SizedBox(
onChanged: (value) => {}, height: 10,
),
Container(
child: Column(
children: <Widget>[
AppText(
TranslationBase.of(context).pleaseFill,
color: HexColor("#B8382B"),
fontWeight: FontWeight.bold,
margin: 10,
visibility: isValid == null ? false : !isValid,
), ),
), // TODO replace AppButton with secondary button and add loading
Padding( AppButton(
padding: const EdgeInsets.all(20.0), title: TranslationBase.of(context).send,
child: Column( color: HexColor("#B8382B"),
children: <Widget>[ onPressed: () => {referToDoctor(context, model)},
AppText( )
TranslationBase.of(context).pleaseFill, ],
color: Colors.red, ),
fontWeight: FontWeight.bold, ),
margin: 10, ],
visibility: ),
isValid == null ? false : !isValid, ),
),
// TODO replace AppButton with secondary button and add loading
AppButton(
title: TranslationBase
.of(context)
.send,
color: Color(PRIMARY_COLOR),
onPressed: () =>
{
referToDoctor(context, model)
},
)
],
))
],
), ),
), ),
),); );
} }
Widget priorityBar(BuildContext _context) { Widget priorityBar(BuildContext _context, Size screenSize) {
List<String> _priorities = [ List<String> _priorities = [
TranslationBase.of(context).veryUrgent, TranslationBase.of(context).veryUrgent.toUpperCase(),
TranslationBase.of(context).urgent, TranslationBase.of(context).urgent.toUpperCase(),
TranslationBase.of(context).routine, TranslationBase.of(context).routine.toUpperCase(),
]; ];
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.065, height: screenSize.height * 0.070,
width: SizeConfig.screenWidth * 0.9, decoration:
margin: EdgeInsets.only(top: 10), containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
decoration: BoxDecoration(
color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) { children: _priorities.map((item) {
bool _isActive = _priorities[_activePriority] == item ? true : false; bool _isActive = _priorities[_activePriority] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[ return Expanded(
InkWell( child: InkWell(
child: Center( child: Center(
child: Container( child: Container(
height: 40, height: screenSize.height * 0.070,
width: 90, decoration: containerBorderDecoration(
decoration: BoxDecoration( _isActive ? HexColor("#B8382B") : Colors.white,
borderRadius: BorderRadius.circular(50), _isActive ? HexColor("#B8382B") : Colors.white),
color: _isActive ? HexColor("#B8382B") : Colors.white, child: Center(
), child: Text(
child: Center( item,
child: Text( style: TextStyle(
item, fontSize: 12,
style: TextStyle( color: _isActive
fontSize: 12, ? Colors.white
color: _isActive : Colors.black, //Colors.black,
? Colors.white fontWeight: FontWeight.bold,
: Colors.black, //Colors.black,
// backgroundColor:_isActive
// ? Hexcolor("#B8382B")
// : Colors.white,//sideColor,
fontWeight: FontWeight.bold,
),
), ),
)), ),
), )),
onTap: () { ),
print(_priorities.indexOf(item)); onTap: () {
setState(() { print(_priorities.indexOf(item));
_activePriority = _priorities.indexOf(item); setState(() {
}); _activePriority = _priorities.indexOf(item);
}), });
_isActive },
? Container( ),
decoration: BoxDecoration( );
borderRadius: BorderRadius.circular(10),
color: Colors.white),
alignment: Alignment.center,
height: 3,
width: 90,
)
: Container()
]);
}).toList(), }).toList(),
), ),
); );
@ -484,10 +334,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
return; return;
} }
final routeArgs = ModalRoute final routeArgs = ModalRoute.of(context).settings.arguments as Map;
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
try { try {
@ -495,17 +342,16 @@ class _ReferPatientState extends State<ReferPatientScreen> {
extension: _extController.value.text, extension: _extController.value.text,
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo),
referringDoctorRemarks: _remarksController.value.text, referringDoctorRemarks: _remarksController.value.text,
frequency: freqId, frequency: _selectedFrequency['ParameterCode'].toString(),
patientID: patient.patientId, patientID: patient.patientId,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
priority: (_activePriority + 1).toString(), priority: (_activePriority + 1).toString(),
roomID: patient.roomId, roomID: patient.roomId,
selectedClinicID: clinicId.toString(), selectedClinicID: _selectedClinic['ClinicID'].toString(),
selectedDoctorID: doctorId.toString(), selectedDoctorID: _selectedDoctor['DoctorID'].toString(),
projectID: patient.projectId); projectID: patient.projectId);
// TODO: Add Translation // TODO: Add Translation
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast('Reply Successfully');
'Reply Successfully');
Navigator.pop(context); Navigator.pop(context);
} catch (e) { } catch (e) {
DrAppToastMsg.showErrorToast(e); DrAppToastMsg.showErrorToast(e);
@ -516,10 +362,47 @@ class _ReferPatientState extends State<ReferPatientScreen> {
setState(() { setState(() {
isValid = !_extController.value.text.isNullOrEmpty() && isValid = !_extController.value.text.isNullOrEmpty() &&
!_remarksController.value.text.isNullOrEmpty() && !_remarksController.value.text.isNullOrEmpty() &&
freqId != null && _selectedClinic != null &&
clinicId != null && _selectedDoctor != null &&
doctorId != null; _selectedFrequency != null;
}); });
return isValid; return isValid;
} }
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
} }

@ -0,0 +1,151 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MyReferralDetailScreen extends StatelessWidget {
PendingReferral pendingReferral;
@override
Widget build(BuildContext context) {
final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8;
AuthViewModel authProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
pendingReferral = routeArgs['referral'];
return BaseView<PatientReferralViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ProfileWelcomeWidget(
AppText(
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
height: 100,
),
SizedBox(
height: 16,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText(
TranslationBase.of(context).myReferralPatient,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
PatientReferralItemWidget(
patientName: pendingReferral.patientName,
referralStatus: null,
isReferredTo: false,
isSameBranch: pendingReferral.isReferralDoctorSameBranch,
referralDoctorName: pendingReferral.referredByDoctorInfo,
clinicDescription: null,
remark: pendingReferral.remarksFromSource,
),
SizedBox(
child: GridView.count(
childAspectRatio: 1.8,
crossAxisSpacing: 8,
mainAxisSpacing: 10,
controller: new ScrollController(keepScrollOffset: false),
shrinkWrap: true,
padding: const EdgeInsets.all(4.0),
crossAxisCount: 2,
children: [
PatientProfileButton(
key: key,
// patient: patient,
// route: RADIOLOGY,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'),
PatientProfileButton(
key: key,
// patient: patient,
// route: LAB_ORDERS,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'lab.png'),
PatientProfileButton(
key: key,
// patient: patient,
// route: VITAL_SIGN_DETAILS,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
icon: 'heartbeat.png'),
],
),
),
],
),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
children: [
Expanded(
child: BorderedButton(
TranslationBase.of(context).accept,
backgroundColor: Color(0xFF4BA821),
textColor: Colors.white,
fontSize: 16,
hPadding: 8,
vPadding: 12,
handler: (){
model.responseReferral(pendingReferral, true);
},
),
),
SizedBox(
height: 8,
),
Expanded(
child: BorderedButton(
TranslationBase.of(context).reject,
backgroundColor: Color(0xFFB9382C),
textColor: Colors.white,
fontSize: 16,
hPadding: 8,
vPadding: 12,
handler: (){
model.responseReferral(pendingReferral, false);
},
),
),
],
),
),
],
),
),
);
}
}

@ -0,0 +1,98 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class MyReferralPatientScreen extends StatelessWidget {
// previous design page is: MyReferralPatient
@override
Widget build(BuildContext context) {
AuthViewModel authProvider = Provider.of(context);
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getPendingReferralPatients(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: model.pendingReferral == null ||
model.pendingReferral.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ProfileWelcomeWidget(
AppText(
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
height: 100,
),
SizedBox(
height: 16,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText(
TranslationBase.of(context).myReferralPatient,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
...List.generate(
model.pendingReferral.length,
(index) => PatientReferralItemWidget(
patientName: model.pendingReferral[index].patientName,
referralStatus: null,
isReferredTo: false,
isSameBranch: model.pendingReferral[index]
.isReferralDoctorSameBranch,
referralDoctorName:
model.pendingReferral[index].referredByDoctorInfo,
clinicDescription: null,
remark:
model.pendingReferral[index].remarksFromSource,
infoIcon: InkWell(
onTap: () {
Navigator.of(context).pushNamed(
MY_REFERRAL_DETAIL,
arguments: {
'referral': model.pendingReferral[index]
});
},
child: Icon(
Icons.info_outline,
color: Colors.black,
size: 30,
),
),
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,460 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../QR_reader_screen.dart';
class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: MyReferralPatient
@override
_PatientMakeReferralScreenState createState() =>
_PatientMakeReferralScreenState();
}
class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
PatiantInformtion patient;
List<dynamic> referToList;
dynamic _referTo;
dynamic _selectedBranch;
dynamic _selectedClinic;
dynamic _selectedDoctor;
DateTime appointmentDate;
final _remarksController = TextEditingController();
PatientArrivalEntity _selectedPatientArrivalEntity;
@override
void initState() {
super.initState();
referToList = List();
dynamic sameBranch = {"id": 1, "name": "Same Branch"};
dynamic otherBranch = {"id": 2, "name": "Other Branch"};
referToList.add(sameBranch);
referToList.add(otherBranch);
appointmentDate = DateTime.now();
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getBranches(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: SingleChildScrollView(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
PatientPageHeaderWidget(patient),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).referPatient,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: referToList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model
.getDoctorBranch()
.then((value) {
_selectedBranch = value;
if (_referTo['id'] == 1) {
model.getClinics(
_selectedBranch['ID']);
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.branchesList,
attributeName: 'Desciption',
attributeValueId: 'ID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
model.getClinics(
_selectedBranch['ID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).branch,
_selectedBranch != null
? _selectedBranch['Desciption']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getClinicDoctors(
_selectedClinic['ClinicID']
.toString());
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinic,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.chooseAppointment,
_selectedPatientArrivalEntity != null
? "${TranslationBase.of(context).appointmentNo} ${_selectedPatientArrivalEntity.appointmentNo}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).remarks,
null,
false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
],
),
),
],
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).refer,
color: HexColor("#B8382B"),
onPressed: () {
if (_selectedPatientArrivalEntity == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null) return;
model
.makeReferral(
_selectedPatientArrivalEntity,
appointmentDate.toIso8601String(),
_selectedBranch['ID'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text)
.then((_) => Navigator.pop(context));
},
),
)
],
),
),
),
),
);
}
_selectDate(BuildContext context, PatientReferralViewModel model) async {
// https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference
// https://stackoverflow.com/a/63147062/6246772 to customize a date picker
final DateTime picked = await showDatePicker(
context: context,
initialDate: appointmentDate,
firstDate: DateTime.now().add(Duration(hours: 2)),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != appointmentDate) {
appointmentDate = picked;
model
.getPatientArrivalList(DateUtils.convertStringToDateFormat(
appointmentDate.toString(), "yyyy-MM-dd"))
.then((_) {
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
return;
}
if (model.patientArrivalList != null &&
model.patientArrivalList.length > 0) {
List<dynamic> appointments = model.getAppointmentsByPatientName(
"${patient.firstName} ${patient.middleName} ${patient.lastName}");
if (appointments.length > 0) {
ListSelectDialog dialog = ListSelectDialog(
list: appointments,
attributeName: 'appointmentNo',
attributeValueId: 'appointmentNo',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedPatientArrivalEntity =
PatientArrivalEntity.fromJson(selectedValue);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} else {
setState(() {
_selectedPatientArrivalEntity = null;
});
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).noAppointmentsErrorMsg);
}
} else {
setState(() {
_selectedPatientArrivalEntity = null;
});
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).noAppointmentsErrorMsg);
}
});
}
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
}

@ -0,0 +1,74 @@
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class ReferredPatientScreen extends StatelessWidget {
// previous design page is: MyReferredPatient
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getMyReferredPatient(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: model.listMyReferredPatientModel == null ||
model.listMyReferredPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: SingleChildScrollView(
child: Container(
child: Column(
children: [
Container(
height: 75,
child: AppText(
"This is where upper view for avatar.. etc placed",
fontWeight: FontWeight.normal,
fontSize: 16,
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
...List.generate(
model.listMyReferredPatientModel.length,
(index) => PatientReferralItemWidget(
patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
referralStatus:
"${model.getReferredPatientItem(index).referralStatus}",
isReferredTo: true,
isSameBranch: model
.getReferredPatientItem(index)
.isReferralDoctorSameBranch,
referralDoctorName: model
.getReferredPatientItem(index)
.referralDoctorName,
clinicDescription: model
.getReferredPatientItem(index)
.referralClinicDescription,
remark: model
.getReferredPatientItem(index)
.referringDoctorRemarks,
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,989 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/lookups/patient_lookup.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/material.dart';
class PatientVitalSignScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientArrivalList(
DateUtils.convertDateToFormat(DateTime.now(), "yyyy-MM-dd"), patient,
fromDate: DateUtils.convertDateToFormat(
DateTime.now().subtract(Duration(days: 500)), "yyyy-MM-dd")),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).vitalSign,
body: model.patientVitalSigns != null
? SingleChildScrollView(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
PatientPageHeaderWidget(patient),
SizedBox(
height: 16,
),
Container(
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).weight} :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.weightKg} ${TranslationBase.of(context).kg}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).idealBodyWeight} :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.idealBodyWeightLbs} ${TranslationBase.of(context).kg}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).height} :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.heightCm} ${TranslationBase.of(context).cm}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).waistSize} :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.waistSizeInch} ${TranslationBase.of(context).inch}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).headCircum} :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.headCircumCm} ${TranslationBase.of(context).cm}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 16,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).leanBodyWeight} :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.leanBodyWeightLbs} ${TranslationBase.of(context).kg}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).bodyMassIndex} :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"${model.patientVitalSigns.bodyMassIndex}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"G.C.S :",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 8,
),
AppText(
"N/A",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
TemperatureWidget(model.patientVitalSigns),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
PulseWidget(model.patientVitalSigns),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
RespirationWidget(model.patientVitalSigns),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
BloodPressureWidget(model.patientVitalSigns),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
OxygenationWidget(model.patientVitalSigns),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
PainScaleWidget(model.patientVitalSigns),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
],
),
)
],
),
),
)
: Container(),
),
);
}
}
class TemperatureWidget extends StatefulWidget {
final VitalSignData vitalSign;
TemperatureWidget(this.vitalSign);
@override
_TemperatureWidgetState createState() => _TemperatureWidgetState();
}
class _TemperatureWidgetState extends State<TemperatureWidget> {
bool isExpand = false;
@override
Widget build(BuildContext context) {
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${TranslationBase.of(context).temperature}",
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black,
fontWeight: isExpand ? FontWeight.bold : FontWeight.normal,
),
InkWell(
onTap: () {
setState(() {
isExpand = !isExpand;
});
},
child: Icon(isExpand ? Icons.remove : Icons.add),
),
],
),
),
bodyWidget: Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).temperature} (C):",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.temperatureCelcius}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).temperature} (F):",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).method} :",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.temperatureCelciusMethod}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
],
),
),
isExpand: isExpand,
),
);
}
}
class PulseWidget extends StatefulWidget {
final VitalSignData vitalSign;
PulseWidget(this.vitalSign);
@override
_PulseWidgetState createState() => _PulseWidgetState();
}
class _PulseWidgetState extends State<PulseWidget> {
bool isExpand = false;
@override
Widget build(BuildContext context) {
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${TranslationBase.of(context).pulse}",
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black,
fontWeight: isExpand ? FontWeight.bold : FontWeight.normal,
),
InkWell(
onTap: () {
setState(() {
isExpand = !isExpand;
});
},
child: Icon(isExpand ? Icons.remove : Icons.add),
),
],
),
),
bodyWidget: Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).pulseBeats}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.pulseBeatPerMinute}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).rhythm}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.pulseRhythm}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
],
),
),
isExpand: isExpand,
),
);
}
}
class RespirationWidget extends StatefulWidget {
final VitalSignData vitalSign;
RespirationWidget(this.vitalSign);
@override
_RespirationWidgetState createState() => _RespirationWidgetState();
}
class _RespirationWidgetState extends State<RespirationWidget> {
bool isExpand = false;
@override
Widget build(BuildContext context) {
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${TranslationBase.of(context).respiration}",
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black,
fontWeight: isExpand ? FontWeight.bold : FontWeight.normal,
),
InkWell(
onTap: () {
setState(() {
isExpand = !isExpand;
});
},
child: Icon(isExpand ? Icons.remove : Icons.add),
),
],
),
),
bodyWidget: Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).respBeats}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.respirationBeatPerMinute}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).patternOfRespiration}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.respirationPattern}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
],
),
),
isExpand: isExpand,
),
);
}
}
class BloodPressureWidget extends StatefulWidget {
final VitalSignData vitalSign;
BloodPressureWidget(this.vitalSign);
@override
_BloodPressureWidgetState createState() => _BloodPressureWidgetState();
}
class _BloodPressureWidgetState extends State<BloodPressureWidget> {
bool isExpand = false;
@override
Widget build(BuildContext context) {
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${TranslationBase.of(context).bloodPressure}",
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black,
fontWeight: isExpand ? FontWeight.bold : FontWeight.normal,
),
InkWell(
onTap: () {
setState(() {
isExpand = !isExpand;
});
},
child: Icon(isExpand ? Icons.remove : Icons.add),
),
],
),
),
bodyWidget: Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).bloodPressureDiastoleAndSystole}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).cuffLocation}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.bloodPressureCuffLocation}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).patientPosition}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.bloodPressurePatientPosition}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).cuffSize}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.bloodPressureCuffSize}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
],
),
),
isExpand: isExpand,
),
);
}
}
class OxygenationWidget extends StatefulWidget {
final VitalSignData vitalSign;
OxygenationWidget(this.vitalSign);
@override
_OxygenationWidgetState createState() => _OxygenationWidgetState();
}
class _OxygenationWidgetState extends State<OxygenationWidget> {
bool isExpand = false;
@override
Widget build(BuildContext context) {
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${TranslationBase.of(context).oxygenation}",
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black,
fontWeight: isExpand ? FontWeight.bold : FontWeight.normal,
),
InkWell(
onTap: () {
setState(() {
isExpand = !isExpand;
});
},
child: Icon(isExpand ? Icons.remove : Icons.add),
),
],
),
),
bodyWidget: Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).sao2}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.sao2}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).fio2}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.fio2}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
],
),
),
isExpand: isExpand,
),
);
}
}
class PainScaleWidget extends StatefulWidget {
final VitalSignData vitalSign;
PainScaleWidget(this.vitalSign);
@override
_PainScaleWidgetState createState() => _PainScaleWidgetState();
}
class _PainScaleWidgetState extends State<PainScaleWidget> {
bool isExpand = false;
@override
Widget build(BuildContext context) {
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${TranslationBase.of(context).painScale}",
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black,
fontWeight: isExpand ? FontWeight.bold : FontWeight.normal,
),
InkWell(
onTap: () {
setState(() {
isExpand = !isExpand;
});
},
child: Icon(isExpand ? Icons.remove : Icons.add),
),
],
),
),
bodyWidget: Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).painScale}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.painScore}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).painManagement}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"${widget.vitalSign.isPainManagementDone}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
],
),
),
isExpand: isExpand,
),
);
}
}

@ -0,0 +1,212 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
void addPrescriptionForm(context) {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final double spaceBetweenTextFileds = 12;
showModalBottomSheet(
isScrollControlled: true,
context: context,
builder: (BuildContext bc) {
return SingleChildScrollView(
child: Container(
height: 700,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
AppText(
TranslationBase.of(context).medicines.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: spaceBetweenTextFileds,
),
Container(
child: Form(
key: _formKey,
child: Column(
//mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText:
TranslationBase.of(context).searchMedicine,
borderColor: Colors.white,
textInputType: TextInputType.text,
inputFormatter: ONLY_LETTERS,
),
),
SizedBox(
height: spaceBetweenTextFileds,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).orderType,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).strength,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).route,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).frequency,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).doseTime,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).indication,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).fromDate,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: TranslationBase.of(context).duration,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText:
TranslationBase.of(context).instruction,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
margin:
EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title:
TranslationBase.of(context).addMedication,
onPressed: () {
Navigator.pop(context);
prescriptionWarning(context);
},
),
],
),
),
],
),
),
),
],
),
),
),
);
});
}

@ -0,0 +1,406 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class NewPrescriptionScreen extends StatefulWidget {
@override
_NewPrescriptionScreenState createState() => _NewPrescriptionScreenState();
}
class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
int testNum = 0;
PatiantInformtion patient;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescription(),
builder: (BuildContext context, PrescriptionViewModel model,
Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescription,
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
if (model.prescriptionList.length > 0)
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
patient.patientId.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
if (model.prescriptionList.length != 0)
SizedBox(
height: model.prescriptionList[0].rowcount == 0
? 200.0
: 10.0),
//model.prescriptionList == null
if (model.prescriptionList.length != 0)
model.prescriptionList[0].rowcount == 0
? Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
addPrescriptionForm(context);
model.postPrescription();
},
child: CircleAvatar(
radius: 65,
backgroundColor: Color(0XFFB8382C),
child: CircleAvatar(
radius: 60,
backgroundColor: Colors.white,
child: Icon(
Icons.add,
color: Colors.black,
size: 45.0,
),
),
),
),
SizedBox(
height: 15.0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context)
.noPrescriptionListed,
color: Colors.black,
fontWeight: FontWeight.w900,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).addNow,
color: Color(0XFFB8382C),
fontWeight: FontWeight.w900,
),
],
),
],
)
: Padding(
padding: EdgeInsets.all(12.0),
child: NetworkBaseView(
baseViewModel: model,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
InkWell(
child: Container(
height: 50.0,
width: 450.0,
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey),
borderRadius:
BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
' Add more medication',
fontWeight: FontWeight.w100,
fontSize: 12.5,
),
Icon(
Icons.add,
color: Color(0XFFB8382C),
)
],
),
),
),
onTap: () {
addPrescriptionForm(context);
model.postPrescription();
},
),
SizedBox(
height: 15.0,
),
...List.generate(
model.prescriptionList[0].rowcount,
(index) => Container(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Container(
height:
MediaQuery.of(context)
.size
.height *
0.2,
width:
MediaQuery.of(context)
.size
.width *
0.09,
child: Column(
children: [
AppText(
'8\nDEC',
color: Colors.green,
)
],
),
),
Container(
height:
MediaQuery.of(context)
.size
.height *
0.24,
width:
MediaQuery.of(context)
.size
.width *
0.81,
child: Column(
children: [
Row(
children: [
AppText(
'Start Date:',
fontWeight:
FontWeight
.w900,
fontSize: 15.0,
),
AppText(
model
.prescriptionList[
0]
.entityList[
index]
.startDate,
fontSize: 11.0,
),
SizedBox(
width: 6.0,
),
AppText(
'Order Type:',
fontWeight:
FontWeight
.w900,
fontSize: 15.0,
),
AppText(
model
.prescriptionList[
0]
.entityList[
index]
.orderTypeDescription,
fontSize: 13.0,
),
],
),
SizedBox(
height: 2.5,
),
Row(
children: [
Container(
child: Expanded(
child:
AppText(
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
),
),
)
],
),
Row(
children: [
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.doseDetail,
fontSize:
13.0,
),
)
],
),
SizedBox(
height: 3.0,
),
Row(
children: [
AppText(
'Indication: ',
fontWeight:
FontWeight
.w900,
),
Expanded(
child: AppText(
model
.prescriptionList[
0]
.entityList[
index]
.indication,
fontSize:
12.9),
)
],
),
SizedBox(
height: 15.0,
),
Row(
children: [
AppText(
model
.prescriptionList[
0]
.entityList[
index]
.doctorName,
fontWeight:
FontWeight
.w900,
)
],
),
Row(
children: [
AppText(model
.prescriptionList[
0]
.entityList[
index]
.remarks),
],
),
SizedBox(
height: 15.0,
),
Divider(
height: 0,
thickness: 1.0,
color: Colors.grey,
),
// SizedBox(
// height: 40,
// ),
],
),
),
],
),
],
),
),
),
],
),
),
)
],
),
),
),
)),
);
}
}

@ -0,0 +1,168 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
void prescriptionWarning(context) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Container(
height: 600,
child: Column(
children: [
...List.generate(
5,
(index) => Container(
child: ExpansionTile(
title: AppText('Prescription warning and alerts(0)'),
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
'DOSESCREENINGRESULTFORETCETC',
color: Color(0XFFB8382C),
)
],
)
],
),
),
),
SizedBox(
height: 10.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border:
Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Remarks',
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(
height: 95.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'CONTINUE',
onPressed: () {
Navigator.pop(context);
authorizationForm(context);
},
),
],
),
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
color: Colors.white,
title: 'remove',
fontColor: Colors.red,
onPressed: () {
Navigator.pop(context);
prescriptionWarning(context);
},
),
],
),
),
],
),
),
));
});
}
void authorizationForm(context) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return Container(
height: 500,
child: Form(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'Prescription authorization'.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: 30.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Auth ID',
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Password',
borderColor: Colors.white,
textInputType: TextInputType.text,
inputFormatter: ONLY_LETTERS,
obscureText: true,
),
),
SizedBox(
height: 190.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'CONTINUE',
onPressed: () {
Navigator.pop(context);
authorizationForm(context);
},
),
],
),
),
],
),
),
));
});
}

@ -0,0 +1,482 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class ProcedureScreen extends StatefulWidget {
@override
_ProcedureScreenState createState() => _ProcedureScreenState();
}
class _ProcedureScreenState extends State<ProcedureScreen> {
int testNum = 1;
PatiantInformtion patient;
TextEditingController procedureController = TextEditingController();
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: 'ORDER PROCEDURE',
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(12.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
patient.patientId.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
if (model.procedureList.length != 0)
SizedBox(
height: model.procedureList[0].rowcount == 0
? 200.0
: 10.0),
//model.prescriptionList == null
if (model.procedureList.length != 0)
model.procedureList[0].rowcount == 0
? Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
addSelectedProcedure(context);
//model.postPrescription();
},
child: CircleAvatar(
radius: 65,
backgroundColor: Color(0XFFB8382C),
child: CircleAvatar(
radius: 60,
backgroundColor: Colors.white,
child: Icon(
Icons.add,
color: Colors.black,
size: 45.0,
),
),
),
),
SizedBox(
height: 15.0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
'NO ORDER FOR PROCEDURE LISTED',
color: Colors.black,
fontWeight: FontWeight.w900,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).addNow,
color: Color(0XFFB8382C),
fontWeight: FontWeight.w900,
),
],
),
],
)
: Padding(
padding: EdgeInsets.all(16.0),
child: NetworkBaseView(
baseViewModel: model,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
InkWell(
child: Container(
height: 50.0,
width: 450.0,
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey),
borderRadius:
BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
' Add more procedure',
fontWeight: FontWeight.w100,
fontSize: 12.5,
),
Icon(
Icons.add,
color: Color(0XFFB8382C),
)
],
),
),
),
onTap: () {
addSelectedProcedure(context);
},
),
// Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(6.0)),
// border: Border.all(
// width: 1.0,
// color: HexColor("#CCCCCC"))),
// child: AppTextFormField(
// labelText: 'Add more procedure',
// borderColor: Colors.white,
// //suffixIcon: Icons.search,
//
// //textInputType: TextInputType.number,
// inputFormatter: ONLY_NUMBERS,
// onTap: () {
// addSelectedProcedure(context);
// },
// ),
// ),
SizedBox(
height: 35.0,
),
...List.generate(
model.procedureList[0].rowcount,
(index) => Container(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Container(
height: 120.0,
width: 45.0,
child: Column(
children: [
AppText(
'8\nDEC',
color: Colors.green,
)
],
),
),
Container(
height: 120,
width: 325.0,
child: Column(
children: [
Row(
children: [
AppText(
'Code #: ',
fontWeight:
FontWeight
.w900,
fontSize: 15.0,
),
AppText(
model
.procedureList[
0]
.entityList[
index]
.procedureId
.toString(),
fontSize: 13.0,
),
SizedBox(
width: 12.0,
),
AppText(
'Order Type: ',
fontWeight:
FontWeight
.w900,
fontSize: 15.0,
),
AppText(
'Urgent',
fontSize: 13.0,
color:
Colors.red,
),
],
),
Row(
children: [
Container(
child: Expanded(
child:
AppText(
model
.procedureList[
0]
.entityList[
index]
.procedureName,
fontWeight:
FontWeight
.w800,
),
),
)
],
),
Row(
children: [
AppText(
'Price: ',
fontWeight:
FontWeight
.w900,
),
Expanded(
child: AppText(
model
.procedureList[
0]
.entityList[
index]
.price
.toString(),
fontSize:
13.0),
)
],
),
SizedBox(
height: 10.0,
),
Row(
children: [
AppText(
'Some short remark about the procedure',
fontSize: 13.5,
),
],
),
SizedBox(
height: 10.0,
),
Divider(
height: 5.0,
thickness: 1.0,
color: Colors.grey,
)
// SizedBox(
// height: 40,
// ),
],
),
),
Container(
width: 30,
height: 120,
child: Column(
children: [
Icon(Icons.edit)
],
),
)
],
),
],
),
),
),
],
),
),
)
],
),
),
),
)),
);
}
}
postProcedure({ProcedureViewModel model}) async {
model = new ProcedureViewModel();
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List();
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = 2016054575;
postProcedureReqModel.episodeID = 200012166;
postProcedureReqModel.patientMRN = 3120725;
postProcedureReqModel.vidaAuthTokenID =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI';
controls.add(
Controls(code: 'Remarks', controlValue: 'Testing'),
);
controlsProcedure.add(
Procedures(category: "02", procedure: "02011002", controls: controls));
postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel);
DrAppToastMsg.showSuccesToast('Procedure had been added');
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}
}
void addSelectedProcedure(context) {
TextEditingController procedureController = TextEditingController();
showModalBottomSheet(
context: context,
builder: (BuildContext bc) {
return BaseView(
//onModelReady: (model) => model.getCategories(),
builder:
(BuildContext context, ProcedureViewModel model, Widget child) =>
SingleChildScrollView(
child: Container(
height: 490,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'Select Procedure'.toUpperCase(),
fontWeight: FontWeight.w900,
),
// Text(model.categoriesList[0].categoryName),
SizedBox(
height: 9.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Add Delected Procedures'.toUpperCase(),
borderColor: Colors.white,
textInputType: TextInputType.text,
inputFormatter: ONLY_LETTERS,
controller: procedureController,
),
),
SizedBox(
height: 280.0,
),
Container(
margin:
EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title:
TranslationBase.of(context).addMedication,
onPressed: () {
Navigator.pop(context);
postProcedure();
},
),
],
),
),
],
)
],
),
),
),
),
);
});
}

@ -8,7 +8,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class SettingsScreen extends StatelessWidget { class SettingsScreen extends StatelessWidget {
ProjectProvider projectsProvider; ProjectViewModel projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);

@ -0,0 +1,192 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class AddSickLeavScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<SickLeaveViewModel>(
onModelReady: (model) => model.getSickLeave(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).sickleave,
body: model.getAllSIckLeave.length > 0
? SingleChildScrollView(
child: Column(
children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) {
return CardWithBgWidgetNew(
widget: Column(
children: [
Container(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
child: Wrap(
// mainAxisAlignment:
// MainAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.all(3),
child: AppText(
item.status == 1
? TranslationBase.of(
context)
.approved
: item.status == 2
? TranslationBase
.of(context)
.extended
: TranslationBase
.of(context)
.pending,
fontWeight: FontWeight.bold,
color: Colors.white,
),
color: item.status == 1
? Colors.green
: Colors.yellow[800],
),
Row(
children: [
AppText(
TranslationBase.of(
context)
.leaveStartDate +
' ',
fontWeight:
FontWeight.bold,
),
Flexible(
child: Text(
item.startDate,
overflow:
TextOverflow.ellipsis,
))
],
),
AppText(
item.noOfDays.toString() +
' ' +
TranslationBase.of(
context)
.daysSickleave,
fontWeight: FontWeight.bold,
),
Row(children: [
AppText(
item.remarks,
)
]),
],
),
SizedBox(
width: 20,
),
],
),
),
(item.status == 1 || item.status == 2)
? Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.open_in_full,
size: 40,
),
// color: Colors.green, //Colors.black,
onPressed: () => {
openSickLeave(context, true,
extendedData: item)
},
))
: SizedBox(),
],
)),
SizedBox(
height: 20,
),
Divider(
height: 1,
),
],
));
}).toList(),
),
)
: new Builder(builder: (context) {
return Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border: Border.all(
color: HexColor('#B8382C'), width: 4),
borderRadius:
BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
),
Padding(
child: AppText(
TranslationBase.of(context).noSickLeaveApplied,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
)
],
),
));
}),
));
}
openSickLeave(BuildContext context, isExtend,
{GetAllSickLeaveResponse extendedData}) {
showModalBottomSheet(
context: context,
builder: (context) {
return new Container(
child: SickLeaveScreen(
appointmentNo: extendedData.appointmentNo,
patientMRN: extendedData.patientMRN,
isExtended: isExtend,
extendedData: extendedData,
));
});
}
}

@ -0,0 +1,379 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/text_validator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
Helpers helpers = Helpers();
class SickLeaveScreen extends StatefulWidget {
final bool isExtended;
final GetAllSickLeaveResponse extendedData;
final appointmentNo;
final patientMRN;
SickLeaveScreen(
{this.appointmentNo,
this.patientMRN,
this.isExtended = false,
this.extendedData});
@override
_SickLeaveScreenState createState() => _SickLeaveScreenState();
}
class _SickLeaveScreenState extends State<SickLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController();
String _selectedClinic;
Map profile = {};
AddSickLeaveRequest addSickLeave = AddSickLeaveRequest();
void _presentDatePicker(id) {
showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(2019),
lastDate: DateTime.now(),
).then((pickedDate) {
if (pickedDate == null) {
return;
}
setState(() {
// var selectedDate = DateFormat.yMd().format(pickedDate);
final df = new DateFormat('yyyy-MM-dd');
addSickLeave.startDate = df.format(pickedDate);
_toDateController.text = addSickLeave.startDate;
//addSickLeave.startDate = selectedDate;
});
});
}
@override
void initState() {
getProfile();
super.initState();
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => model2.preSickLeaveStatistics(
widget.appointmentNo, widget.patientMRN),
builder: (_, model2, w) => AppScaffold(
baseViewModel: model2,
isShowAppBar: false,
body: Center(
child: Container(
margin: EdgeInsets.only(top: 10),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
Padding(
child: AppText(
widget.isExtended == true
? TranslationBase.of(context)
.extendSickLeave
: TranslationBase.of(context)
.addSickLeave,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10)),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextFormField(
borderColor: Colors.white,
onChanged: (value) {
addSickLeave.noOfDays = value;
},
hintText: widget.extendedData != null
? widget.extendedData.noOfDays
.toString()
: TranslationBase.of(context)
.sickLeaveDays,
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_NUMBERS)
]),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).sickLeaveDate,
// fontSize: 10,
// ),
AppTextFormField(
hintText: widget.extendedData != null
? widget.extendedData.startDate
: TranslationBase.of(context)
.sickLeaveDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons.calendar_today)),
textInputType: TextInputType.number,
controller: _toDateController,
onTap: () {
_presentDatePicker('_selectedToDate');
},
inputFormatter: ONLY_DATE,
onChanged: (value) {
addSickLeave.startDate = value;
}),
],
)),
Container(
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).clinicName,
// fontSize: 10,
// ),
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: new IgnorePointer(
ignoring: true,
child: DropdownButton(
isExpanded: true,
value: getClinicName(
model) ??
"",
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext
context) {
return model
.getClinicNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize
.max,
children: <Widget>[
AppText(
item,
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (newValue) =>
{},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value:
item.toString(),
child: Text(
item,
textAlign:
TextAlign.end,
),
);
}).toList(),
))),
),
],
)
],
),
)),
model2.sickLeaveStatistics[
'recommendedSickLeaveDays'] !=
null
? Padding(
child: AppText(
model2.sickLeaveStatistics[
'recommendedSickLeaveDays'],
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
)
: SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).doctorName,
// fontSize: 10,
// ),
new IgnorePointer(
ignoring: true,
child: AppTextFormField(
readOnly: true,
hintText: profile['DoctorName'],
borderColor: Colors.white,
onSaved: (value) {},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_NUMBERS))
],
),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).remarks,
// fontSize: 10,
// ),
AppTextFormField(
borderColor: Colors.white,
hintText: widget.extendedData != null
? widget.extendedData.remarks
: TranslationBase.of(context).remarks,
onChanged: (value) {
addSickLeave.remarks = value;
},
validator: (value) {
// return TextValidator().validateName(value);
},
inputFormatter: ONLY_LETTERS)
],
),
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: widget.isExtended == true
? TranslationBase.of(context).extend
: TranslationBase.of(context).add,
onPressed: () {
if (widget.isExtended) {
model2
.extendSickLeave(
widget.extendedData)
.then((value) => (value) {
print(value);
});
} else {
model2
.addSickLeave(addSickLeave)
.then((value) => print(value));
}
},
),
],
),
),
// Column(
// children: [
// Texts(TranslationBase.of(context)
// .previousSickLeaveIssue +
// ' ')
// ],
// )
],
),
),
),
),
)));
}
getProfile() async {
Map p = await sharedPref.getObj(DOCTOR_PROFILE);
setState(() {
this.profile = p;
});
}
getClinicName(model) {
var clinicInfo = model.clinicsList
.where((i) => i['ClinicID'] == this.profile['ClinicID'])
.toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
}
}

@ -2,9 +2,13 @@ import 'package:intl/intl.dart';
class DateUtils { class DateUtils {
static String convertDateToFormat(DateTime dateTime, String dateFormat) {
return DateFormat(dateFormat).format(dateTime);
}
static String convertStringToDateFormat(String date, String dateFormat) { static String convertStringToDateFormat(String date, String dateFormat) {
DateTime dateTime = DateTime.parse(date); DateTime dateTime = DateTime.parse(date);
return DateFormat(dateFormat).format(dateTime); return convertDateToFormat(dateTime, dateFormat);
} }
static convertDateFromServerFormat(String str, dateFormat) { static convertDateFromServerFormat(String str, dateFormat) {

@ -41,7 +41,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
timeInSeconds: 1); timeInSeconds: 1);
} }
void showTopShortToast(msg) { static void showTopShortToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,

@ -349,5 +349,7 @@ class Helpers {
await clearSharedPref(); await clearSharedPref();
sharedPref.setString(APP_Language, lang); sharedPref.setString(APP_Language, lang);
Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN);
// TODO Fix it
// Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN)));
} }
} }

@ -33,7 +33,8 @@ class TranslationBase {
String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; String get mobileNo => localizedValues['mobileNo'][locale.languageCode];
String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; String get replySuccessfully =>
localizedValues['replySuccessfully'][locale.languageCode];
String get messagesScreenToolbarTitle => String get messagesScreenToolbarTitle =>
localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; localizedValues['messagesScreenToolbarTitle'][locale.languageCode];
@ -79,7 +80,11 @@ class TranslationBase {
localizedValues['patientServices'][locale.languageCode]; localizedValues['patientServices'][locale.languageCode];
String get searchMedicine => String get searchMedicine =>
localizedValues['searchMedicine'][locale.languageCode]; localizedValues['searchMedicine'][locale.languageCode];
String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; String get myReferralPatient =>
localizedValues['myReferralPatient'][locale.languageCode];
String get referPatient =>
localizedValues['referPatient'][locale.languageCode];
String get myReferral => localizedValues['myReferral'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode];
String get myReferredPatient => String get myReferredPatient =>
localizedValues['myReferredPatient'][locale.languageCode]; localizedValues['myReferredPatient'][locale.languageCode];
@ -106,6 +111,10 @@ class TranslationBase {
String get profile => localizedValues['profile'][locale.languageCode]; String get profile => localizedValues['profile'][locale.languageCode];
String get gender => localizedValues['gender'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode];
String get clinic => localizedValues['clinic'][locale.languageCode]; String get clinic => localizedValues['clinic'][locale.languageCode];
String get clinicSelect =>
localizedValues['clinicSelect'][locale.languageCode];
String get doctorSelect =>
localizedValues['doctorSelect'][locale.languageCode];
String get hospital => localizedValues['hospital'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode];
String get speciality => localizedValues['speciality'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode];
String get errorMessage => String get errorMessage =>
@ -119,8 +128,10 @@ class TranslationBase {
String get lab => localizedValues['lab'][locale.languageCode]; String get lab => localizedValues['lab'][locale.languageCode];
String get result => localizedValues['result'][locale.languageCode]; String get result => localizedValues['result'][locale.languageCode];
String get medicines => localizedValues['medicines'][locale.languageCode]; String get medicines => localizedValues['medicines'][locale.languageCode];
String get prescription => localizedValues['prescription'][locale.languageCode]; String get prescription =>
String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; localizedValues['prescription'][locale.languageCode];
String get insuranceApprovals =>
localizedValues['insuranceApprovals'][locale.languageCode];
String get insurance => localizedValues['insurance'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode];
String get approvals => localizedValues['approvals'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode];
String get bodyMeasurements => String get bodyMeasurements =>
@ -142,7 +153,8 @@ class TranslationBase {
String get pleaseEnterAnswer => String get pleaseEnterAnswer =>
localizedValues['pleaseEnterAnswer'][locale.languageCode]; localizedValues['pleaseEnterAnswer'][locale.languageCode];
String get replay => localizedValues['replay'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode];
String get progressNote => localizedValues['progressNote'][locale.languageCode]; String get progressNote =>
localizedValues['progressNote'][locale.languageCode];
String get progress => localizedValues['progress'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode];
String get note => localizedValues['note'][locale.languageCode]; String get note => localizedValues['note'][locale.languageCode];
String get searchNote => localizedValues['searchNote'][locale.languageCode]; String get searchNote => localizedValues['searchNote'][locale.languageCode];
@ -222,6 +234,8 @@ class TranslationBase {
String get send => localizedValues['send'][locale.languageCode]; String get send => localizedValues['send'][locale.languageCode];
String get referralFrequency => String get referralFrequency =>
localizedValues['referralFrequency'][locale.languageCode]; localizedValues['referralFrequency'][locale.languageCode];
String get selectReferralFrequency =>
localizedValues['selectReferralFrequency'][locale.languageCode];
String get clinicalDetailsAndRemarks => String get clinicalDetailsAndRemarks =>
localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; localizedValues['clinicalDetailsAndRemarks'][locale.languageCode];
String get remarks => localizedValues['remarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode];
@ -252,6 +266,8 @@ class TranslationBase {
String get cancel => localizedValues['cancel'][locale.languageCode]; String get cancel => localizedValues['cancel'][locale.languageCode];
String get ok => localizedValues['ok'][locale.languageCode];
String get done => localizedValues['done'][locale.languageCode]; String get done => localizedValues['done'][locale.languageCode];
String get searchMedicineImageCaption => String get searchMedicineImageCaption =>
@ -286,13 +302,116 @@ class TranslationBase {
localizedValues['moreThan3Letter'][locale.languageCode]; localizedValues['moreThan3Letter'][locale.languageCode];
String get gender2 => localizedValues['gender2'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode];
String get age2 => localizedValues['age2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode];
String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; String get sickleave => localizedValues['sick-leaves'][locale.languageCode];
String get patientSick =>
localizedValues['patient-sick'][locale.languageCode];
String get leave => localizedValues['leave'][locale.languageCode];
String get submit => localizedValues['submit'][locale.languageCode];
String get doctorName => localizedValues['doc-name'][locale.languageCode];
String get clinicName => localizedValues['clinicname'][locale.languageCode];
String get sickLeaveDate =>
localizedValues['sick-leave-date'][locale.languageCode];
String get sickLeaveDays =>
localizedValues['sick-leave-days'][locale.languageCode];
String get admissionDetail =>
localizedValues['admissionDetail'][locale.languageCode];
String get dateTime => localizedValues['dateTime'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode];
String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; String get admissionNo => localizedValues['admissionNo'][locale.languageCode];
String get losNo => localizedValues['losNo'][locale.languageCode]; String get losNo => localizedValues['losNo'][locale.languageCode];
String get area => localizedValues['area'][locale.languageCode]; String get area => localizedValues['area'][locale.languageCode];
String get room => localizedValues['room'][locale.languageCode]; String get room => localizedValues['room'][locale.languageCode];
String get bed => localizedValues['bed'][locale.languageCode]; String get bed => localizedValues['bed'][locale.languageCode];
String get previousSickLeaveIssue =>
localizedValues['prevoius-sickleave-issed'][locale.languageCode];
String get noSickLeaveApplied =>
localizedValues['no-sickleve-applied'][locale.languageCode];
String get applyNow => localizedValues['applynow'][locale.languageCode];
String get addSickLeave =>
localizedValues['add-sickleave'][locale.languageCode];
String get add => localizedValues['add'][locale.languageCode];
String get approved => localizedValues['approved'][locale.languageCode];
String get extended => localizedValues['extended'][locale.languageCode];
String get pending => localizedValues['pending'][locale.languageCode];
String get leaveStartDate =>
localizedValues['leave-start-date'][locale.languageCode];
String get daysSickleave =>
localizedValues['days-sick-leave'][locale.languageCode];
String get extend => localizedValues['extend'][locale.languageCode];
String get extendSickLeave =>
localizedValues['extend-sickleave'][locale.languageCode];
String get targetPatient =>
localizedValues['patient-target'][locale.languageCode];
String get noPrescription =>
localizedValues['no-priscription-listed'][locale.languageCode];
String get next => localizedValues['next'][locale.languageCode];
String get emptyMessage =>
localizedValues['empty-message'][locale.languageCode];
String get healthRecordInformation =>
localizedValues['healthRecordInformation'][locale.languageCode];
String get chiefComplaintLength =>
localizedValues['chiefComplaintLength'][locale.languageCode];
String get referTo => localizedValues['referTo'][locale.languageCode];
String get referredFrom =>
localizedValues['referredFrom'][locale.languageCode];
String get branch => localizedValues['branch'][locale.languageCode];
String get chooseAppointment =>
localizedValues['chooseAppointment'][locale.languageCode];
String get appointmentNo =>
localizedValues['appointmentNo'][locale.languageCode];
String get refer => localizedValues['refer'][locale.languageCode];
String get rejected => localizedValues['rejected'][locale.languageCode];
String get sameBranch => localizedValues['sameBranch'][locale.languageCode];
String get otherBranch => localizedValues['otherBranch'][locale.languageCode];
String get dr => localizedValues['dr'][locale.languageCode];
String get previewHealth =>
localizedValues['previewHealth'][locale.languageCode];
String get summaryReport =>
localizedValues['summaryReport'][locale.languageCode];
String get accept => localizedValues['accept'][locale.languageCode];
String get reject => localizedValues['reject'][locale.languageCode];
String get noAppointmentsErrorMsg =>
localizedValues['noAppointmentsErrorMsg'][locale.languageCode];
String get referralPatient =>
localizedValues['referralPatient'][locale.languageCode];
String get noPrescriptionListed =>
localizedValues['noPrescriptionListed'][locale.languageCode];
String get addNow => localizedValues['addNow'][locale.languageCode];
String get orderType => localizedValues['orderType'][locale.languageCode];
String get strength => localizedValues['strength'][locale.languageCode];
String get doseTime => localizedValues['doseTime'][locale.languageCode];
String get indication => localizedValues['indication'][locale.languageCode];
String get duration => localizedValues['duration'][locale.languageCode];
String get instruction => localizedValues['instruction'][locale.languageCode];
String get addMedication =>
localizedValues['addMedication'][locale.languageCode];
String get route => localizedValues['route'][locale.languageCode];
String get weight => localizedValues['weight'][locale.languageCode];
String get kg => localizedValues['kg'][locale.languageCode];
String get height => localizedValues['height'][locale.languageCode];
String get cm => localizedValues['cm'][locale.languageCode];
String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode];
String get waistSize => localizedValues['waistSize'][locale.languageCode];
String get inch => localizedValues['inch'][locale.languageCode];
String get headCircum => localizedValues['headCircum'][locale.languageCode];
String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode];
String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode];
String get method => localizedValues['method'][locale.languageCode];
String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode];
String get rhythm => localizedValues['rhythm'][locale.languageCode];
String get respBeats => localizedValues['respBeats'][locale.languageCode];
String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode];
String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode];
String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode];
String get cuffSize => localizedValues['cuffSize'][locale.languageCode];
String get patientPosition => localizedValues['patientPosition'][locale.languageCode];
String get fio2 => localizedValues['fio2'][locale.languageCode];
String get sao2 => localizedValues['sao2'][locale.languageCode];
String get painManagement => localizedValues['painManagement'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; import 'package:doctor_app_flutter/lookups/hospital_lookup.dart';
import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
@ -224,10 +225,6 @@ class _LoginFormState extends State<LoginForm> {
login(context, AuthViewModel authProv, Function changeLoadingStata) { login(context, AuthViewModel authProv, Function changeLoadingStata) {
FocusScopeNode currentFocus = FocusScope.of(context); FocusScopeNode currentFocus = FocusScope.of(context);
// if (!currentFocus.hasPrimaryFocus) {
// currentFocus.unfocus();
// }
changeLoadingStata(true); changeLoadingStata(true);
if (loginFormKey.currentState.validate()) { if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save(); loginFormKey.currentState.save();
@ -240,14 +237,11 @@ class _LoginFormState extends State<LoginForm> {
saveObjToString(LOGGED_IN_USER, res); saveObjToString(LOGGED_IN_USER, res);
sharedPref.setString(TOKEN, res['LogInTokenID']); sharedPref.setString(TOKEN, res['LogInTokenID']);
print("token" + res['LogInTokenID']); print("token" + res['LogInTokenID']);
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,)));
Navigator.of(context).pushReplacementNamed(VERIFICATION_METHODS);
} else { } else {
// handel error // handel error
// widget.showCenterShortLoadingToast("watting");
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
// Navigator.of(context).pushNamed(HOME);
}).catchError((err) { }).catchError((err) {
print('$err'); print('$err');
changeLoadingStata(false); changeLoadingStata(false);
@ -279,7 +273,8 @@ class _LoginFormState extends State<LoginForm> {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setSharedPref('platformImei', _platformImei); setSharedPref('platformImei', _platformImei);
saveObjToString(LOGGED_IN_USER, preRes); saveObjToString(LOGGED_IN_USER, preRes);
Navigator.of(context).pushNamed(VERIFICATION_METHODS); Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,)));
// save imei on shared preferance // save imei on shared preferance
} else { } else {
// handel error // handel error

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
@ -362,8 +363,18 @@ class _VerifyAccountState extends State<VerifyAccount> {
"IsLoginForDoctorApp": true, "IsLoginForDoctorApp": true,
"IsSilentLogIN": false "IsSilentLogIN": false
}; };
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel(
zipCode: _loggedUser['ZipCode'],
mobileNumber: _loggedUser['MobileNumber'],
projectID: await sharedPref.getInt(PROJECT_ID),
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
activationCode: activationCode,
generalid: "Cs2020@2016\$2958");
authProv.memberCheckActivationCodeNew(model).then((res) async{ authProv
.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp)
.then((res) async {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']); sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) { if (res['List_DoctorProfile'] != null) {
@ -394,12 +405,19 @@ class _VerifyAccountState extends State<VerifyAccount> {
*/ */
loginProcessCompleted( loginProcessCompleted(
Map<String, dynamic> profile, Function changeLoadingStata) { Map<String, dynamic> profile, Function changeLoadingStata) {
var doctor = DoctorProfileModel.fromJson(profile); var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor); authProv.setDoctorProfile(doctor);
sharedPref.setObj(DOCTOR_PROFILE, profile);
this.getDashboard(doctor, changeLoadingStata);
}
getDashboard(doctor, Function changeLoadingStata) {
// authProv.getDashboard(doctor).then((value) {
// print(value);
changeLoadingStata(false); changeLoadingStata(false);
sharedPref.setObj(DOCTOR_PROFILE, profile); // sharedPref.setObj(DASHBOARD_DATA, value);
Navigator.of(context).pushReplacementNamed(HOME); Navigator.of(context).pushReplacementNamed(HOME);
// });
} }
Future<dynamic> _asyncSimpleDialog( Future<dynamic> _asyncSimpleDialog(

@ -1,6 +1,9 @@
import 'dart:io' show Platform; import 'dart:io' show Platform;
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart';
import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -11,7 +14,6 @@ import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_shared_pref.dart';
import '../../util/helpers.dart'; import '../../util/helpers.dart';
import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers(); Helpers helpers = Helpers();
@ -24,8 +26,11 @@ Helpers helpers = Helpers();
*@desc: Verification Methods widget *@desc: Verification Methods widget
*/ */
class VerificationMethods extends StatefulWidget { class VerificationMethods extends StatefulWidget {
VerificationMethods({this.changeLoadingStata}); VerificationMethods({this.changeLoadingStata, this.password});
final password;
final Function changeLoadingStata; final Function changeLoadingStata;
@override @override
_VerificationMethodsState createState() => _VerificationMethodsState(); _VerificationMethodsState createState() => _VerificationMethodsState();
} }
@ -262,45 +267,63 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: *@return:
*@desc: send Activation Code By Otp Notification Type *@desc: send Activation Code By Otp Notification Type
*/ */
sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) { sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) async {
// TODO : build enum for verfication method // TODO : build enum for verfication method
if (oTPSendType == 1 || oTPSendType == 2) { if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(true); widget.changeLoadingStata(true);
int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID,
generalid: "Cs2020@2016\$2958",
memberID: _loggedUser['List_MemberInformation'][0]['MemberID'],
zipCode: _loggedUser['ZipCode'],
mobileNumber: _loggedUser['MobileNumber'],
password: widget.password);
Map<String, dynamic> model = { Map<String, dynamic> model = {
"LogInTokenID": _loggedUser['LogInTokenID'],
"Channel": 9,
"MobileNumber": _loggedUser['MobileNumber'],
"IPAdress": "11.11.11.11",
"LanguageID": 2,
"ProjectID": 15, //TODO : this should become daynamci
"ZipCode": _loggedUser['ZipCode'],
"UserName": _loggedUser['List_MemberInformation'][0]['MemberID'],
"OTP_SendType": oTPSendType "OTP_SendType": oTPSendType
}; };
authProv.sendActivationCodeByOtpNotificationType(model).then((res) {
widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) { try {
Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, authProv
arguments: {'model': model}); .sendActivationCodeForDoctorApp(activationCodeModel)
} else { .then((res) {
print(res['ErrorEndUserMessage']); widget.changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']);
} if (res['MessageStatus'] == 1) {
}).catchError((err) { print("VerificationCode : "+ res["VerificationCode"]);
print('$err'); sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]);
widget.changeLoadingStata(false); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT,
arguments: {'model': model});
} else {
print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print('$err');
widget.changeLoadingStata(false);
helpers.showErrorToast();
});
} catch (e) {}
helpers.showErrorToast();
});
} else { } else {
// TODO route to this page with parameters to inicate we should present 2 option // TODO route to this page with parameters to inicate we should present 2 option
if (Platform.isAndroid && oTPSendType == 3) { if (Platform.isAndroid && oTPSendType == 3) {
helpers.showErrorToast('Your device not support this feature'); helpers.showErrorToast('Your device not support this feature');
} else { } else {
Navigator.of(context).pushNamed(VERIFICATION_METHODS, Navigator.of(context).push(MaterialPageRoute(
arguments: {'verificationMethod': oTPSendType}); builder: (BuildContext context) =>
VerificationMethodsScreen(password: widget.password,)));
// Navigator.of(context).pushNamed(VERIFICATION_METHODS,
// arguments: {'verificationMethod': oTPSendType});
} }
} }
} }

@ -26,7 +26,7 @@ class DashboardItemTexts extends StatefulWidget {
} }
class _DashboardItemTextsState extends State<DashboardItemTexts> { class _DashboardItemTextsState extends State<DashboardItemTexts> {
ProjectProvider projectsProvider; ProjectViewModel projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,279 +35,276 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CardWithBgWidgetNew( return Container(
widget: Container( width: double.infinity,
child: Column( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 0),
children: <Widget>[ decoration: BoxDecoration(
Row( shape: BoxShape.rectangle,
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(8),
children: <Widget>[ border: Border.fromBorderSide(BorderSide(
AppText( color: Color(0xffCCCCCC),
'${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}', width: 2,
fontSize: 2.5 * SizeConfig.textMultiplier, )),
fontWeight: FontWeight.bold, color: Color(0xffffffff),
), ),
InkWell( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
AppText(
'${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
_showDetails = !_showDetails; _showDetails = !_showDetails;
}); });
}, },
child: Icon(_showDetails child: Image.asset(
? Icons.keyboard_arrow_up "assets/images/ic_circle_arrow.png",
: Icons.keyboard_arrow_down)), width: 25,
], height: 25,
color: Colors.black,
),
),
],
),
), ),
!_showDetails bodyWidget: Column(
? Container() crossAxisAlignment: CrossAxisAlignment.start,
: AnimatedContainer( children: <Widget>[
duration: Duration(milliseconds: 200), Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ SizedBox(
Column( height: 5,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: <Widget>[ Divider(
SizedBox( color: Color(0xFF000000),
height: 5, height: 0.5,
), ),
Divider( Table(
color: Color(0xFF000000), border: TableBorder.symmetric(
height: 0.5, inside: BorderSide(width: 0.5),
), ),
Table( children: [
border: TableBorder.symmetric( TableRow(children: [
inside: BorderSide(width: 0.5), Container(
), margin: EdgeInsets.all(2.5),
children: [ padding: EdgeInsets.all(5),
TableRow(children: [ decoration: BoxDecoration(),
Container( child: Column(
margin: EdgeInsets.all(2.5), crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.all(5), children: <Widget>[
decoration: BoxDecoration(), AppText(
child: Column( TranslationBase.of(context).fileNo,
crossAxisAlignment: fontSize: 1.7 * SizeConfig.textMultiplier,
CrossAxisAlignment.start, fontWeight: FontWeight.bold,
children: <Widget>[
AppText(
TranslationBase.of(context).fileNo,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.patientId}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referralDoctor,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
Texts(
widget.myReferredPatientModel
.referralDoctorName,
maxLength: 80,
readMore: true,
),
],
),
),
]),
TableRow(
children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referringClinic,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.referralClinicDescription}',
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).frequency,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.myReferredPatientModel
.frequencyDescription,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
],
), ),
TableRow(children: [ AppText(
Container( '${widget.myReferredPatientModel.patientId}',
margin: EdgeInsets.all(2.5), fontSize: 1.7 * SizeConfig.textMultiplier,
padding: EdgeInsets.all(5), fontWeight: FontWeight.w300,
child: Column( )
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).priority,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.priorityDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).maxResponseTime,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferredPatientModel
.maxResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
])
], ],
), ),
Divider( ),
color: Color(0xFF000000), Container(
height: 0.5, margin: EdgeInsets.only(
), left: 4, top: 2.5, right: 2.5, bottom: 2.5),
SizedBox( padding: EdgeInsets.all(5),
height: 5, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
AppText( children: <Widget>[
TranslationBase.of(context).clinicDetailsandRemarks, AppText(
fontSize: 1.7 * SizeConfig.textMultiplier, TranslationBase.of(context).referralDoctor,
fontWeight: FontWeight.bold, fontSize: 1.7 * SizeConfig.textMultiplier,
textAlign: TextAlign.start, fontWeight: FontWeight.bold,
), ),
SizedBox( Texts(
height: 5, widget.myReferredPatientModel
), .referralDoctorName,
Texts( maxLength: 80,
'${widget.myReferredPatientModel.referringDoctorRemarks}', readMore: true,
style: "bodyText1", ),
readMore: true, ],
textAlign: TextAlign.start,
maxLength: 100),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(context).answerSuggestions,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
), ),
Texts( ),
'${widget.myReferredPatientModel.referredDoctorRemarks}', ]),
style: "bodyText1", TableRow(
readMore: true, children: [
textAlign: TextAlign.start, Container(
maxLength: 100), margin: EdgeInsets.all(2.5),
SizedBox( padding: EdgeInsets.all(5),
height: 5, child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referringClinic,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.referralClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
SizedBox(height: 10.0),
Container( Container(
width: double.infinity, margin: EdgeInsets.only(
child: Button( left: 4, top: 2.5, right: 2.5, bottom: 2.5),
onTap: () async { padding: EdgeInsets.all(5),
try { child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
await widget.model.verify(widget.myReferredPatientModel); children: <Widget>[
AppText(
DrAppToastMsg.showSuccesToast('Verify Successfully'); TranslationBase.of(context).frequency,
} catch (e) { fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
DrAppToastMsg.showErrorToast(e); ),
} AppText(
}, widget.myReferredPatientModel
title: TranslationBase.of(context).verify, .frequencyDescription,
loading: widget.model.state == ViewState.BusyLocal, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
) )
], ],
) ),
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).priority,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.priorityDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).maxResponseTime,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferredPatientModel.maxResponseTime),
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
])
], ],
), ),
) Divider(
], color: Color(0xFF000000),
), height: 0.5,
),
SizedBox(
height: 5,
),
Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).clinicDetailsandRemarks,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Texts(
'${widget.myReferredPatientModel.referringDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(context).answerSuggestions,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Texts(
'${widget.myReferredPatientModel.referredDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100),
],
),
),
SizedBox(
height: 5,
),
SizedBox(height: 10.0),
Container(
margin: EdgeInsets.all(10),
width: double.infinity,
child: Button(
onTap: () async {
try {
await widget.model
.verify(widget.myReferredPatientModel);
DrAppToastMsg.showSuccesToast(
'Verify Successfully');
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
},
title: TranslationBase.of(context).verify,
loading: widget.model.state == ViewState.BusyLocal,
),
)
],
)
],
),
isExpand: _showDetails,
)
],
), ),
); );
} }

@ -13,58 +13,73 @@ class MyScheduleWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List<WorkingHours> workingHours = Helpers.getWorkingHours(workingHoursTable.workingHours); List<WorkingHours> workingHours = Helpers.getWorkingHours(
workingHoursTable.workingHours,
);
return CardWithBgWidgetNew( return CardWithBgWidgetNew(
widget: Container( widget: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column(
children: [
Divider(
height: 10,
color: Colors.grey,
thickness: 1.0,
),
Text('${workingHoursTable.date.day}')
],
),
Row( Row(
children: <Widget>[ children: <Widget>[
AppText(workingHoursTable.dayName,
fontSize: 2.5 * SizeConfig.textMultiplier),
AppText( AppText(
' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', workingHoursTable.dayName,
fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,), fontSize: 2.5 * SizeConfig.textMultiplier,
),
AppText(
' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}',
fontSize: 2.2 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
),
], ],
), ),
SizedBox(
height: 8,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: workingHours.map((work) { children: workingHours.map((work) {
return Container( return Container(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Divider(color: Colors.grey),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ SizedBox(
AppText('From',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), height: 5,
SizedBox(height: 5,), ),
AppText(work.from,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) AppText(
], work.from + ' - ',
), fontSize: 2.0 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
Container(height: SizeConfig.realScreenWidth * 0.1 ,width: 0.8,color: Colors.grey, Column(
margin: EdgeInsets.only(left: 15,right: 15),), crossAxisAlignment: CrossAxisAlignment.start,
Expanded( children: <Widget>[
child: Column( SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 5,
children: <Widget>[ ),
AppText('To',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), AppText(
SizedBox(height: 5,), work.to,
AppText(work.to,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) fontSize: 2.0 * SizeConfig.textMultiplier,
], fontWeight: FontWeight.w300,
), ),
],
), ),
], ],
) )
], ],
), ),
); );

@ -0,0 +1,143 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class PatientReferralItemWidget extends StatelessWidget {
final String patientName;
final String referralStatus;
final isReferredTo;
final isSameBranch;
final String referralDoctorName;
final String clinicDescription;
final String remark;
final Widget infoIcon;
PatientReferralItemWidget({
this.patientName,
this.referralStatus,
this.isReferredTo = false,
this.isSameBranch,
this.referralDoctorName,
this.clinicDescription,
this.remark,
this.infoIcon,
});
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.all(16.0),
child: Column(
children: [
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Center(
child: AppText(
patientName,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
if (referralStatus != null)
Container(
color: Color(0xFF4BA821),
padding: EdgeInsets.all(4),
child: AppText(
referralStatus == "46"
? TranslationBase.of(context).approved
: TranslationBase.of(context).rejected,
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
isReferredTo
? "${TranslationBase.of(context).referTo}: "
: "${TranslationBase.of(context).referredFrom}: ",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
isSameBranch
? TranslationBase.of(context).sameBranch
: TranslationBase.of(context).otherBranch,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
AppText(
"${TranslationBase.of(context).dr} $referralDoctorName",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
SizedBox(
height: 8,
),
if (clinicDescription != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).clinic}: ",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
clinicDescription,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
AppText(
remark,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
SizedBox(
height: 16,
),
],
),
),
if (infoIcon != null) infoIcon,
],
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 8,
),
],
),
);
}
}

@ -0,0 +1,86 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class PatientProfileButton extends StatelessWidget {
final String nameLine1;
final String nameLine2;
final String icon;
final dynamic route;
final PatiantInformtion patient;
final String url = "assets/images/";
PatientProfileButton(
{Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route})
: super(key: key);
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell(
onTap: () {
navigator(context, this.route);
},
child: Column(children: <Widget>[
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.all(5),
child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
this.nameLine1,
color: Color(0xFFB9382C),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
AppText(
this.nameLine2,
color: Colors.black,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
],
),
),
Expanded(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
child: new Image.asset(url + icon))
],
)),
)
]),
),
decoration: BoxDecoration(
// border: Border.all(),
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.fromLTRB(5, 10, 5, 5),
);
}
void navigator(BuildContext context, route) {
Navigator.of(context).pushNamed(route, arguments: {'patient': patient});
}
}

@ -0,0 +1,120 @@
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../patient_profile_widget.dart';
import 'steps_widget.dart';
class AddSOAPIndex extends StatefulWidget {
final bool isUpdate;
const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key);
@override
_AddSOAPIndexState createState() => _AddSOAPIndexState();
}
class _AddSOAPIndexState extends State<AddSOAPIndex>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList= List();
List<MasterKeyModel> myHistoryList = List();
List<MySelectedExamination> mySelectedExamination = List();
MySelectedAssessment mySelectedAssessment = new MySelectedAssessment();
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
}
@override
void initState() {
// TODO: implement initState
_controller = new PageController();
super.initState();
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
return BaseView<DoctorReplayViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration:
BoxDecoration(boxShadow: <BoxShadow>[], color: Colors.white),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
PatientPageHeaderWidget(patient),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.75,
child: Column(
children: [
Container(
margin: EdgeInsets.only(
left:
MediaQuery.of(context).size.width * 0.05,
right:
MediaQuery.of(context).size.width * 0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,),
ObjectivePage(changePageViewIndex: changePageViewIndex,mySelectedExamination:mySelectedExamination),
AssessmentPage(changePageViewIndex: changePageViewIndex,mySelectedAssessment:mySelectedAssessment),
PlanPage(changePageViewIndex: changePageViewIndex,)
],
),
),
],
),
),
),
)
],
),
),
],
),
),
),
);
}
}

@ -0,0 +1,653 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class AssessmentPage extends StatefulWidget {
final Function changePageViewIndex;
final MySelectedAssessment mySelectedAssessment;
AssessmentPage(
{Key key, this.changePageViewIndex, this.mySelectedAssessment});
@override
_AssessmentPageState createState() => _AssessmentPageState();
}
class _AssessmentPageState extends State<AssessmentPage> {
bool isAssessmentExpand = false;
List<dynamic> assessmentList;
dynamic _referTo;
TextEditingController remarksController = TextEditingController();
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('ASSESSMENT',
variant:
isAssessmentExpand ? "bodyText" : '',
bold: isAssessmentExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 5, right: 5, top: 15),
child: TextFields(
hintText: "Add ASSESSMENT",
fontSize: 13.5,
onTapTextFields: () {
openAssessmentDialog(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
if(widget.mySelectedAssessment != null &&
widget.mySelectedAssessment
.appointmentId !=
null && widget.mySelectedAssessment
.selectedDiagnosisType != null &&
widget.mySelectedAssessment
.selectedDiagnosisCondition != null)
Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment
.spaceBetween,
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment
.start,
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"12".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"DEC".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
],
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Appointment #: ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.mySelectedAssessment
.appointmentId
.toString(),
fontSize: 10,
color: Colors.grey,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Type : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.mySelectedAssessment
.selectedDiagnosisType
.nameEn,
fontSize: 10,
color: Colors.grey,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Doc : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"Anas Abdullah",
fontSize: 10,
color: Colors.grey,
),
],
),
SizedBox(
height: 6,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
AppText(
widget.mySelectedAssessment.remark,
fontSize: 10,
color: Colors.grey,
),
],
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
children: [
AppText(
"ICD: ".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"R07.1".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
],
)
],
),
Column(
children: [
InkWell(
onTap: () {
openAssessmentDialog(context);
},
child: Icon(EvaIcons
.edit2Outline),
)
],
),
],
),
)
],
)
]),
isExpand: isAssessmentExpand,
),
DividerWithSpacesAround(
height: 30,
),
AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitAssessment(model);
},
),
SizedBox(
height: 30,
),
],
),
),
),
)));
}
submitAssessment(SOAPViewModel model) async {
// if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
// widget.mySelectedAssessment.selectedDiagnosisType != null) {
// PostAssessmentRequestModel postAssessmentRequestModel =
// new PostAssessmentRequestModel(
// patientMRN: 3120690,
// episodeId: 200012117,
// appointmentNo: 2016054573,
// icdCodeDetails: [
// new IcdCodeDetails(
// remarks: widget.mySelectedAssessment.remark,
// complexDiagnosis: true,
// conditionId:
// widget.mySelectedAssessment.selectedDiagnosisCondition.id,
// diagnosisTypeId:
// widget.mySelectedAssessment.selectedDiagnosisType.id,
// icdcode10Id: "1")
// ]);
//
// await model.postAssessment(postAssessmentRequestModel);
//
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(3);
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
widget.changePageViewIndex(3);
}
openAssessmentDialog(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddAssessmentDetails(
mySelectedAssessment: widget.mySelectedAssessment,
addSelectedAssessment: () {
setState(() {
Navigator.of(context).pop();
});
});
});
}
}
class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment;
final Function() addSelectedAssessment;
const AddAssessmentDetails(
{Key key, this.mySelectedAssessment, this.addSelectedAssessment})
: super(key: key);
@override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
}
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
// MasterKeyModel _selectedDiagnosisCondition;
// MasterKeyModel _selectedDiagnosisType;
TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController(
text: "234567");
@override
Widget build(BuildContext context) {
remarkController.text = widget.mySelectedAssessment.remark??"";
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
//TODO: make one Input InputDecoration for all
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
return FractionallySizedBox(
heightFactor: 0.75,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.listOfDiagnosisCondition.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisCondition);
}
if (model.listOfDiagnosisType.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisType);
}
if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10);
}
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: SingleChildScrollView(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Add Assessment Details".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hintText: "Appointment Number",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
readOnly: true,
controller: appointmentIdController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfICD10 != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
isICD: true,
list: model.listOfICD10,
selectedValue: widget
.mySelectedAssessment
.selectedICD,
okText: TranslationBase
.of(context)
.ok,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedICD =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Name / ICD",
widget.mySelectedAssessment
.selectedICD !=
null
? widget.mySelectedAssessment
.selectedICD.nameEn
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisCondition !=
null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase
.of(context)
.ok,
okFunction: (
MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Condition",
widget.mySelectedAssessment
.selectedDiagnosisCondition != null
? widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase
.of(context)
.ok,
okFunction: (
MasterKeyModel selectedValue) {
setState(() {
// _selectedDiagnosisType =
// selectedValue;
widget.mySelectedAssessment
.selectedDiagnosisType =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Type",
widget.mySelectedAssessment
.selectedDiagnosisType != null
? widget.mySelectedAssessment
.selectedDiagnosisType.nameEn
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hintText: "Remarks",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 18,
minLines: 5,
controller: remarkController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
AppButton(
title: "Add".toUpperCase(),
onPressed: () {
setState(() {
widget.mySelectedAssessment.remark =
remarkController.text;
widget.mySelectedAssessment
.appointmentId = int.parse(
appointmentIdController.text);
widget.addSelectedAssessment();
});
},
),
])),
),
),
))),
);
}
}

@ -0,0 +1,582 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final List<MySelectedExamination> mySelectedExamination;
ObjectivePage(
{Key key, this.changePageViewIndex, this.mySelectedExamination});
@override
_ObjectivePageState createState() => _ObjectivePageState();
}
class _ObjectivePageState extends State<ObjectivePage> {
bool isSysExaminationExpand = false;
TextEditingController remarksController = TextEditingController();
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('Physical/System Examination',
variant:
isSysExaminationExpand ? "bodyText" : '',
bold: isSysExaminationExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: Icon(isSysExaminationExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Examination",
fontSize: 13.5,
onTapTextFields: () {
openExaminationList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Column(
children:
widget.mySelectedExamination.map((examination) {
return Container(
margin: EdgeInsets.only(
left: 15, right: 15, top: 15),
child: Column(children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
examination
.selectedExamination.nameEn
.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
InkWell(
child: Center(
child: Container(
height:
screenSize.height *
0.070,
decoration:
containerBorderDecoration(
examination
.isNormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors.grey),
child: Center(
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Text(
"Normal",
style: TextStyle(
fontSize: 12,
color:
examination
.isNormal
? Colors.white
: Colors
.black,
//Colors.black,
fontWeight:
FontWeight
.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination.isAbnormal =
!examination.isAbnormal;
examination.isNormal =
!examination.isNormal;
});
}),
SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height:
screenSize.height *
0.070,
decoration:
containerBorderDecoration(
examination
.isAbnormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors.black),
child: Center(
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Text(
"Abnormal",
style: TextStyle(
fontSize: 12,
color:
examination
.isAbnormal
? Colors.white
: Colors
.black,
//Colors.black,
fontWeight:
FontWeight
.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination.isAbnormal =
!examination.isAbnormal;
examination.isNormal =
!examination.isNormal;
});
}),
],
),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeExamination(
examination.selectedExamination),
)
],
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Remarks",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: remarksController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
)
],
)
]),
isExpand: isSysExaminationExpand,
),
DividerWithSpacesAround(height: 30,),
AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitObjectivePage(model);
},
),
SizedBox(
height: 30,
),
],
),
),
),
)));
}
submitObjectivePage(SOAPViewModel model) async {
// if(widget.mySelectedExamination.isNotEmpty){
// PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
// widget.mySelectedExamination.forEach((exam) {
// if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
// null)
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
//
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(
// ListHisProgNotePhysicalExaminationVM(
// patientMRN: 3120690,
// episodeId: 200012117,
// appointmentNo: 2016054573,
// remarks: exam.remark ?? '',
// createdBy: 1485,
// createdOn: DateTime.now().toIso8601String(),
// editedBy: 1485,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination.id,
// examType: exam.selectedExamination.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
// notExamined: false
//
// ));
// });
//
// await model.postPhysicalExam(postPhysicalExamRequestModel);
//
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(2);
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
widget.changePageViewIndex(2);
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0)
setState(() {
widget.mySelectedExamination.remove(history.first);
});
}
openExaminationList(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),);
});
}
}
class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function (MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination})
: super(key: key);
@override
_AddExaminationDailogState createState() => _AddExaminationDailogState();
}
class _AddExaminationDailogState extends State<AddExaminationDailog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(
MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) =>
AppScaffold(
// baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Examinations",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
NetworkBaseView(
baseViewModel: model,
child: Container(
height:
MediaQuery
.of(context)
.size
.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius
.circular(12),
color: Colors.white),
child: ListView(
children: [
Column(
children: model
.physicalExaminationList
.map((examinationInfo) {
return Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(
examinationInfo),
activeColor:
Colors.red[800],
onChanged:
(
bool newValue) {
setState(() {
if (isServiceSelected(
examinationInfo
)) {
widget
.removeExamination(
examinationInfo
);
}
else {
MySelectedExamination mySelectedExamination = new MySelectedExamination(
selectedExamination: examinationInfo
);
widget
.mySelectedExamination
.add(
mySelectedExamination);
}
});
}),
Expanded(
child: Padding(
padding:
const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Texts(
examinationInfo
.nameEn,
variant: "bodyText",
bold: true,
color:
Colors.black),
),
),
],
),
DividerWithSpacesAround(),
],
);
}).toList(),
),
],
),
)),
),
),
SizedBox(
height: 10,
),
if (model.state == ViewState.Idle)
AppButton(
title: "Add SELECTED Examinations"
.toUpperCase(),
onPressed: () {
widget.addSelectedExamination();
},
),
]),
))),
)),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam =
widget
.mySelectedExamination
.where((element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return true;
}
return false;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save