diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 01dc72ef..171125d9 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -25,7 +25,9 @@
NSCameraUsageDescription
Camera permission is required for barcode scanning.
NSFaceIDUsageDescription
- Why is my app authenticating using face id?
+ We are using it for authentication
+
+
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart
index 4a6ee675..92c0735b 100644
--- a/lib/client/base_app_client.dart
+++ b/lib/client/base_app_client.dart
@@ -70,7 +70,7 @@ class BaseAppClient {
body['Channel'] = CHANNEL;
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
- body['PatientOutSA'] = body['PatientOutSA']??0; // PATIENT_OUT_SA;
+ body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA;
if (body['VidaAuthTokenID'] == null) {
body['VidaAuthTokenID'] =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
@@ -98,9 +98,12 @@ class BaseAppClient {
} else {
var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) {
- // onFailure(getError(parsed), statusCode);
- await helpers.logout();
- helpers.showErrorToast('Your session expired Please login agian');
+ if (body['OTP_SendType'] != null) {
+ onFailure(getError(parsed), statusCode);
+ } else {
+ await helpers.logout();
+ helpers.showErrorToast('Your session expired Please login agian');
+ }
} else if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode);
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 6afcb64f..6e7089c3 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -27,7 +27,8 @@ const PATIENT_GET_CLINIC_BY_PROJECT_URL =
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
-const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
+const GET_REFERRAL_FACILITIES =
+ 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
@@ -195,11 +196,16 @@ const DRUG_TO_DRUG =
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
-const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories';
-const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
+const GET_ROOM_CATEGORIES =
+ 'Services/DoctorApplication.svc/REST/GetRoomCategories';
+const GET_DIAGNOSIS_TYPES =
+ 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';
-const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
+const POST_ADMISSION_REQUEST =
+ 'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
+const GET_ITEM_BY_MEDICINE =
+ 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
var selectedPatientType = 1;
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index c5fe1a9b..f9f7d6b6 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -29,7 +29,7 @@ const Map> localizedValues = {
'en': 'Answer/Suggestions',
'ar': 'ملاحضات وتفاصيل العيادة'
},
- 'outPatients': {'en': 'Out-Patients', 'ar': 'المريض الخارجي'},
+ 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'},
'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'},
'searchAbout': {'en': 'Search', 'ar': 'البحث عن'},
'patient': {'en': 'Patient', 'ar': ' مريض'},
@@ -44,7 +44,7 @@ const Map> localizedValues = {
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'االإحالة'},
- 'inPatient': {'en': 'In-Patient', 'ar': 'المريض الداخلي'},
+ 'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'},
'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
@@ -426,7 +426,10 @@ const Map> localizedValues = {
'ar': 'تاريخ القبول المتوقع'
},
// 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'},
- 'isSickLeaveRequired': {'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة'},
+ 'isSickLeaveRequired': {
+ 'en': "Is Sick Leave Required",
+ 'ar': 'هل الإجازة المرضية مطلوبة'
+ },
'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'},
'treatmentLine': {
'en': "Main line of treatment",
@@ -459,10 +462,7 @@ const Map> localizedValues = {
'en': "POST PLANS & ESTIMATED COST",
'ar': 'خطط البريد والتكلفة المقدرة'
},
- 'postPlans': {
- 'en': "POST PLANS",
- 'ar': 'خطط البريد'
- },
+ 'postPlans': {'en': "POST PLANS", 'ar': 'خطط البريد'},
'ucaf': {'en': "UCAF", 'ar': 'UCAF'},
'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'},
'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'},
@@ -695,21 +695,47 @@ const Map> localizedValues = {
'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"},
'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"},
- 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"},
+ 'referralResponse': {
+ 'en': "Referral Response : ",
+ 'ar': " : استجابة الإحالة"
+ },
'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"},
'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"},
- 'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"},
- 'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"},
- 'sickLeaveComments': {'en': "Sick leave comments", 'ar': "تعليقات إجازة مرضية"},
+ 'referralSuccessMsgAccept': {
+ 'en': "Referral Accepted Successfully",
+ 'ar': "تم قبول الإحالة بنجاح"
+ },
+ 'referralSuccessMsgReject': {
+ 'en': "Referral Rejected Successfully",
+ 'ar': "تم رفض الإحالة بنجاح"
+ },
+ 'sickLeaveComments': {
+ 'en': "Sick leave comments",
+ 'ar': "تعليقات إجازة مرضية"
+ },
'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"},
- 'pastSurgicalHistory': {'en': "Past surgical history", 'ar': "التاريخ الجراحي"},
+ 'pastSurgicalHistory': {
+ 'en': "Past surgical history",
+ 'ar': "التاريخ الجراحي"
+ },
'complications': {'en': "Complications", 'ar': "المضاعفات"},
'floor': {'en': "Floor", 'ar': "الطابق"},
'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"},
- 'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"},
+ 'otherDepartmentsInterventions': {
+ 'en': "Other departments interventions",
+ 'ar': "تدخلات الأقسام الأخرى"
+ },
'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"},
- 'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"},
+ 'admissionRequestSuccessMsg': {
+ 'en': "Admission Request Created Successfully",
+ 'ar': "تم إنشاء طلب القبول بنجاح"
+ },
+ // 'icd': {'en': "ICD", 'ar': " "},
'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"},
'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"},
'doctorResponse': {'en': "Doctor Response", 'ar': "استجابة الطبيب"},
+ 'sickleaveonhold': {
+ 'en': "A Sick leave is on Hold status for this patient",
+ 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض"
+ },
};
diff --git a/lib/core/model/item_by_medicine_model.dart b/lib/core/model/item_by_medicine_model.dart
new file mode 100644
index 00000000..0a93a4f1
--- /dev/null
+++ b/lib/core/model/item_by_medicine_model.dart
@@ -0,0 +1,108 @@
+class ItemByMedicineModel {
+ List frequencies;
+ List routes;
+ List strengths;
+
+ ItemByMedicineModel({this.frequencies, this.routes, this.strengths});
+
+ ItemByMedicineModel.fromJson(Map json) {
+ if (json['frequencies'] != null) {
+ frequencies = new List();
+ json['frequencies'].forEach((v) {
+ frequencies.add(new Frequencies.fromJson(v));
+ });
+ }
+ if (json['routes'] != null) {
+ routes = new List();
+ json['routes'].forEach((v) {
+ routes.add(new Routes.fromJson(v));
+ });
+ }
+ if (json['strengths'] != null) {
+ strengths = new List();
+ json['strengths'].forEach((v) {
+ strengths.add(new Strengths.fromJson(v));
+ });
+ }
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ if (this.frequencies != null) {
+ data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList();
+ }
+ if (this.routes != null) {
+ data['routes'] = this.routes.map((v) => v.toJson()).toList();
+ }
+ if (this.strengths != null) {
+ data['strengths'] = this.strengths.map((v) => v.toJson()).toList();
+ }
+ return data;
+ }
+}
+
+class Frequencies {
+ String description;
+ bool isDefault;
+ int parameterCode;
+
+ Frequencies({this.description, this.isDefault, this.parameterCode});
+
+ Frequencies.fromJson(Map json) {
+ description = json['description'];
+ isDefault = json['isDefault'];
+ parameterCode = json['parameterCode'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['description'] = this.description;
+ data['isDefault'] = this.isDefault;
+ data['parameterCode'] = this.parameterCode;
+ return data;
+ }
+}
+
+class Strengths {
+ String description;
+ bool isDefault;
+ int parameterCode;
+
+ Strengths({this.description, this.isDefault, this.parameterCode});
+
+ Strengths.fromJson(Map json) {
+ description = json['description'];
+ isDefault = json['isDefault'];
+ parameterCode = json['parameterCode'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['description'] = this.description;
+ data['isDefault'] = this.isDefault;
+ data['parameterCode'] = this.parameterCode;
+ return data;
+ }
+}
+
+class Routes {
+ String description;
+ bool isDefault;
+ int parameterCode;
+
+ Routes({this.description, this.isDefault, this.parameterCode});
+
+ Routes.fromJson(Map json) {
+ description = json['description'];
+ isDefault = json['isDefault'];
+ parameterCode = json['parameterCode'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['description'] = this.description;
+ data['isDefault'] = this.isDefault;
+ data['parameterCode'] = this.parameterCode;
+ return data;
+ }
+}
diff --git a/lib/core/model/item_by_medicine_request_model.dart b/lib/core/model/item_by_medicine_request_model.dart
new file mode 100644
index 00000000..7460044b
--- /dev/null
+++ b/lib/core/model/item_by_medicine_request_model.dart
@@ -0,0 +1,18 @@
+class ItemByMedicineRequestModel {
+ String vidaAuthTokenID;
+ int medicineCode;
+
+ ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode});
+
+ ItemByMedicineRequestModel.fromJson(Map json) {
+ vidaAuthTokenID = json['VidaAuthTokenID'];
+ medicineCode = json['MedicineCode'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['VidaAuthTokenID'] = this.vidaAuthTokenID;
+ data['MedicineCode'] = this.medicineCode;
+ return data;
+ }
+}
diff --git a/lib/core/model/post_prescrition_req_model.dart b/lib/core/model/post_prescrition_req_model.dart
index 6fc71199..06a524ed 100644
--- a/lib/core/model/post_prescrition_req_model.dart
+++ b/lib/core/model/post_prescrition_req_model.dart
@@ -47,7 +47,7 @@ class PrescriptionRequestModel {
int itemId;
String doseStartDate;
int duration;
- int dose;
+ double dose;
int doseUnitId;
int route;
int frequency;
diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart
index 074d8a1b..9e6f847f 100644
--- a/lib/core/model/procedure/categories_procedure.dart
+++ b/lib/core/model/procedure/categories_procedure.dart
@@ -41,6 +41,8 @@ class EntityList {
String specialPermission;
String subGroup;
String template;
+ String remarks;
+ String type;
EntityList(
{this.allowedClinic,
@@ -54,7 +56,9 @@ class EntityList {
this.procedureName,
this.specialPermission,
this.subGroup,
- this.template});
+ this.template,
+ this.remarks,
+ this.type});
EntityList.fromJson(Map json) {
allowedClinic = json['allowedClinic'];
diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart
index 4258ee81..54640fcc 100644
--- a/lib/core/service/prescription_service.dart
+++ b/lib/core/service/prescription_service.dart
@@ -1,6 +1,7 @@
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/get_medication_response_model.dart';
+import 'package:doctor_app_flutter/core/model/item_by_medicine_request_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/model/search_drug_model.dart';
@@ -23,8 +24,13 @@ class PrescriptionService extends LookupService {
List allMedicationList = [];
List specialityList = [];
List drugToDrug = [];
+ List itemMedicineList = [];
+ List itemMedicineListRoute = [];
+ List itemMedicineListUnit = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
+ ItemByMedicineRequestModel _itemByMedicineRequestModel =
+ ItemByMedicineRequestModel();
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
//search: ["Acetaminophen"],
search: ["Amoxicillin"],
@@ -32,6 +38,25 @@ class PrescriptionService extends LookupService {
PostPrescriptionReqModel _postPrescriptionReqModel =
PostPrescriptionReqModel();
+
+ Future getItem({int itemID}) async {
+ _itemByMedicineRequestModel =
+ ItemByMedicineRequestModel(medicineCode: itemID);
+
+ hasError = false;
+
+ await baseAppClient.post(GET_ITEM_BY_MEDICINE,
+ onSuccess: (dynamic response, int statusCode) {
+ itemMedicineList = [];
+ itemMedicineList = response['listItemByMedicineCode']['frequencies'];
+ itemMedicineListRoute = response['listItemByMedicineCode']['routes'];
+ itemMedicineListUnit = response['listItemByMedicineCode']['strengths'];
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: _itemByMedicineRequestModel.toJson());
+ }
+
Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async {
hasError = false;
diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart
index 1ec996fb..98b1f36d 100644
--- a/lib/core/service/procedure_service.dart
+++ b/lib/core/service/procedure_service.dart
@@ -75,7 +75,7 @@ class ProcedureService extends BaseService {
Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel(
- search: [""],
+ search: [categoryName],
patientMRN: 0,
pageIndex: 0,
clinicId: 0,
diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart
index d188836c..3ef8229f 100644
--- a/lib/core/service/sickleave_service.dart
+++ b/lib/core/service/sickleave_service.dart
@@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.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/util/dr_app_toast_msg.dart';
// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class SickLeaveService extends BaseService {
@@ -54,8 +55,9 @@ class SickLeaveService extends BaseService {
return Future.value(response);
},
onFailure: (String error, int statusCode) {
- hasError = true;
- super.error = error;
+ DrAppToastMsg.showErrorToast(error);
+ // hasError = true;
+ // super.error = error;
},
body: addSickLeaveRequest.toJson(),
);
diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart
index f57de2b3..ecb0a48a 100644
--- a/lib/core/viewModel/medicine_view_model.dart
+++ b/lib/core/viewModel/medicine_view_model.dart
@@ -35,6 +35,22 @@ class MedicineViewModel extends BaseViewModel {
List get allMedicationList =>
_prescriptionService.allMedicationList;
+ List get itemMedicineList => _prescriptionService.itemMedicineList;
+ List get itemMedicineListRoute =>
+ _prescriptionService.itemMedicineListRoute;
+ List get itemMedicineListUnit =>
+ _prescriptionService.itemMedicineListUnit;
+ Future getItem({int itemID}) async {
+ //hasError = false;
+ //_insuranceCardService.clearInsuranceCard();
+ setState(ViewState.Busy);
+ await _prescriptionService.getItem(itemID: itemID);
+ if (_prescriptionService.hasError) {
+ error = _prescriptionService.error;
+ setState(ViewState.Error);
+ } else
+ setState(ViewState.Idle);
+ }
Future getMedicineItem(String itemName) async {
setState(ViewState.Busy);
diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart
index 34f86ffd..63dc19c5 100644
--- a/lib/core/viewModel/prescription_view_model.dart
+++ b/lib/core/viewModel/prescription_view_model.dart
@@ -22,6 +22,20 @@ class PrescriptionViewModel extends BaseViewModel {
List get drugsList => _prescriptionService.doctorsList;
//List get allMedicationList => _prescriptionService.allMedicationList;
+ List get itemMedicineList => _prescriptionService.itemMedicineList;
+
+ Future getItem({int itemID}) async {
+ hasError = false;
+ //_insuranceCardService.clearInsuranceCard();
+ setState(ViewState.BusyLocal);
+ await _prescriptionService.getItem(itemID: itemID);
+ if (_prescriptionService.hasError) {
+ error = _prescriptionService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
Future getPrescription({int mrn}) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart
index 9f28c010..98422059 100644
--- a/lib/screens/dashboard_screen.dart
+++ b/lib/screens/dashboard_screen.dart
@@ -2,6 +2,7 @@ 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/dashboard_view_model.dart';
+import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
@@ -18,6 +19,7 @@ import 'package:doctor_app_flutter/util/date-utils.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/translations_delegate_base.dart';
+import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.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:firebase_messaging/firebase_messaging.dart';
@@ -34,6 +36,7 @@ import 'doctor/my_referral_patient_screen.dart';
import 'doctor/my_referred_patient_screen.dart';
import 'medicine/medicine_search_screen.dart';
import 'patients/profile/referral/referred-patient-screen.dart';
+import '../widgets/shared/rounded_container_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
@@ -59,6 +62,7 @@ class _DashboardScreenState extends State {
bool isExpanded = false;
String isInpatient = "";
var clinicName = [];
+ var clinicId = 1;
void didChangeDependencies() async {
super.didChangeDependencies();
if (_isInit) {
@@ -138,525 +142,887 @@ class _DashboardScreenState extends State {
children: [
if(false)
ProfileWelcomeWidget(
- InkWell(
- onTap: () async {
- showCupertinoPicker(
- decKey: '',
- context: context,
- actionList: projectsProvider.doctorClinicsList);
- },
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.start,
+ Container(
+ width: MediaQuery.of(context).size.width * .6,
+ // height: 100,
+ child: DropdownButtonHideUnderline(
+ child: DropdownButton(
+ dropdownColor: Colors.white,
+ iconEnabledColor: Colors.white,
+ isExpanded: true,
+ value: clinicId,
+ iconSize: 25,
+ elevation: 16,
+ selectedItemBuilder: (BuildContext context) {
+ return projectsProvider.doctorClinicsList
+ .map((item) {
+ return Row(
+ mainAxisSize: MainAxisSize.max,
children: [
- SizedBox(
- height: 4,
- ),
- InkWell(
- onTap: () async {
- showCupertinoPicker(
- decKey: '',
- context: context,
- actionList: projectsProvider
- .doctorClinicsList);
- },
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Container(
- child: AppText(
- authProvider.selectedClinicName !=
- null
- ? authProvider
- .selectedClinicName
- : authProvider.doctorProfile
- .clinicDescription,
- fontSize:
- SizeConfig.textMultiplier *
- 1.7,
- color: Colors.white,
- textAlign: TextAlign.center,
- ),
- alignment: projectsProvider.isArabic
- ? Alignment.topRight
- : Alignment.topLeft,
- ),
- Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment:
- CrossAxisAlignment.start,
- children: [
- InkWell(
- child: Container(
- margin: EdgeInsets.only(
- left: 5,
- top: projectsProvider
- .isArabic
- ? 0
- : 5,
- right: 10,
- bottom: projectsProvider
- .isArabic
- ? 15
- : 7),
- child: Icon(
- DoctorApp.sync_icon,
- color: Colors.white,
- size: SizeConfig
- .textMultiplier *
- 1.8,
- )),
- ),
- ],
- ),
- ]),
+ AppText(
+ item.clinicName,
+ fontSize: SizeConfig.textMultiplier * 2.1,
+ color: Colors.white,
),
],
+ );
+ }).toList();
+ },
+ onChanged: (newValue) {
+ clinicId = newValue;
+ changeClinic(newValue, context);
+ },
+ items: projectsProvider.doctorClinicsList.map((item) {
+ return DropdownMenuItem(
+ child: Text(
+ item.clinicName,
+ textAlign: TextAlign.end,
),
- ]),
+ value: item.clinicID,
+ );
+ }).toList(),
+ )),
),
),
+ // InkWell(
+ // onTap: () async {
+ // showCupertinoPicker(
+ // decKey: '',
+ // context: context,
+ // actionList: projectsProvider.doctorClinicsList);
+ // },
+ // child: Row(
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // children: [
+ // Column(
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // mainAxisAlignment: MainAxisAlignment.start,
+ // children: [
+ // SizedBox(
+ // height: 4,
+ // ),
+ // InkWell(
+ // onTap: () async {
+ // // showCupertinoPicker(
+ // // decKey: '',
+ // // context: context,
+ // // actionList: projectsProvider
+ // // .doctorClinicsList);
+ // },
+ // child:
+ // Container(
+ // alignment: projectsProvider.isArabic
+ // ? Alignment.topRight
+ // : Alignment.topLeft,
+ // child: Row(
+ // mainAxisAlignment:
+ // MainAxisAlignment.spaceBetween,
+ // children: [
+
+ // Container(
+ // child: AppText(
+ // authProvider.selectedClinicName !=
+ // null
+ // ? authProvider
+ // .selectedClinicName
+ // : authProvider.doctorProfile
+ // .clinicDescription,
+ // fontSize:
+ // SizeConfig.textMultiplier *
+ // 1.7,
+ // color: Colors.white,
+ // textAlign: TextAlign.center,
+ // ),
+ // alignment: projectsProvider.isArabic
+ // ? Alignment.topRight
+ // : Alignment.topLeft,
+ // ),
+ // Row(
+ // mainAxisAlignment:
+ // MainAxisAlignment.start,
+ // mainAxisSize: MainAxisSize.max,
+ // crossAxisAlignment:
+ // CrossAxisAlignment.start,
+ // children: [
+ // InkWell(
+ // child: Container(
+ // margin: EdgeInsets.only(
+ // left: 5,
+ // top: projectsProvider
+ // .isArabic
+ // ? 0
+ // : 5,
+ // right: 10,
+ // bottom:
+ // projectsProvider
+ // .isArabic
+ // ? 15
+ // : 7),
+ // child: Icon(
+ // Icons.arrow_drop_down,
+ // color: Colors.white,
+ // size: SizeConfig
+ // .textMultiplier *
+ // 3,
+ // )),
+ // ),
+ // ],
+ //),
+ // ])),
+ // ),
+ // ],
+ // ),
+ //]),
+ // ),
+ // ),
Container(
color: Colors.white,
- height: this.isExpanded
- ? MediaQuery.of(context).size.height * 0.19
- : MediaQuery.of(context).size.height * 0.12,
+ height: MediaQuery.of(context).size.height * 0.45,
),
],
),
Positioned(
right: 9.0,
left: 9,
- bottom: 15,
- child: ExpandableCardContainer(
- expandedChild: Container(
- margin: EdgeInsets.only(left: 10, right: 10),
- height: MediaQuery.of(context).orientation ==
- Orientation.portrait
- ? MediaQuery.of(context).size.height * 0.22
- : MediaQuery.of(context).size.height * 0.25,
- width: double.infinity,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- DashboardItem(
- onTap: () {
- setState(() {
- this.isExpanded = false;
- });
- },
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Column(
- children: [
- Row(
- children: [
- Expanded(
- child: Column(
- children: [
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[0]
- .value
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[0]
- .value
- .toString()
- : "",
- fontWeight: FontWeight.bold,
- color: Colors.white,
- fontSize: 24,
- ),
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[0]
- .kPIParameter
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[0]
- .kPIParameter
- : "",
- //'My Admitted Patient',
- color: Colors.white,
- textAlign: TextAlign.center,
- fontSize: 12,
- )
- ],
- )),
- Expanded(
- child: Column(
- children: [
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[1]
- .value
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[1]
- .value
- .toString()
- : "",
- fontWeight: FontWeight.bold,
- color: Colors.white,
- fontSize: 28,
- ),
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[1]
- .kPIParameter
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[1]
- .kPIParameter
- : "",
- color: Colors.white,
- textAlign: TextAlign.center,
- fontSize: 12,
- )
- ],
- )),
- Expanded(
- child: Column(
- children: [
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[2]
- .value
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[2]
- .value
- .toString()
- : "",
- fontWeight: FontWeight.bold,
- color: Colors.white,
- fontSize: 28),
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[2]
- .kPIParameter
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[2]
- .kPIParameter
- .toString()
- : "",
- color: Colors.white,
- fontSize: 12,
- textAlign: TextAlign.center)
- ],
- ))
- ],
- ),
- Row(
- children: [
- Expanded(
- child: Column(
- children: [
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[3]
- .value
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[3]
- .value
- .toString()
- : "",
- fontWeight: FontWeight.bold,
- color: Colors.white,
- fontSize: 28),
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[3]
- .kPIParameter
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[3]
- .kPIParameter
- .toString()
- : "",
- color: Colors.white,
- fontSize: 12,
- textAlign: TextAlign.center)
- ],
- )),
- Expanded(
- child: Column(
+ top: MediaQuery.of(context).size.height * .1,
+ child: Container(
+ height: MediaQuery.of(context).size.height * 0.52,
+ child: model.dashboardItemsList.length > 0
+ ? Column(
+ children: [
+ RoundedContainer(
+ height:
+ MediaQuery.of(context).size.height *
+ 0.24,
+ margin: 5,
+ child: Column(children: [
+ Expanded(
+ flex: 3,
+ child: Row(
children: [
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[
- 4]
- .value
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[
- 4]
- .value
- .toString()
- : "",
- fontWeight: FontWeight.bold,
- color: Colors.white,
- fontSize: 28),
- AppText(
- model.dashboardItemsList
- .length >
- 0
- ? isInpatient == 'in'
- ? model
- .dashboardItemsList[
- 0]
- .summaryoptions[
- 4]
- .kPIParameter
- .toString()
- : model
- .dashboardItemsList[
- 1]
- .summaryoptions[
- 4]
- .kPIParameter
- .toString()
- : "",
- color: Colors.white,
- fontSize: 12,
- textAlign: TextAlign.center)
+ Expanded(
+ flex: 5,
+ child: Padding(
+ padding:
+ const EdgeInsets
+ .all(5.0),
+ child: Column(
+ mainAxisAlignment:
+ MainAxisAlignment
+ .spaceBetween,
+ crossAxisAlignment:
+ CrossAxisAlignment
+ .start,
+ children: [
+ rowCount(
+ model
+ .dashboardItemsList[
+ 0]
+ .summaryoptions[
+ 0]
+ .kPIParameter,
+ model
+ .dashboardItemsList[
+ 0]
+ .summaryoptions[
+ 0]
+ .value,
+ Colors.red),
+ rowCount(
+ model
+ .dashboardItemsList[
+ 0]
+ .summaryoptions[
+ 1]
+ .kPIParameter,
+ model
+ .dashboardItemsList[
+ 0]
+ .summaryoptions[
+ 1]
+ .value,
+ Colors.black),
+ rowCount(
+ model
+ .dashboardItemsList[
+ 0]
+ .summaryoptions[
+ 2]
+ .kPIParameter,
+ model
+ .dashboardItemsList[
+ 0]
+ .summaryoptions[
+ 2]
+ .value,
+ Colors
+ .grey[800]),
+ ],
+ ))),
+ Expanded(
+ flex: 3,
+ child: Stack(children: [
+ Container(
+ child: GaugeChart(
+ _createInpatientData(
+ model))),
+ Positioned(
+ child: Column(
+ children: [
+ AppText(
+ TranslationBase.of(
+ context)
+ .inPatient,
+ fontSize: 11,
+ fontWeight:
+ FontWeight
+ .bold,
+ ),
+ AppText(
+ getPatientCount(
+ model.dashboardItemsList[
+ 0])
+ .toString(),
+ fontSize: 11,
+ fontWeight:
+ FontWeight
+ .bold,
+ )
+ ],
+ ),
+ top: MediaQuery.of(
+ context)
+ .size
+ .height *
+ 0.08,
+ left: MediaQuery.of(
+ context)
+ .size
+ .width *
+ 0.10)
+ ])),
],
- ),
- ),
- Expanded(
- child: Container(),
- )
- ],
- )
- ],
- )),
- imageName: '5.png',
- color: HexColor('#B8382C'),
- hasBorder: false,
- width: MediaQuery.of(context).size.width * 0.9,
- height: MediaQuery.of(context).orientation ==
- Orientation.portrait
- ? MediaQuery.of(context).size.height * 0.22
- : MediaQuery.of(context).size.height * 0.25,
- ),
- ],
- ),
- ),
- collapsedChild: Container(
- margin: EdgeInsets.only(left: 10, right: 10),
- height: MediaQuery.of(context).orientation ==
- Orientation.portrait
- ? MediaQuery.of(context).size.height * 0.15
- : MediaQuery.of(context).size.height * 0.25,
- width: double.infinity,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- DashboardItem(
- onTap: () {
- setState(() {
- this.isExpanded = true;
- this.isInpatient = 'in';
- });
- },
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Column(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: [
- AppText(
- model.dashboardItemsList.length > 0
- ? getPatientCount(
- model.dashboardItemsList[0])
- : "",
- fontSize:
- SizeConfig.textMultiplier * 6,
- color: Colors.white,
- ),
- Flexible(
- child: AppText(
- TranslationBase.of(context).inPatient,
- color: Colors.white,
- textOverflow: TextOverflow.ellipsis,
- )),
- ],
- ),
- Padding(
- padding: EdgeInsets.all(5),
- child: Column(
- mainAxisAlignment:
- MainAxisAlignment.end,
- children: [
- Icon(
- DoctorApp.in_patient_white,
- size: 35,
- color: Colors.white,
- )
- ],
- ))
- ],
- ),
- ),
- imageName: '4.png',
- color: HexColor('#B8382C'),
- hasBorder: false,
- width: MediaQuery.of(context).size.width * 0.44,
- height: MediaQuery.of(context).orientation ==
- Orientation.portrait
- ? MediaQuery.of(context).size.height * 0.15
- : MediaQuery.of(context).size.height * 0.25,
- ),
- DashboardItem(
- onTap: () {
- setState(() {
- isExpanded = true;
- this.isInpatient = 'out';
- });
- },
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Column(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: [
- AppText(
- model.dashboardItemsList.length > 0
- ? getPatientCount(
- model.dashboardItemsList[1])
- : "",
- fontSize:
- SizeConfig.textMultiplier * 6,
- color: Colors.white,
- ),
- Flexible(
- child: AppText(
- TranslationBase.of(context)
- .outPatients,
- color: Colors.white,
- textOverflow: TextOverflow.ellipsis,
- )),
- ],
- ),
- Padding(
- padding: EdgeInsets.all(5),
- child: Column(
- mainAxisAlignment:
- MainAxisAlignment.end,
- children: [
- Icon(
- DoctorApp.out_patient,
- size: 35,
- color: Colors.white,
- )
- ],
- ))
- ],
- ),
- ),
- imageName: '5.png',
- color: HexColor('#B8382C'),
- hasBorder: false,
- width: MediaQuery.of(context).size.width * 0.44,
- height: MediaQuery.of(context).orientation ==
- Orientation.portrait
- ? MediaQuery.of(context).size.height * 0.15
- : MediaQuery.of(context).size.height * 0.25,
- ),
- ],
- ),
- ),
- isExpanded: isExpanded,
- ))
+ )),
+ Expanded(
+ flex: 1,
+ child: Padding(
+ padding:
+ const EdgeInsets.all(5.0),
+ child: Row(
+ mainAxisAlignment:
+ MainAxisAlignment.start,
+ children: [
+ rowCount(
+ model
+ .dashboardItemsList[0]
+ .summaryoptions[3]
+ .kPIParameter,
+ model
+ .dashboardItemsList[0]
+ .summaryoptions[3]
+ .value,
+ Colors.grey),
+ rowCount(
+ model
+ .dashboardItemsList[0]
+ .summaryoptions[4]
+ .kPIParameter,
+ model
+ .dashboardItemsList[0]
+ .summaryoptions[4]
+ .value,
+ Colors.grey[300]),
+ ],
+ )),
+ )
+ ])),
+ RoundedContainer(
+ height:
+ MediaQuery.of(context).size.height *
+ 0.24,
+ margin: 5,
+ child: Column(children: [
+ Expanded(
+ flex: 3,
+ child: Row(
+ children: [
+ Expanded(
+ flex: 5,
+ child: Padding(
+ padding:
+ const EdgeInsets
+ .all(5.0),
+ child: Column(
+ mainAxisAlignment:
+ MainAxisAlignment
+ .spaceBetween,
+ crossAxisAlignment:
+ CrossAxisAlignment
+ .start,
+ children: [
+ rowCount(
+ model
+ .dashboardItemsList[
+ 1]
+ .summaryoptions[
+ 0]
+ .kPIParameter,
+ model
+ .dashboardItemsList[
+ 1]
+ .summaryoptions[
+ 0]
+ .value,
+ Colors.red),
+ rowCount(
+ model
+ .dashboardItemsList[
+ 1]
+ .summaryoptions[
+ 1]
+ .kPIParameter,
+ model
+ .dashboardItemsList[
+ 1]
+ .summaryoptions[
+ 1]
+ .value,
+ Colors.black),
+ rowCount(
+ model
+ .dashboardItemsList[
+ 1]
+ .summaryoptions[
+ 2]
+ .kPIParameter,
+ model
+ .dashboardItemsList[
+ 1]
+ .summaryoptions[
+ 2]
+ .value,
+ Colors
+ .grey[800]),
+ ],
+ ))),
+ Expanded(
+ flex: 3,
+ child: Stack(children: [
+ Container(
+ child: GaugeChart(
+ _createOutPatientData(
+ model))),
+ Positioned(
+ child: Column(
+ children: [
+ AppText(
+ TranslationBase.of(
+ context)
+ .outPatient,
+ fontSize: 11,
+ fontWeight:
+ FontWeight
+ .bold,
+ textOverflow:
+ TextOverflow
+ .ellipsis,
+ ),
+ AppText(
+ getPatientCount(
+ model.dashboardItemsList[
+ 1])
+ .toString(),
+ fontSize: 11,
+ fontWeight:
+ FontWeight
+ .bold,
+ )
+ ],
+ ),
+ top: MediaQuery.of(
+ context)
+ .size
+ .height *
+ 0.08,
+ left: MediaQuery.of(
+ context)
+ .size
+ .width *
+ 0.09)
+ ]),
+ ),
+ ],
+ )),
+ Expanded(
+ flex: 1,
+ child: Padding(
+ padding:
+ const EdgeInsets.all(5.0),
+ child: Row(
+ mainAxisAlignment:
+ MainAxisAlignment.start,
+ children: [
+ rowCount(
+ model
+ .dashboardItemsList[1]
+ .summaryoptions[3]
+ .kPIParameter,
+ model
+ .dashboardItemsList[1]
+ .summaryoptions[3]
+ .value,
+ Colors.grey),
+ rowCount(
+ model
+ .dashboardItemsList[1]
+ .summaryoptions[4]
+ .kPIParameter,
+ model
+ .dashboardItemsList[1]
+ .summaryoptions[4]
+ .value,
+ Colors.grey[300]),
+ rowCount(
+ model
+ .dashboardItemsList[1]
+ .summaryoptions[5]
+ .kPIParameter,
+ model
+ .dashboardItemsList[1]
+ .summaryoptions[5]
+ .value,
+ Colors.grey[200])
+ ],
+ )),
+ )
+ ]))
+ ],
+ )
+ : SizedBox())
+ //ExpandableCardContainer(
+ // expandedChild: Container(
+ // margin: EdgeInsets.only(left: 10, right: 10),
+ // height: MediaQuery.of(context).orientation ==
+ // Orientation.portrait
+ // ? MediaQuery.of(context).size.height * 0.22
+ // : MediaQuery.of(context).size.height * 0.25,
+ // width: double.infinity,
+ // child: Row(
+ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // children: [
+ // DashboardItem(
+ // onTap: () {
+ // setState(() {
+ // this.isExpanded = false;
+ // });
+ // },
+ // child: Padding(
+ // padding: const EdgeInsets.all(8.0),
+ // child: Column(
+ // children: [
+ // Row(
+ // children: [
+ // Expanded(
+ // child: Column(
+ // children: [
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[0]
+ // .value
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[0]
+ // .value
+ // .toString()
+ // : "",
+ // fontWeight: FontWeight.bold,
+ // color: Colors.white,
+ // fontSize: 24,
+ // ),
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[0]
+ // .kPIParameter
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[0]
+ // .kPIParameter
+ // : "",
+ // //'My Admitted Patient',
+ // color: Colors.white,
+ // textAlign: TextAlign.center,
+ // fontSize: 12,
+ // )
+ // ],
+ // )),
+ // Expanded(
+ // child: Column(
+ // children: [
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[1]
+ // .value
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[1]
+ // .value
+ // .toString()
+ // : "",
+ // fontWeight: FontWeight.bold,
+ // color: Colors.white,
+ // fontSize: 28,
+ // ),
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[1]
+ // .kPIParameter
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[1]
+ // .kPIParameter
+ // : "",
+ // color: Colors.white,
+ // textAlign: TextAlign.center,
+ // fontSize: 12,
+ // )
+ // ],
+ // )),
+ // Expanded(
+ // child: Column(
+ // children: [
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[2]
+ // .value
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[2]
+ // .value
+ // .toString()
+ // : "",
+ // fontWeight: FontWeight.bold,
+ // color: Colors.white,
+ // fontSize: 28),
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[2]
+ // .kPIParameter
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[2]
+ // .kPIParameter
+ // .toString()
+ // : "",
+ // color: Colors.white,
+ // fontSize: 12,
+ // textAlign: TextAlign.center)
+ // ],
+ // ))
+ // ],
+ // ),
+ // Row(
+ // children: [
+ // Expanded(
+ // child: Column(
+ // children: [
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[3]
+ // .value
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[3]
+ // .value
+ // .toString()
+ // : "",
+ // fontWeight: FontWeight.bold,
+ // color: Colors.white,
+ // fontSize: 28),
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[3]
+ // .kPIParameter
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[3]
+ // .kPIParameter
+ // .toString()
+ // : "",
+ // color: Colors.white,
+ // fontSize: 12,
+ // textAlign: TextAlign.center)
+ // ],
+ // )),
+ // Expanded(
+ // child: Column(
+ // children: [
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[
+ // 4]
+ // .value
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[
+ // 4]
+ // .value
+ // .toString()
+ // : "",
+ // fontWeight: FontWeight.bold,
+ // color: Colors.white,
+ // fontSize: 28),
+ // AppText(
+ // model.dashboardItemsList
+ // .length >
+ // 0
+ // ? isInpatient == 'in'
+ // ? model
+ // .dashboardItemsList[
+ // 0]
+ // .summaryoptions[
+ // 4]
+ // .kPIParameter
+ // .toString()
+ // : model
+ // .dashboardItemsList[
+ // 1]
+ // .summaryoptions[
+ // 4]
+ // .kPIParameter
+ // .toString()
+ // : "",
+ // color: Colors.white,
+ // fontSize: 12,
+ // textAlign: TextAlign.center)
+ // ],
+ // ),
+ // ),
+ // Expanded(
+ // child: Container(),
+ // )
+ // ],
+ // )
+ // ],
+ // )),
+ // imageName: '5.png',
+ // color: HexColor('#B8382C'),
+ // hasBorder: false,
+ // width: MediaQuery.of(context).size.width * 0.9,
+ // height: MediaQuery.of(context).orientation ==
+ // Orientation.portrait
+ // ? MediaQuery.of(context).size.height * 0.22
+ // : MediaQuery.of(context).size.height * 0.25,
+ // ),
+ // ],
+ // ),
+ // ),
+ // collapsedChild: Container(
+ // margin: EdgeInsets.only(left: 10, right: 10),
+ // height: MediaQuery.of(context).orientation ==
+ // Orientation.portrait
+ // ? MediaQuery.of(context).size.height * 0.15
+ // : MediaQuery.of(context).size.height * 0.25,
+ // width: double.infinity,
+ // child: Row(
+ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // children: [
+ // DashboardItem(
+ // onTap: () {
+ // setState(() {
+ // this.isExpanded = true;
+ // this.isInpatient = 'in';
+ // });
+ // },
+ // child: Padding(
+ // padding: const EdgeInsets.all(8.0),
+ // child: Row(
+ // mainAxisAlignment:
+ // MainAxisAlignment.spaceBetween,
+ // children: [
+ // Column(
+ // mainAxisAlignment:
+ // MainAxisAlignment.start,
+ // children: [
+ // AppText(
+ // model.dashboardItemsList.length > 0
+ // ? getPatientCount(
+ // model.dashboardItemsList[0])
+ // : "",
+ // fontSize:
+ // SizeConfig.textMultiplier * 6,
+ // color: Colors.white,
+ // ),
+ // Flexible(
+ // child: AppText(
+ // TranslationBase.of(context).inPatient,
+ // color: Colors.white,
+ // textOverflow: TextOverflow.ellipsis,
+ // )),
+ // ],
+ // ),
+ // Padding(
+ // padding: EdgeInsets.all(5),
+ // child: Column(
+ // mainAxisAlignment:
+ // MainAxisAlignment.end,
+ // children: [
+ // Icon(
+ // DoctorApp.in_patient_white,
+ // size: 35,
+ // color: Colors.white,
+ // )
+ // ],
+ // ))
+ // ],
+ // ),
+ // ),
+ // imageName: '4.png',
+ // color: HexColor('#B8382C'),
+ // hasBorder: false,
+ // width: MediaQuery.of(context).size.width * 0.44,
+ // height: MediaQuery.of(context).orientation ==
+ // Orientation.portrait
+ // ? MediaQuery.of(context).size.height * 0.15
+ // : MediaQuery.of(context).size.height * 0.25,
+ // ),
+ // DashboardItem(
+ // onTap: () {
+ // setState(() {
+ // isExpanded = true;
+ // this.isInpatient = 'out';
+ // });
+ // },
+ // child: Padding(
+ // padding: const EdgeInsets.all(8.0),
+ // child: Row(
+ // mainAxisAlignment:
+ // MainAxisAlignment.spaceBetween,
+ // children: [
+ // Column(
+ // mainAxisAlignment:
+ // MainAxisAlignment.start,
+ // children: [
+ // AppText(
+ // model.dashboardItemsList.length > 0
+ // ? getPatientCount(
+ // model.dashboardItemsList[1])
+ // : "",
+ // fontSize:
+ // SizeConfig.textMultiplier * 6,
+ // color: Colors.white,
+ // ),
+ // Flexible(
+ // child: AppText(
+ // TranslationBase.of(context)
+ // .outPatients,
+ // color: Colors.white,
+ // textOverflow: TextOverflow.ellipsis,
+ // )),
+ // ],
+ // ),
+ // Padding(
+ // padding: EdgeInsets.all(5),
+ // child: Column(
+ // mainAxisAlignment:
+ // MainAxisAlignment.end,
+ // children: [
+ // Icon(
+ // DoctorApp.out_patient,
+ // size: 35,
+ // color: Colors.white,
+ // )
+ // ],
+ // ))
+ // ],
+ // ),
+ // ),
+ // imageName: '5.png',
+ // color: HexColor('#B8382C'),
+ // hasBorder: false,
+ // width: MediaQuery.of(context).size.width * 0.44,
+ // height: MediaQuery.of(context).orientation ==
+ // Orientation.portrait
+ // ? MediaQuery.of(context).size.height * 0.15
+ // : MediaQuery.of(context).size.height * 0.25,
+ // ),
+ // ],
+ // ),
+ // ),
+ // isExpanded: isExpanded,
+ // ))
+ )
]),
FractionallySizedBox(
widthFactor: 0.90,
@@ -1066,6 +1432,81 @@ class _DashboardScreenState extends State {
);
}
+ static List> _createInpatientData(model) {
+ final data = [
+ new GaugeSegment(
+ model.dashboardItemsList[0].summaryoptions[0].kPIParameter,
+ getValue(model.dashboardItemsList[0].summaryoptions[0].value),
+ charts.MaterialPalette.red.shadeDefault),
+ new GaugeSegment(
+ model.dashboardItemsList[0].summaryoptions[1].kPIParameter,
+ getValue(model.dashboardItemsList[0].summaryoptions[1].value),
+ charts.MaterialPalette.black.darker),
+ new GaugeSegment(
+ model.dashboardItemsList[0].summaryoptions[2].kPIParameter,
+ getValue(model.dashboardItemsList[0].summaryoptions[2].value),
+ charts.MaterialPalette.gray.shade800),
+ new GaugeSegment(
+ model.dashboardItemsList[0].summaryoptions[3].kPIParameter,
+ getValue(model.dashboardItemsList[0].summaryoptions[3].value),
+ charts.MaterialPalette.gray.shadeDefault.lighter),
+ new GaugeSegment(
+ model.dashboardItemsList[0].summaryoptions[4].kPIParameter,
+ getValue(model.dashboardItemsList[0].summaryoptions[4].value),
+ charts.MaterialPalette.gray.shadeDefault),
+ ];
+
+ return [
+ new charts.Series(
+ id: 'Segments',
+ domainFn: (GaugeSegment segment, _) => segment.segment,
+ measureFn: (GaugeSegment segment, _) => segment.size,
+ data: data,
+ colorFn: (GaugeSegment segment, _) => segment.color,
+ )
+ ];
+ }
+
+ static List> _createOutPatientData(
+ model) {
+ final data = [
+ new GaugeSegment(
+ model.dashboardItemsList[1].summaryoptions[0].kPIParameter,
+ getValue(model.dashboardItemsList[1].summaryoptions[0].value),
+ charts.MaterialPalette.red.shadeDefault),
+ new GaugeSegment(
+ model.dashboardItemsList[1].summaryoptions[1].kPIParameter,
+ getValue(model.dashboardItemsList[1].summaryoptions[1].value),
+ charts.MaterialPalette.black.darker),
+ new GaugeSegment(
+ model.dashboardItemsList[1].summaryoptions[2].kPIParameter,
+ getValue(model.dashboardItemsList[1].summaryoptions[2].value),
+ charts.MaterialPalette.gray.shade800),
+ new GaugeSegment(
+ model.dashboardItemsList[1].summaryoptions[3].kPIParameter,
+ getValue(model.dashboardItemsList[1].summaryoptions[3].value),
+ charts.MaterialPalette.gray.shadeDefault),
+ new GaugeSegment(
+ model.dashboardItemsList[1].summaryoptions[4].kPIParameter,
+ getValue(model.dashboardItemsList[1].summaryoptions[4].value),
+ charts.MaterialPalette.gray.shadeDefault.lighter),
+ ];
+
+ return [
+ new charts.Series(
+ id: 'Segments',
+ domainFn: (GaugeSegment segment, _) => segment.segment,
+ measureFn: (GaugeSegment segment, _) => segment.size,
+ data: data,
+ colorFn: (GaugeSegment segment, _) => segment.color,
+ )
+ ];
+ }
+
+ static int getValue(value) {
+ return value == 0 ? 1 : value;
+ }
+
showCupertinoPicker(
{context, List actionList, decKey, onSelectFun}) {
showModalBottomSheet(
@@ -1132,7 +1573,7 @@ class _DashboardScreenState extends State {
}
changeClinic(clinicId, BuildContext context) async {
- Navigator.pop(context);
+ // Navigator.pop(context);
changeIsLoading(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
@@ -1166,6 +1607,40 @@ class _DashboardScreenState extends State {
return value.toString();
}
+
+ Widget dot(Color c) {
+ return Container(
+ padding: EdgeInsets.all(5.0),
+ margin: EdgeInsets.all(5.0),
+ decoration: BoxDecoration(color: c, shape: BoxShape.circle));
+ }
+
+ Widget rowCount(name, int count, Color c) {
+ return Row(
+ children: [
+ dot(c),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ AppText(
+ name,
+ color: Colors.black,
+ textAlign: TextAlign.center,
+ fontSize: 10,
+ textOverflow: TextOverflow.ellipsis,
+ ),
+ AppText(
+ '(' + count.toString() + ')',
+ color: Colors.black,
+ textAlign: TextAlign.center,
+ fontSize: 14,
+ fontWeight: FontWeight.bold,
+ )
+ ],
+ ),
+ ],
+ );
+ }
}
// TODO Move to it file
diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart
index f00bfe72..5ec6e240 100644
--- a/lib/screens/prescription/add_prescription_form.dart
+++ b/lib/screens/prescription/add_prescription_form.dart
@@ -61,7 +61,7 @@ postProcedure(
sss.add(PrescriptionRequestModel(
covered: true,
- dose: int.parse(dose),
+ dose: double.parse(dose),
itemId: drugId.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit),
route: route.isEmpty ? 1 : int.parse(route),
@@ -201,6 +201,7 @@ class _PrescriptionFormWidgetState extends State {
await model.getMedicationDoseTime();
//await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel);
+ //await model.getItem();
},
builder: (
BuildContext context,
@@ -251,12 +252,23 @@ class _PrescriptionFormWidgetState extends State {
Helpers.hideKeyboard(context);
setState(() {
_selectedMedication = null;
+ model.getItem(
+ itemID: _selectedMedication
+ .itemId);
});
}
: null,
child: _selectedMedication == null
? AutoCompleteTextField<
GetMedicationResponseModel>(
+ onFocusChanged: (__) {
+ _selectedMedication != null
+ ? model.getItem(
+ itemID:
+ _selectedMedication
+ .itemId)
+ : null;
+ },
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
@@ -297,6 +309,11 @@ class _PrescriptionFormWidgetState extends State {
input.toLowerCase()),
)
: TextField(
+ onEditingComplete: () {
+ model.getItem(
+ itemID: _selectedMedication
+ .itemId);
+ },
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
@@ -343,17 +360,20 @@ class _PrescriptionFormWidgetState extends State {
.width *
0.550,
child: TextFields(
- // inputFormatters: [
- // LengthLimitingTextInputFormatter(
- // 4),
- // WhitelistingTextInputFormatter
- // .digitsOnly
- // ],
+ inputFormatters: [
+ // LengthLimitingTextInputFormatter(
+ // 4),
+ // WhitelistingTextInputFormatter
+ // .digitsOnly
+ ],
hintText:
TranslationBase.of(context)
.strength,
controller: strengthController,
- keyboardType: TextInputType.numberWithOptions(decimal: true,),
+ keyboardType:
+ TextInputType.numberWithOptions(
+ decimal: true,
+ ),
onChanged: (String value) {
setState(() {
strengthChar = value.length;
@@ -383,50 +403,46 @@ class _PrescriptionFormWidgetState extends State {
.width *
0.350,
child: InkWell(
- onTap:
- model.medicationStrengthList !=
- null
- ? () {
- Helpers.hideKeyboard(
- context);
- ListSelectDialog
- dialog =
- ListSelectDialog(
- list: model
- .medicationStrengthList,
- attributeName:
- 'nameEn',
- attributeValueId:
- 'id',
- okText:
- TranslationBase.of(
- context)
- .ok,
- okFunction:
- (selectedValue) {
- setState(() {
- units =
- selectedValue;
- });
- },
- );
- showDialog(
- barrierDismissible:
- false,
- context: context,
- builder: (BuildContext
- context) {
- return dialog;
- },
- );
- }
- : null,
+ onTap: model.itemMedicineListUnit !=
+ null
+ ? () {
+ Helpers.hideKeyboard(
+ context);
+ ListSelectDialog dialog =
+ ListSelectDialog(
+ list: model
+ .itemMedicineListUnit,
+ attributeName:
+ 'description',
+ attributeValueId:
+ 'parameterCode',
+ okText:
+ TranslationBase.of(
+ context)
+ .ok,
+ okFunction:
+ (selectedValue) {
+ setState(() {
+ units = selectedValue;
+ });
+ },
+ );
+ showDialog(
+ barrierDismissible: false,
+ context: context,
+ builder: (BuildContext
+ context) {
+ return dialog;
+ },
+ );
+ }
+ : null,
child: TextField(
decoration:
textFieldSelectorDecoration(
'UNIT Type',
units != null
- ? units['nameEn']
+ ? units['description']
: null,
true),
enabled: false,
@@ -440,14 +456,16 @@ class _PrescriptionFormWidgetState extends State {
Container(
height: screenSize.height * 0.070,
child: InkWell(
- onTap: model.medicationRouteList != null
+ onTap: model.itemMedicineListRoute != null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog =
ListSelectDialog(
- list: model.medicationRouteList,
- attributeName: 'nameEn',
- attributeValueId: 'id',
+ list:
+ model.itemMedicineListRoute,
+ attributeName: 'description',
+ attributeValueId:
+ 'parameterCode',
okText:
TranslationBase.of(context)
.ok,
@@ -475,7 +493,7 @@ class _PrescriptionFormWidgetState extends State {
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).route,
route != null
- ? route['nameEn']
+ ? route['description']
: null,
true),
enabled: false,
@@ -486,16 +504,15 @@ class _PrescriptionFormWidgetState extends State {
Container(
height: screenSize.height * 0.070,
child: InkWell(
- onTap: model.medicationFrequencyList !=
- null
+ onTap: model.itemMedicineList != null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog =
ListSelectDialog(
- list: model
- .medicationFrequencyList,
- attributeName: 'nameEn',
- attributeValueId: 'id',
+ list: model.itemMedicineList,
+ attributeName: 'description',
+ attributeValueId:
+ 'parameterCode',
okText:
TranslationBase.of(context)
.ok,
@@ -520,7 +537,7 @@ class _PrescriptionFormWidgetState extends State {
TranslationBase.of(context)
.frequency,
frequency != null
- ? frequency['nameEn']
+ ? frequency['description']
: null,
true),
enabled: false,
@@ -750,16 +767,16 @@ class _PrescriptionFormWidgetState extends State {
"Please Fill All Fields");
return;
}
- if (int.parse(
+ if (double.parse(
strengthController.text) >
- 1000) {
+ 1000.0) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
return;
}
- if (int.parse(
+ if (double.parse(
strengthController.text) ==
- 0) {
+ 0.0) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;
@@ -796,16 +813,19 @@ class _PrescriptionFormWidgetState extends State {
// .join(' '),
dose: strengthController.text,
doseUnit:
- units['id'].toString(),
+ units['parameterCode']
+ .toString(),
patient: widget.patient,
doseTimeIn:
doseTime['id'].toString(),
model: widget.model,
duration:
duration['id'].toString(),
- frequency: frequency['id']
+ frequency:
+ frequency['parameterCode']
+ .toString(),
+ route: route['parameterCode']
.toString(),
- route: route['id'].toString(),
drugId: _selectedMedication
.itemId
.toString(),
diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart
index f7012f1d..4800c361 100644
--- a/lib/screens/prescription/prescription_screen.dart
+++ b/lib/screens/prescription/prescription_screen.dart
@@ -209,16 +209,17 @@ class _NewPrescriptionScreenState extends State {
child: Column(
children: [
AppText(
- DateTime.parse(model
- .prescriptionList[
- 0]
- .entityList[
- index]
- .createdOn)
- .day
+ (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) !=
+ null
+ ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year)
+ .toString()
+ : DateTime.now()
+ .year)
.toString(),
color: Colors
.green,
+ fontSize:
+ 13.5,
),
AppText(
Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
@@ -230,7 +231,19 @@ class _NewPrescriptionScreenState extends State {
.toUpperCase(),
color: Colors
.green,
- )
+ ),
+ AppText(
+ DateTime.parse(model
+ .prescriptionList[
+ 0]
+ .entityList[
+ index]
+ .createdOn)
+ .day
+ .toString(),
+ color: Colors
+ .green,
+ ),
],
),
),
@@ -383,12 +396,9 @@ class _NewPrescriptionScreenState extends State {
),
Expanded(
child: AppText(
- "", // commening below code because there is an error coming in the model please fix it before pushing it
- // model.prescriptionList[0].entityList[index].pharmacistRemarks == null
- // ? ""
- // : model.prescriptionList[0].entityList[index].pharmacistRemarks,
- fontSize:
- 15.0),
+ // commening below code because there is an error coming in the model please fix it before pushing it
+ model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks,
+ fontSize: 15.0),
)
],
),
diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart
index 6086c278..8ed5c79b 100644
--- a/lib/screens/prescription/update_prescription_form.dart
+++ b/lib/screens/prescription/update_prescription_form.dart
@@ -115,7 +115,7 @@ class _UpdatePrescriptionFormState extends State {
(BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView(
onModelReady: (model) async {
- await model.getMedicationList();
+ //await model.getMedicationList();
await model.getMedicationStrength();
await model.getMedicationDuration();
await model.getMedicationRoute();
@@ -257,14 +257,17 @@ class _UpdatePrescriptionFormState extends State {
inputFormatters: [
LengthLimitingTextInputFormatter(
4),
- WhitelistingTextInputFormatter
- .digitsOnly
+ // WhitelistingTextInputFormatter
+ // .digitsOnly
],
+
hintText: widget.doseStreangth,
fontSize: 15.0,
controller: strengthController,
- keyboardType:
- TextInputType.number,
+ keyboardType: TextInputType
+ .numberWithOptions(
+ decimal: true,
+ ),
onChanged: (String value) {
setState(() {
strengthChar = value.length;
@@ -558,78 +561,90 @@ class _UpdatePrescriptionFormState extends State {
height: 12.0,
),
Container(
- height: screenSize.height * 0.070,
- width: double.infinity,
- child: Row(
- children: [
- Container(
- width: MediaQuery.of(context)
- .size
- .width *
- 0.29,
- child: InkWell(
- onTap: indicationList != null
- ? () {
- Helpers.hideKeyboard(
- context);
- }
- : null,
- child: TextField(
- decoration:
- textFieldSelectorDecoration(
- model.patientAssessmentList
- .isNotEmpty
- ? model
- .patientAssessmentList[
- 0]
- .icdCode10ID
- .toString()
- : '',
- indication != null
- ? indication['name']
- : null,
- true),
- enabled: true,
- readOnly: true,
- ),
- ),
- ),
- Container(
- width: MediaQuery.of(context)
- .size
- .width *
- 0.61,
- child: InkWell(
- onTap: indicationList != null
- ? () {
- Helpers.hideKeyboard(
- context);
- }
- : null,
- child: TextField(
- maxLines: 3,
- decoration:
- textFieldSelectorDecoration(
- model.patientAssessmentList
- .isNotEmpty
- ? model
- .patientAssessmentList[
- 0]
- .asciiDesc
- .toString()
- : '',
- indication != null
- ? indication['name']
- : null,
- true),
- enabled: true,
- readOnly: true,
- ),
- ),
- ),
- ],
- ),
- ),
+ height: model.patientAssessmentList
+ .isNotEmpty
+ ? screenSize.height * 0.070
+ : 0.0,
+ width: model.patientAssessmentList
+ .isNotEmpty
+ ? double.infinity
+ : 0.0,
+ child: model.patientAssessmentList
+ .isNotEmpty
+ ? Row(
+ children: [
+ Container(
+ width:
+ MediaQuery.of(context)
+ .size
+ .width *
+ 0.29,
+ child: InkWell(
+ onTap:
+ indicationList != null
+ ? () {
+ Helpers.hideKeyboard(
+ context);
+ }
+ : null,
+ child: TextField(
+ decoration: textFieldSelectorDecoration(
+ model.patientAssessmentList
+ .isNotEmpty
+ ? model
+ .patientAssessmentList[
+ 0]
+ .icdCode10ID
+ .toString()
+ : '',
+ indication != null
+ ? indication[
+ 'name']
+ : null,
+ true),
+ enabled: true,
+ readOnly: true,
+ ),
+ ),
+ ),
+ Container(
+ width:
+ MediaQuery.of(context)
+ .size
+ .width *
+ 0.61,
+ child: InkWell(
+ onTap:
+ indicationList != null
+ ? () {
+ Helpers.hideKeyboard(
+ context);
+ }
+ : null,
+ child: TextField(
+ maxLines: 3,
+ decoration: textFieldSelectorDecoration(
+ model.patientAssessmentList
+ .isNotEmpty
+ ? model
+ .patientAssessmentList[
+ 0]
+ .asciiDesc
+ .toString()
+ : '',
+ indication != null
+ ? indication[
+ 'name']
+ : null,
+ true),
+ enabled: true,
+ readOnly: true,
+ ),
+ ),
+ ),
+ ],
+ )
+ : null),
SizedBox(
height: 12.0,
),
@@ -688,6 +703,28 @@ class _UpdatePrescriptionFormState extends State {
title: 'update prescription'
.toUpperCase(),
onPressed: () {
+ if (double.parse(
+ strengthController.text) >
+ 1000.0) {
+ DrAppToastMsg.showErrorToast(
+ "1000 is the MAX for the strength");
+ return;
+ }
+ if (double.parse(
+ strengthController
+ .text) ==
+ 0.0) {
+ DrAppToastMsg.showErrorToast(
+ "Streangth can't be zero");
+ return;
+ }
+ if (strengthController
+ .text.length >
+ 4) {
+ DrAppToastMsg.showErrorToast(
+ "Streangth can't be zero");
+ return;
+ }
updatePrescription(
newStartDate: selectedDate,
newDoseStreangth:
@@ -836,8 +873,8 @@ class _UpdatePrescriptionFormState extends State {
sss.add(PrescriptionRequestModel(
covered: true,
dose: newDoseStreangth.isNotEmpty
- ? int.parse(newDoseStreangth)
- : int.parse(doseStreangth),
+ ? double.parse(newDoseStreangth)
+ : double.parse(doseStreangth),
//frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId,
doseUnitId:
diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart
index 11eadbb0..346de2db 100644
--- a/lib/screens/procedures/add-procedure-form.dart
+++ b/lib/screens/procedures/add-procedure-form.dart
@@ -25,33 +25,30 @@ postProcedure(
PatiantInformtion patient,
List entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
- List controls = List();
List controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
+
entityList.forEach((element) {
+ List controls = List();
controls.add(
- Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
+ Controls(
+ code: "remarks",
+ controlValue: element.remarks.isNotEmpty ? element.remarks : ""),
);
controls.add(
- Controls(
- code: "ordertype",
- controlValue:
- orderType.toString().isNotEmpty ? orderType.toString() : '1'),
+ Controls(code: "ordertype", controlValue: element.type),
);
- });
-
- entityList.forEach((element) {
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
- postProcedureReqModel.procedures = controlsProcedure;
+ postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
@@ -218,43 +215,43 @@ class _AddSelectedProcedureState extends State {
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Container(
- child: Row(
- children: [
- AppText(
- TranslationBase.of(context).orderType),
- Radio(
- activeColor: Color(0xFFB9382C),
- value: 1,
- groupValue: selectedType,
- onChanged: (value) {
- setSelectedType(value);
- },
- ),
- Text('routine'),
- Radio(
- activeColor: Color(0xFFB9382C),
- groupValue: selectedType,
- value: 0,
- onChanged: (value) {
- setSelectedType(value);
- },
- ),
- Text(TranslationBase.of(context).urgent),
- ],
- ),
- ),
- SizedBox(
- height: 15.0,
- ),
- TextFields(
- hintText: TranslationBase.of(context).remarks,
- controller: remarksController,
- minLines: 3,
- maxLines: 5,
- ),
+ // Container(
+ // child: Row(
+ // children: [
+ // AppText(
+ // TranslationBase.of(context).orderType),
+ // Radio(
+ // activeColor: Color(0xFFB9382C),
+ // value: 1,
+ // groupValue: selectedType,
+ // onChanged: (value) {
+ // setSelectedType(value);
+ // },
+ // ),
+ // Text('routine'),
+ // Radio(
+ // activeColor: Color(0xFFB9382C),
+ // groupValue: selectedType,
+ // value: 0,
+ // onChanged: (value) {
+ // setSelectedType(value);
+ // },
+ // ),
+ // Text(TranslationBase.of(context).urgent),
+ // ],
+ // ),
+ // ),
+ // SizedBox(
+ // height: 15.0,
+ // ),
+ // TextFields(
+ // hintText: TranslationBase.of(context).remarks,
+ // controller: remarksController,
+ // minLines: 3,
+ // maxLines: 5,
+ // ),
SizedBox(
- height: 50.0,
+ height: 100.0,
),
Container(
margin: EdgeInsets.all(
@@ -266,6 +263,7 @@ class _AddSelectedProcedureState extends State {
title: TranslationBase.of(context)
.addSelectedProcedures,
onPressed: () {
+ //print(entityList.toString());
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart
index a29100f5..f68b88cd 100644
--- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart
+++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart
@@ -17,6 +17,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final Function addSelectedHistories;
final Function(EntityList) removeHistory;
final Function(EntityList) addHistory;
+ final Function(EntityList) addRemarks;
+
final bool Function(EntityList) isEntityListSelected;
final List masterList;
@@ -27,7 +29,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
this.removeHistory,
this.masterList,
this.addHistory,
- this.isEntityListSelected})
+ this.isEntityListSelected,
+ this.addRemarks})
: super(key: key);
@override
@@ -37,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
class _EntityListCheckboxSearchWidgetState
extends State {
- int selectedType;
+ int selectedType = 1;
setSelectedType(int val) {
setState(() {
selectedType = val;
@@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState
}
List items = List();
+ List remarksList = List();
+ List typeList = List();
@override
void initState() {
@@ -52,6 +57,7 @@ class _EntityListCheckboxSearchWidgetState
super.initState();
}
+ TextEditingController remarksController = TextEditingController();
@override
Widget build(BuildContext context) {
return Container(
@@ -84,34 +90,87 @@ class _EntityListCheckboxSearchWidgetState
children: items.map((historyInfo) {
return Column(
children: [
- Row(
+ ExpansionTile(
+ title: Row(
+ children: [
+ Checkbox(
+ value: widget.isEntityListSelected(
+ historyInfo),
+ activeColor: Colors.red[800],
+ onChanged: (bool newValue) {
+ setState(() {
+ if (widget.isEntityListSelected(
+ historyInfo)) {
+ widget.removeHistory(
+ historyInfo);
+ } else {
+ widget
+ .addHistory(historyInfo);
+ }
+ });
+ }),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 10, vertical: 0),
+ child: Texts(
+ historyInfo.procedureName,
+ variant: "bodyText",
+ bold: true,
+ color: Colors.black),
+ ),
+ ),
+ ],
+ ),
children: [
- Checkbox(
- value: widget.isEntityListSelected(
- historyInfo),
- activeColor: Colors.red[800],
- onChanged: (bool newValue) {
- setState(() {
- if (widget.isEntityListSelected(
- historyInfo)) {
- widget
- .removeHistory(historyInfo);
- } else {
- widget.addHistory(historyInfo);
- }
- });
- }),
- Expanded(
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 10, vertical: 0),
- child: Texts(
- historyInfo.procedureName,
- variant: "bodyText",
- bold: true,
- color: Colors.black),
+ Container(
+ child: Row(
+ children: [
+ AppText(TranslationBase.of(context)
+ .orderType),
+ Radio(
+ activeColor: Color(0xFFB9382C),
+ value: 1,
+ groupValue: selectedType,
+ onChanged: (value) {
+ historyInfo.type =
+ setSelectedType(value)
+ .toString();
+ historyInfo.type =
+ value.toString();
+ },
+ ),
+ Text('routine'),
+ Radio(
+ activeColor: Color(0xFFB9382C),
+ groupValue: selectedType,
+ value: 0,
+ onChanged: (value) {
+ historyInfo.type =
+ setSelectedType(value)
+ .toString();
+ historyInfo.type =
+ value.toString();
+ },
+ ),
+ Text(TranslationBase.of(context)
+ .urgent),
+ ],
),
),
+ SizedBox(
+ height: 15.0,
+ ),
+ TextFields(
+ hintText:
+ TranslationBase.of(context).remarks,
+ //controller: remarksController,
+ onChanged: (value) {
+ historyInfo.remarks = value;
+ },
+ minLines: 3,
+ maxLines: 5,
+ ),
],
),
DividerWithSpacesAround(),
diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart
index 1e225ce9..afe8a63e 100644
--- a/lib/screens/procedures/procedure_screen.dart
+++ b/lib/screens/procedures/procedure_screen.dart
@@ -221,49 +221,69 @@ class _ProcedureScreenState extends State {
child: Column(
children: [
AppText(
- DateTime.parse(model
- .procedureList[
- 0]
- .entityList[
- index]
- .orderDate)
- .day
- .toString(),
- color:
- Colors.green,
- ),
+ DateTime.parse(model
+ .procedureList[
+ 0]
+ .entityList[
+ index]
+ .orderDate)
+ .year
+ .toString(),
+ color: model
+ .procedureList[
+ 0]
+ .entityList[
+ index]
+ .orderType ==
+ 0
+ ? Color(
+ 0xFFB9382C)
+ : Colors
+ .green),
AppText(
- Helpers.getMonth(model
- .procedureList[
- 0]
- .entityList[
- index]
- .orderDate !=
- null
- ? (DateTime.parse(model
- .procedureList[
- 0]
- .entityList[
- index]
- .orderDate)
- .month)
- : DateTime
- .now()
- .month)
- .toUpperCase(),
- color:
- Colors.green,
- )
+ Helpers.getMonth(model.procedureList[0].entityList[index].orderDate !=
+ null
+ ? (DateTime.parse(model.procedureList[0].entityList[index].orderDate)
+ .month)
+ : DateTime.now()
+ .month)
+ .toUpperCase(),
+ color: model
+ .procedureList[
+ 0]
+ .entityList[
+ index]
+ .orderType ==
+ 0
+ ? Color(
+ 0xFFB9382C)
+ : Colors
+ .green),
+ AppText(
+ DateTime.parse(model
+ .procedureList[
+ 0]
+ .entityList[
+ index]
+ .orderDate)
+ .day
+ .toString(),
+ color: model
+ .procedureList[
+ 0]
+ .entityList[
+ index]
+ .orderType ==
+ 0
+ ? Color(
+ 0xFFB9382C)
+ : Colors
+ .green),
],
),
),
Expanded(
child: Container(
- // height: MediaQuery.of(
- // context)
- // .size
- // .height *
- // 0.21,
width: MediaQuery.of(
context)
.size
@@ -308,17 +328,17 @@ class _ProcedureScreenState extends State {
13.0,
),
Expanded(
- child:
- AppText(
- model.procedureList[0].entityList[index].orderType ==
- 1
- ? 'Routine'
- : 'Urgent',
- fontSize:
- 11.5,
- color: Color(
- 0xFFB9382C),
- ),
+ child: AppText(
+ model.procedureList[0].entityList[index].orderType ==
+ 1
+ ? 'Routine'
+ : 'Urgent',
+ fontSize:
+ 13.5,
+ color: model.procedureList[0].entityList[index].orderType ==
+ 0
+ ? Color(0xFFB9382C)
+ : Colors.green),
),
],
),
diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart
index 2c502334..c6af1358 100644
--- a/lib/screens/procedures/update-procedure.dart
+++ b/lib/screens/procedures/update-procedure.dart
@@ -91,7 +91,7 @@ class _UpdateProcedureWidgetState extends State {
builder:
(BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView(
- baseViewModel: widget.model,
+ baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
@@ -200,51 +200,51 @@ class _UpdateProcedureWidgetState extends State {
isEntityListSelected(master),
),
),
- Container(
- child: Row(
- children: [
- AppText(
- TranslationBase.of(context).orderType),
- Radio(
- activeColor: Color(0xFFB9382C),
- value: 0,
- groupValue: selectedType,
- onChanged: (value) {
- setSelectedType(value);
- },
- ),
- Text(TranslationBase.of(context).urgent),
- Radio(
- activeColor: Color(0xFFB9382C),
- groupValue: selectedType,
- value: 1,
- onChanged: (value) {
- setSelectedType(value);
- },
- ),
- Text('routine'),
- ],
- ),
- ),
- SizedBox(
- height: 12.0,
- ),
- Container(
- decoration: BoxDecoration(
- borderRadius:
- BorderRadius.all(Radius.circular(6.0)),
- border: Border.all(
- width: 1.0,
- color: HexColor("#CCCCCC"))),
- child: TextFields(
- hintText: widget.remarks,
- fontSize: 15.0,
- controller: widget.remarksController,
- maxLines: 3,
- minLines: 2,
- onChanged: (value) {},
- ),
- ),
+ // Container(
+ // child: Row(
+ // children: [
+ // AppText(
+ // TranslationBase.of(context).orderType),
+ // Radio(
+ // activeColor: Color(0xFFB9382C),
+ // value: 0,
+ // groupValue: selectedType,
+ // onChanged: (value) {
+ // setSelectedType(value);
+ // },
+ // ),
+ // Text(TranslationBase.of(context).urgent),
+ // Radio(
+ // activeColor: Color(0xFFB9382C),
+ // groupValue: selectedType,
+ // value: 1,
+ // onChanged: (value) {
+ // setSelectedType(value);
+ // },
+ // ),
+ // Text('routine'),
+ // ],
+ // ),
+ // ),
+ // SizedBox(
+ // height: 12.0,
+ // ),
+ // Container(
+ // decoration: BoxDecoration(
+ // borderRadius:
+ // BorderRadius.all(Radius.circular(6.0)),
+ // border: Border.all(
+ // width: 1.0,
+ // color: HexColor("#CCCCCC"))),
+ // child: TextFields(
+ // hintText: widget.remarks,
+ // fontSize: 15.0,
+ // controller: widget.remarksController,
+ // maxLines: 3,
+ // minLines: 2,
+ // onChanged: (value) {},
+ // ),
+ // ),
SizedBox(
height: 50.0,
),
@@ -310,12 +310,16 @@ class _UpdateProcedureWidgetState extends State {
updateProcedureReqModel.lineItemNo = 1;
updateProcedureReqModel.orderNo = orderNo;
- controls.add(
- Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
- );
- controls.add(
- Controls(code: "ordertype", controlValue: "1"),
- );
+ entityList.forEach((element) {
+ controls.add(
+ Controls(
+ code: "remarks",
+ controlValue: element.remarks.isNotEmpty ? element.remarks : ""),
+ );
+ controls.add(
+ Controls(code: "ordertype", controlValue: '1'),
+ );
+ });
entityList.isNotEmpty
? entityList.forEach((element) {
diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart
index 81d62513..ad74b760 100644
--- a/lib/screens/sick-leave/add-sickleave.dart
+++ b/lib/screens/sick-leave/add-sickleave.dart
@@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/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_scaffold_widget.dart';
@@ -122,7 +123,14 @@ class AddSickLeavScreen extends StatelessWidget {
),
// color: Colors.green, //Colors.black,
onPressed: () => {
- if (item.status != 1)
+ if (item.status == 1)
+ {
+ DrAppToastMsg.showErrorToast(
+ TranslationBase.of(
+ context)
+ .sickleaveonhold)
+ }
+ else
{
openSickLeave(context, true,
extendedData: item)
diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart
index 103c133b..f8433fb0 100644
--- a/lib/screens/sick-leave/sick_leave.dart
+++ b/lib/screens/sick-leave/sick_leave.dart
@@ -84,10 +84,10 @@ class _SickLeaveScreenState extends State {
onModelReady: (model2) => model2.preSickLeaveStatistics(
widget.appointmentNo, widget.patientMRN),
builder: (_, model2, w) => GestureDetector(
- onTap: (){
- FocusScope.of(context).requestFocus(new FocusNode());
- },
- child: AppScaffold(
+ onTap: () {
+ FocusScope.of(context).requestFocus(new FocusNode());
+ },
+ child: AppScaffold(
baseViewModel: model2,
isShowAppBar: false,
body: Center(
@@ -113,10 +113,12 @@ class _SickLeaveScreenState extends State {
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
- width: 1.0, color: HexColor("#CCCCCC"))),
+ width: 1.0,
+ color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
children: [
AppTextFormField(
borderColor: Colors.white,
@@ -144,14 +146,15 @@ class _SickLeaveScreenState extends State {
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
- borderRadius:
- BorderRadius.all(Radius.circular(6.0)),
+ 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,
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).sickLeaveDate,
@@ -168,7 +171,8 @@ class _SickLeaveScreenState extends State {
textInputType: TextInputType.number,
controller: _toDateController,
onTap: () {
- _presentDatePicker('_selectedToDate');
+ _presentDatePicker(
+ '_selectedToDate');
},
inputFormatter: ONLY_DATE,
onChanged: (value) {
@@ -184,8 +188,8 @@ class _SickLeaveScreenState extends State {
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
decoration: BoxDecoration(
- borderRadius:
- BorderRadius.all(Radius.circular(6.0)),
+ borderRadius: BorderRadius.all(
+ Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
@@ -193,7 +197,8 @@ class _SickLeaveScreenState extends State {
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
- bottom: SizeConfig.widthMultiplier * 0.9,
+ bottom:
+ SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column(
@@ -209,55 +214,59 @@ class _SickLeaveScreenState extends State {
children: [
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: 0,
- elevation: 16,
- selectedItemBuilder:
- (BuildContext
- context) {
- return model
- .getClinicNameList()
- .map((item) {
- return Row(
- mainAxisSize:
- MainAxisSize
- .max,
- children: [
- AppText(
+ child:
+ DropdownButtonHideUnderline(
+ child: new IgnorePointer(
+ ignoring: true,
+ child: DropdownButton(
+ isExpanded: true,
+ value: getClinicName(
+ model) ??
+ "",
+ iconSize: 0,
+ elevation: 16,
+ selectedItemBuilder:
+ (BuildContext
+ context) {
+ return model
+ .getClinicNameList()
+ .map((item) {
+ return Row(
+ mainAxisSize:
+ MainAxisSize
+ .max,
+ children: <
+ Widget>[
+ AppText(
+ item,
+ fontSize:
+ SizeConfig.textMultiplier *
+ 2.1,
+ color: Colors
+ .grey,
+ ),
+ ],
+ );
+ }).toList();
+ },
+ onChanged:
+ (newValue) =>
+ {},
+ items: model
+ .getClinicNameList()
+ .map((item) {
+ return DropdownMenuItem(
+ value: item
+ .toString(),
+ child: Text(
item,
- fontSize: SizeConfig
- .textMultiplier *
- 2.1,
- color:
- Colors.grey,
+ textAlign:
+ TextAlign
+ .end,
),
- ],
- );
- }).toList();
- },
- onChanged: (newValue) =>
- {},
- items: model
- .getClinicNameList()
- .map((item) {
- return DropdownMenuItem(
- value:
- item.toString(),
- child: Text(
- item,
- textAlign:
- TextAlign.end,
- ),
- );
- }).toList(),
- ))),
+ );
+ }).toList(),
+ ))),
),
],
)
@@ -285,7 +294,8 @@ class _SickLeaveScreenState extends State {
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
- width: 1.0, color: HexColor("#CCCCCC"))),
+ width: 1.0,
+ color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -317,7 +327,8 @@ class _SickLeaveScreenState extends State {
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
- width: 1.0, color: HexColor("#CCCCCC"))),
+ width: 1.0,
+ color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -364,7 +375,8 @@ class _SickLeaveScreenState extends State {
model2.sickleaveResponse[
'ListSickLeavesToExtent']
['success']);
- Navigator.of(context).popUntil((route) {
+ Navigator.of(context)
+ .popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
});
@@ -396,7 +408,7 @@ class _SickLeaveScreenState extends State {
),
),
),
- )));
+ )));
}
void _validateInputs(model2) async {
@@ -413,7 +425,15 @@ class _SickLeaveScreenState extends State {
} else {
addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
- model2.addSickLeave(addSickLeave).then((value) => print(value));
+ await model2.addSickLeave(addSickLeave).then((value) => print(value));
+
+ DrAppToastMsg.showSuccesToast(
+ model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
+ Navigator.of(context).popUntil((route) {
+ return route.settings.name == PATIENTS_PROFILE;
+ });
+ Navigator.of(context)
+ .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
}
} catch (err) {
print(err);
diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart
index 09a3c3be..99ae043a 100644
--- a/lib/util/translations_delegate_base.dart
+++ b/lib/util/translations_delegate_base.dart
@@ -389,7 +389,7 @@ class TranslationBase {
String get replay2 => localizedValues['replay2'][locale.languageCode];
- String get outPatient => localizedValues['outPatient'][locale.languageCode];
+ String get outPatient => localizedValues['outPatients'][locale.languageCode];
String get logout => localizedValues['logout'][locale.languageCode];
@@ -765,8 +765,7 @@ class TranslationBase {
String get postPlansEstimatedCost =>
localizedValues['postPlansEstimatedCost'][locale.languageCode];
- String get postPlans =>
- localizedValues['postPlans'][locale.languageCode];
+ String get postPlans => localizedValues['postPlans'][locale.languageCode];
String get ucaf => localizedValues['ucaf'][locale.languageCode];
@@ -1085,28 +1084,43 @@ class TranslationBase {
localizedValues['clinicSearch'][locale.languageCode];
String get doctorSearch =>
localizedValues['doctorSearch'][locale.languageCode];
- String get referralResponse => localizedValues['referralResponse'][locale.languageCode];
- String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode];
- String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode];
- String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode];
- String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode];
+ String get referralResponse =>
+ localizedValues['referralResponse'][locale.languageCode];
+ String get estimatedCost =>
+ localizedValues['estimatedCost'][locale.languageCode];
+ String get diagnosisDetail =>
+ localizedValues['diagnosisDetail'][locale.languageCode];
+ String get referralSuccessMsgAccept =>
+ localizedValues['referralSuccessMsgAccept'][locale.languageCode];
+ String get referralSuccessMsgReject =>
+ localizedValues['referralSuccessMsgReject'][locale.languageCode];
String get patientName =>
localizedValues['patient-name'][locale.languageCode];
- String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode];
- String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode];
- String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode];
- String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode];
- String get complications => localizedValues['complications'][locale.languageCode];
+ String get appointmentNumber =>
+ localizedValues['appointmentNumber'][locale.languageCode];
+ String get sickLeaveComments =>
+ localizedValues['sickLeaveComments'][locale.languageCode];
+ String get pastMedicalHistory =>
+ localizedValues['pastMedicalHistory'][locale.languageCode];
+ String get pastSurgicalHistory =>
+ localizedValues['pastSurgicalHistory'][locale.languageCode];
+ String get complications =>
+ localizedValues['complications'][locale.languageCode];
String get floor => localizedValues['floor'][locale.languageCode];
- String get roomCategory => localizedValues['roomCategory'][locale.languageCode];
- String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode];
- String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode];
- String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode];
+ String get roomCategory =>
+ localizedValues['roomCategory'][locale.languageCode];
+ String get otherDepartmentsInterventions =>
+ localizedValues['otherDepartmentsInterventions'][locale.languageCode];
+ String get otherProcedure =>
+ localizedValues['otherProcedure'][locale.languageCode];
+ String get admissionRequestSuccessMsg =>
+ localizedValues['admissionRequestSuccessMsg'][locale.languageCode];
String get infoStatus => localizedValues['infoStatus'][locale.languageCode];
String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode];
-
+String get sickleaveonhold =>
+ localizedValues['sickleaveonhold'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate {
diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart
index adb0aef0..8839c47c 100644
--- a/lib/widgets/auth/verification_methods.dart
+++ b/lib/widgets/auth/verification_methods.dart
@@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.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/profile_req_Model.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/otp/sms-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
@@ -17,6 +18,7 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
+import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart';
@@ -233,7 +235,8 @@ class _VerificationMethodsState extends State {
Expanded(
child: InkWell(
onTap: () => {
- authenticateUser(3, true, authProv)
+ authenticateUser(3,
+ true, authProv)
},
child: getButton(
user.logInTypeID,
@@ -483,9 +486,7 @@ class _VerificationMethodsState extends State {
return InkWell(
onTap: () => {
if (checkIfBiometricAvailable(BiometricType.fingerprint))
- {
- authenticateUser(3, true, authProv)
- }
+ {authenticateUser(3, true, authProv)}
},
child: RoundedContainer(
backgroundColor:
@@ -703,10 +704,23 @@ class _VerificationMethodsState extends State {
loginWithFingurePrintFace(type, isActive, authProv) async {
if (isActive) {
// this.startBiometricLoginIfAvailable();
- authenticated = await auth.authenticateWithBiometrics(
- localizedReason: 'Scan your fingerprint to authenticate',
- useErrorDialogs: true,
- stickyAuth: true);
+
+ const iosStrings = const IOSAuthMessages(
+ cancelButton: 'cancel',
+ goToSettingsButton: 'settings',
+ goToSettingsDescription: 'Please set up your Touch ID.',
+ lockOut: 'Please reenable your Touch ID');
+
+ try {
+ authenticated = await auth.authenticateWithBiometrics(
+ localizedReason: 'Scan your fingerprint to authenticate',
+ useErrorDialogs: true,
+ stickyAuth: true,
+ iOSAuthStrings: iosStrings);
+ } on PlatformException catch (e) {
+ DrAppToastMsg.showErrorToast(e);
+ }
+ if (!mounted) return;
if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) {
this.sendActivationCode(type, authProv);
// this.checkActivationCode(authProv);
diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart
new file mode 100644
index 00000000..ddd649d1
--- /dev/null
+++ b/lib/widgets/dashboard/guage_chart.dart
@@ -0,0 +1,54 @@
+import 'package:charts_flutter/flutter.dart' as charts;
+import 'package:flutter/material.dart';
+import 'dart:math';
+
+class GaugeChart extends StatelessWidget {
+ final List seriesList;
+ final bool animate;
+
+ GaugeChart(this.seriesList, {this.animate});
+
+ /// Creates a [PieChart] with sample data and no transition.
+ factory GaugeChart.withSampleData() {
+ return new GaugeChart(
+ _createSampleData(),
+ // Disable animations for image tests.
+ animate: false,
+ );
+ }
+ @override
+ Widget build(BuildContext context) {
+ return new charts.PieChart(seriesList,
+ animate: animate,
+ defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10));
+ //);
+ }
+
+ static List> _createSampleData() {
+ final data = [
+ new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault),
+ new GaugeSegment(
+ 'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault),
+ new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault),
+ new GaugeSegment(
+ 'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault),
+ ];
+
+ return [
+ new charts.Series(
+ id: 'Segments',
+ domainFn: (GaugeSegment segment, _) => segment.segment,
+ measureFn: (GaugeSegment segment, _) => segment.size,
+ data: data,
+ )
+ ];
+ }
+}
+
+/// Sample data type.
+class GaugeSegment {
+ final String segment;
+ final int size;
+ final charts.Color color;
+ GaugeSegment(this.segment, this.size, this.color);
+}
diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart
index ac61f838..fe5a9c9b 100644
--- a/lib/widgets/patients/profile/profile-welcome-widget.dart
+++ b/lib/widgets/patients/profile/profile-welcome-widget.dart
@@ -7,9 +7,8 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class ProfileWelcomeWidget extends StatelessWidget {
-
final Widget clinicWidget;
-final double height;
+ final double height;
ProfileWelcomeWidget(this.clinicWidget, {this.height = 140});
@@ -43,7 +42,7 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
- TranslationBase.of(context).dr +
+ TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
@@ -62,16 +61,12 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
-
CircleAvatar(
-
// radius: (52)
child: ClipRRect(
- borderRadius:BorderRadius.circular(10),
-
+ borderRadius: BorderRadius.circular(10),
child: Image.network(
- authProvider
- .doctorProfile.doctorImageURL,
+ authProvider.doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 70,
height: 60,
@@ -79,7 +74,6 @@ final double height;
),
backgroundColor: Colors.transparent,
)
-
],
),
),