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

 Conflicts:
	lib/util/translations_delegate_base.dart
merge-requests/323/head
Elham Rababah 4 years ago
commit 8615671095

@ -25,7 +25,9 @@
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string> <string>Camera permission is required for barcode scanning.</string>
<key>NSFaceIDUsageDescription</key> <key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string> <string>We are using it for authentication</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>

@ -70,7 +70,7 @@ class BaseAppClient {
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['SessionID'] = SESSION_ID; body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; 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) { if (body['VidaAuthTokenID'] == null) {
body['VidaAuthTokenID'] = body['VidaAuthTokenID'] =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID); await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
@ -98,9 +98,12 @@ class BaseAppClient {
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) { if (!parsed['IsAuthenticated']) {
// onFailure(getError(parsed), statusCode); if (body['OTP_SendType'] != null) {
await helpers.logout(); onFailure(getError(parsed), statusCode);
helpers.showErrorToast('Your session expired Please login agian'); } else {
await helpers.logout();
helpers.showErrorToast('Your session expired Please login agian');
}
} else if (parsed['MessageStatus'] == 1) { } else if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated']) if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);

@ -27,7 +27,8 @@ const PATIENT_GET_CLINIC_BY_PROJECT_URL =
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; 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'; 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_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; const GET_ROOM_CATEGORIES =
const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; '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_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; 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; var selectedPatientType = 1;

@ -29,7 +29,7 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'Answer/Suggestions', 'en': 'Answer/Suggestions',
'ar': 'ملاحضات وتفاصيل العيادة' 'ar': 'ملاحضات وتفاصيل العيادة'
}, },
'outPatients': {'en': 'Out-Patients', 'ar': 'المريض الخارجي'}, 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'},
'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'},
'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'},
'patient': {'en': 'Patient', 'ar': ' مريض'}, 'patient': {'en': 'Patient', 'ar': ' مريض'},
@ -44,7 +44,7 @@ const Map<String, Map<String, String>> localizedValues = {
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'االإحالة'}, 'referral': {'en': 'Referral', 'ar': 'االإحالة'},
'inPatient': {'en': 'In-Patient', 'ar': 'المريض الداخلي'}, 'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
@ -426,7 +426,10 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'تاريخ القبول المتوقع' 'ar': 'تاريخ القبول المتوقع'
}, },
// 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", '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': 'حمل المريض'}, 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'},
'treatmentLine': { 'treatmentLine': {
'en': "Main line of treatment", 'en': "Main line of treatment",
@ -459,10 +462,7 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "POST PLANS & ESTIMATED COST", 'en': "POST PLANS & ESTIMATED COST",
'ar': 'خطط البريد والتكلفة المقدرة' 'ar': 'خطط البريد والتكلفة المقدرة'
}, },
'postPlans': { 'postPlans': {'en': "POST PLANS", 'ar': 'خطط البريد'},
'en': "POST PLANS",
'ar': 'خطط البريد'
},
'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, 'ucaf': {'en': "UCAF", 'ar': 'UCAF'},
'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'},
'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'},
@ -695,21 +695,47 @@ const Map<String, Map<String, String>> localizedValues = {
'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"}, 'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"},
'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"}, 'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"},
'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, 'referralResponse': {
'en': "Referral Response : ",
'ar': " : استجابة الإحالة"
},
'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"},
'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"},
'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"}, 'referralSuccessMsgAccept': {
'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"}, 'en': "Referral Accepted Successfully",
'sickLeaveComments': {'en': "Sick leave comments", 'ar': "تعليقات إجازة مرضية"}, 'ar': "تم قبول الإحالة بنجاح"
},
'referralSuccessMsgReject': {
'en': "Referral Rejected Successfully",
'ar': "تم رفض الإحالة بنجاح"
},
'sickLeaveComments': {
'en': "Sick leave comments",
'ar': "تعليقات إجازة مرضية"
},
'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"}, 'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"},
'pastSurgicalHistory': {'en': "Past surgical history", 'ar': "التاريخ الجراحي"}, 'pastSurgicalHistory': {
'en': "Past surgical history",
'ar': "التاريخ الجراحي"
},
'complications': {'en': "Complications", 'ar': "المضاعفات"}, 'complications': {'en': "Complications", 'ar': "المضاعفات"},
'floor': {'en': "Floor", 'ar': "الطابق"}, 'floor': {'en': "Floor", 'ar': "الطابق"},
'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"}, 'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"},
'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"}, 'otherDepartmentsInterventions': {
'en': "Other departments interventions",
'ar': "تدخلات الأقسام الأخرى"
},
'otherProcedure': {'en': "Other procedure", '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': "رقم الطلب"}, 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"},
'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"}, 'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"},
'doctorResponse': {'en': "Doctor Response", 'ar': "استجابة الطبيب"}, 'doctorResponse': {'en': "Doctor Response", 'ar': "استجابة الطبيب"},
'sickleaveonhold': {
'en': "A Sick leave is on Hold status for this patient",
'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض"
},
}; };

@ -0,0 +1,108 @@
class ItemByMedicineModel {
List<Frequencies> frequencies;
List<Routes> routes;
List<Strengths> strengths;
ItemByMedicineModel({this.frequencies, this.routes, this.strengths});
ItemByMedicineModel.fromJson(Map<String, dynamic> json) {
if (json['frequencies'] != null) {
frequencies = new List<Frequencies>();
json['frequencies'].forEach((v) {
frequencies.add(new Frequencies.fromJson(v));
});
}
if (json['routes'] != null) {
routes = new List<Routes>();
json['routes'].forEach((v) {
routes.add(new Routes.fromJson(v));
});
}
if (json['strengths'] != null) {
strengths = new List<Strengths>();
json['strengths'].forEach((v) {
strengths.add(new Strengths.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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<String, dynamic> json) {
description = json['description'];
isDefault = json['isDefault'];
parameterCode = json['parameterCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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<String, dynamic> json) {
description = json['description'];
isDefault = json['isDefault'];
parameterCode = json['parameterCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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<String, dynamic> json) {
description = json['description'];
isDefault = json['isDefault'];
parameterCode = json['parameterCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['description'] = this.description;
data['isDefault'] = this.isDefault;
data['parameterCode'] = this.parameterCode;
return data;
}
}

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

@ -47,7 +47,7 @@ class PrescriptionRequestModel {
int itemId; int itemId;
String doseStartDate; String doseStartDate;
int duration; int duration;
int dose; double dose;
int doseUnitId; int doseUnitId;
int route; int route;
int frequency; int frequency;

@ -41,6 +41,8 @@ class EntityList {
String specialPermission; String specialPermission;
String subGroup; String subGroup;
String template; String template;
String remarks;
String type;
EntityList( EntityList(
{this.allowedClinic, {this.allowedClinic,
@ -54,7 +56,9 @@ class EntityList {
this.procedureName, this.procedureName,
this.specialPermission, this.specialPermission,
this.subGroup, this.subGroup,
this.template}); this.template,
this.remarks,
this.type});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
allowedClinic = json['allowedClinic']; allowedClinic = json['allowedClinic'];

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; 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_model.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_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/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_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'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
@ -23,8 +24,13 @@ class PrescriptionService extends LookupService {
List<GetMedicationResponseModel> allMedicationList = []; List<GetMedicationResponseModel> allMedicationList = [];
List<dynamic> specialityList = []; List<dynamic> specialityList = [];
List<dynamic> drugToDrug = []; List<dynamic> drugToDrug = [];
List<dynamic> itemMedicineList = [];
List<dynamic> itemMedicineListRoute = [];
List<dynamic> itemMedicineListUnit = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
ItemByMedicineRequestModel _itemByMedicineRequestModel =
ItemByMedicineRequestModel();
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
//search: ["Acetaminophen"], //search: ["Acetaminophen"],
search: ["Amoxicillin"], search: ["Amoxicillin"],
@ -32,6 +38,25 @@ class PrescriptionService extends LookupService {
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _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( Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async { GetAssessmentReqModel getAssessmentReqModel) async {
hasError = false; hasError = false;

@ -75,7 +75,7 @@ class ProcedureService extends BaseService {
Future getProcedureCategory({String categoryName, String categoryID}) async { Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [""], search: [categoryName],
patientMRN: 0, patientMRN: 0,
pageIndex: 0, pageIndex: 0,
clinicId: 0, clinicId: 0,

@ -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/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_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/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'; // import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class SickLeaveService extends BaseService { class SickLeaveService extends BaseService {
@ -54,8 +55,9 @@ class SickLeaveService extends BaseService {
return Future.value(response); return Future.value(response);
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; DrAppToastMsg.showErrorToast(error);
super.error = error; // hasError = true;
// super.error = error;
}, },
body: addSickLeaveRequest.toJson(), body: addSickLeaveRequest.toJson(),
); );

@ -35,6 +35,22 @@ class MedicineViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList; _prescriptionService.allMedicationList;
List<dynamic> get itemMedicineList => _prescriptionService.itemMedicineList;
List<dynamic> get itemMedicineListRoute =>
_prescriptionService.itemMedicineListRoute;
List<dynamic> 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 { Future getMedicineItem(String itemName) async {
setState(ViewState.Busy); setState(ViewState.Busy);

@ -22,6 +22,20 @@ class PrescriptionViewModel extends BaseViewModel {
List<dynamic> get drugsList => _prescriptionService.doctorsList; List<dynamic> get drugsList => _prescriptionService.doctorsList;
//List<dynamic> get allMedicationList => _prescriptionService.allMedicationList; //List<dynamic> get allMedicationList => _prescriptionService.allMedicationList;
List<dynamic> 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 { Future getPrescription({int mrn}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();

File diff suppressed because it is too large Load Diff

@ -61,7 +61,7 @@ postProcedure(
sss.add(PrescriptionRequestModel( sss.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: int.parse(dose), dose: double.parse(dose),
itemId: drugId.isEmpty ? 1 : int.parse(drugId), itemId: drugId.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit), doseUnitId: int.parse(doseUnit),
route: route.isEmpty ? 1 : int.parse(route), route: route.isEmpty ? 1 : int.parse(route),
@ -201,6 +201,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
//await model.getMedicationIndications(); //await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
//await model.getItem();
}, },
builder: ( builder: (
BuildContext context, BuildContext context,
@ -251,12 +252,23 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
setState(() { setState(() {
_selectedMedication = null; _selectedMedication = null;
model.getItem(
itemID: _selectedMedication
.itemId);
}); });
} }
: null, : null,
child: _selectedMedication == null child: _selectedMedication == null
? AutoCompleteTextField< ? AutoCompleteTextField<
GetMedicationResponseModel>( GetMedicationResponseModel>(
onFocusChanged: (__) {
_selectedMedication != null
? model.getItem(
itemID:
_selectedMedication
.itemId)
: null;
},
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
@ -297,6 +309,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
input.toLowerCase()), input.toLowerCase()),
) )
: TextField( : TextField(
onEditingComplete: () {
model.getItem(
itemID: _selectedMedication
.itemId);
},
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
@ -343,17 +360,20 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.width * .width *
0.550, 0.550,
child: TextFields( child: TextFields(
// inputFormatters: [ inputFormatters: [
// LengthLimitingTextInputFormatter( // LengthLimitingTextInputFormatter(
// 4), // 4),
// WhitelistingTextInputFormatter // WhitelistingTextInputFormatter
// .digitsOnly // .digitsOnly
// ], ],
hintText: hintText:
TranslationBase.of(context) TranslationBase.of(context)
.strength, .strength,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.numberWithOptions(decimal: true,), keyboardType:
TextInputType.numberWithOptions(
decimal: true,
),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;
@ -383,50 +403,46 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.width * .width *
0.350, 0.350,
child: InkWell( child: InkWell(
onTap: onTap: model.itemMedicineListUnit !=
model.medicationStrengthList != null
null ? () {
? () { Helpers.hideKeyboard(
Helpers.hideKeyboard( context);
context); ListSelectDialog dialog =
ListSelectDialog ListSelectDialog(
dialog = list: model
ListSelectDialog( .itemMedicineListUnit,
list: model attributeName:
.medicationStrengthList, 'description',
attributeName: attributeValueId:
'nameEn', 'parameterCode',
attributeValueId: okText:
'id', TranslationBase.of(
okText: context)
TranslationBase.of( .ok,
context) okFunction:
.ok, (selectedValue) {
okFunction: setState(() {
(selectedValue) { units = selectedValue;
setState(() { });
units = },
selectedValue; );
}); showDialog(
}, barrierDismissible: false,
); context: context,
showDialog( builder: (BuildContext
barrierDismissible: context) {
false, return dialog;
context: context, },
builder: (BuildContext );
context) { }
return dialog; : null,
},
);
}
: null,
child: TextField( child: TextField(
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
'UNIT Type', 'UNIT Type',
units != null units != null
? units['nameEn'] ? units['description']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -440,14 +456,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationRouteList != null onTap: model.itemMedicineListRoute != null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model.medicationRouteList, list:
attributeName: 'nameEn', model.itemMedicineListRoute,
attributeValueId: 'id', attributeName: 'description',
attributeValueId:
'parameterCode',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
.ok, .ok,
@ -475,7 +493,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).route, TranslationBase.of(context).route,
route != null route != null
? route['nameEn'] ? route['description']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -486,16 +504,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationFrequencyList != onTap: model.itemMedicineList != null
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model list: model.itemMedicineList,
.medicationFrequencyList, attributeName: 'description',
attributeName: 'nameEn', attributeValueId:
attributeValueId: 'id', 'parameterCode',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
.ok, .ok,
@ -520,7 +537,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of(context) TranslationBase.of(context)
.frequency, .frequency,
frequency != null frequency != null
? frequency['nameEn'] ? frequency['description']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -750,16 +767,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
"Please Fill All Fields"); "Please Fill All Fields");
return; return;
} }
if (int.parse( if (double.parse(
strengthController.text) > strengthController.text) >
1000) { 1000.0) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength"); "1000 is the MAX for the strength");
return; return;
} }
if (int.parse( if (double.parse(
strengthController.text) == strengthController.text) ==
0) { 0.0) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"Streangth can't be zero"); "Streangth can't be zero");
return; return;
@ -796,16 +813,19 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// .join(' '), // .join(' '),
dose: strengthController.text, dose: strengthController.text,
doseUnit: doseUnit:
units['id'].toString(), units['parameterCode']
.toString(),
patient: widget.patient, patient: widget.patient,
doseTimeIn: doseTimeIn:
doseTime['id'].toString(), doseTime['id'].toString(),
model: widget.model, model: widget.model,
duration: duration:
duration['id'].toString(), duration['id'].toString(),
frequency: frequency['id'] frequency:
frequency['parameterCode']
.toString(),
route: route['parameterCode']
.toString(), .toString(),
route: route['id'].toString(),
drugId: _selectedMedication drugId: _selectedMedication
.itemId .itemId
.toString(), .toString(),

@ -209,16 +209,17 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
child: Column( child: Column(
children: [ children: [
AppText( AppText(
DateTime.parse(model (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) !=
.prescriptionList[ null
0] ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year)
.entityList[ .toString()
index] : DateTime.now()
.createdOn) .year)
.day
.toString(), .toString(),
color: Colors color: Colors
.green, .green,
fontSize:
13.5,
), ),
AppText( AppText(
Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
@ -230,7 +231,19 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.toUpperCase(), .toUpperCase(),
color: Colors color: Colors
.green, .green,
) ),
AppText(
DateTime.parse(model
.prescriptionList[
0]
.entityList[
index]
.createdOn)
.day
.toString(),
color: Colors
.green,
),
], ],
), ),
), ),
@ -383,12 +396,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
"", // commening below code because there is an error coming in the model please fix it before pushing it // 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 == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks,
// ? "" fontSize: 15.0),
// : model.prescriptionList[0].entityList[index].pharmacistRemarks,
fontSize:
15.0),
) )
], ],
), ),

@ -115,7 +115,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
(BuildContext context, StateSetter setState /*You can rename this!*/) { (BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getMedicationList(); //await model.getMedicationList();
await model.getMedicationStrength(); await model.getMedicationStrength();
await model.getMedicationDuration(); await model.getMedicationDuration();
await model.getMedicationRoute(); await model.getMedicationRoute();
@ -257,14 +257,17 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(
4), 4),
WhitelistingTextInputFormatter // WhitelistingTextInputFormatter
.digitsOnly // .digitsOnly
], ],
hintText: widget.doseStreangth, hintText: widget.doseStreangth,
fontSize: 15.0, fontSize: 15.0,
controller: strengthController, controller: strengthController,
keyboardType: keyboardType: TextInputType
TextInputType.number, .numberWithOptions(
decimal: true,
),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;
@ -558,78 +561,90 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: screenSize.height * 0.070, height: model.patientAssessmentList
width: double.infinity, .isNotEmpty
child: Row( ? screenSize.height * 0.070
children: [ : 0.0,
Container( width: model.patientAssessmentList
width: MediaQuery.of(context) .isNotEmpty
.size ? double.infinity
.width * : 0.0,
0.29, child: model.patientAssessmentList
child: InkWell( .isNotEmpty
onTap: indicationList != null ? Row(
? () { children: [
Helpers.hideKeyboard( Container(
context); width:
} MediaQuery.of(context)
: null, .size
child: TextField( .width *
decoration: 0.29,
textFieldSelectorDecoration( child: InkWell(
model.patientAssessmentList onTap:
.isNotEmpty indicationList != null
? model ? () {
.patientAssessmentList[ Helpers.hideKeyboard(
0] context);
.icdCode10ID }
.toString() : null,
: '', child: TextField(
indication != null decoration: textFieldSelectorDecoration(
? indication['name'] model.patientAssessmentList
: null, .isNotEmpty
true), ? model
enabled: true, .patientAssessmentList[
readOnly: true, 0]
), .icdCode10ID
), .toString()
), : '',
Container( indication != null
width: MediaQuery.of(context) ? indication[
.size 'name']
.width * : null,
0.61, true),
child: InkWell( enabled: true,
onTap: indicationList != null readOnly: true,
? () { ),
Helpers.hideKeyboard( ),
context); ),
} Container(
: null, width:
child: TextField( MediaQuery.of(context)
maxLines: 3, .size
decoration: .width *
textFieldSelectorDecoration( 0.61,
model.patientAssessmentList child: InkWell(
.isNotEmpty onTap:
? model indicationList != null
.patientAssessmentList[ ? () {
0] Helpers.hideKeyboard(
.asciiDesc context);
.toString() }
: '', : null,
indication != null child: TextField(
? indication['name'] maxLines: 3,
: null, decoration: textFieldSelectorDecoration(
true), model.patientAssessmentList
enabled: true, .isNotEmpty
readOnly: true, ? model
), .patientAssessmentList[
), 0]
), .asciiDesc
], .toString()
), : '',
), indication != null
? indication[
'name']
: null,
true),
enabled: true,
readOnly: true,
),
),
),
],
)
: null),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
@ -688,6 +703,28 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
title: 'update prescription' title: 'update prescription'
.toUpperCase(), .toUpperCase(),
onPressed: () { 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( updatePrescription(
newStartDate: selectedDate, newStartDate: selectedDate,
newDoseStreangth: newDoseStreangth:
@ -836,8 +873,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
sss.add(PrescriptionRequestModel( sss.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: newDoseStreangth.isNotEmpty dose: newDoseStreangth.isNotEmpty
? int.parse(newDoseStreangth) ? double.parse(newDoseStreangth)
: int.parse(doseStreangth), : double.parse(doseStreangth),
//frequency.isNotEmpty ? int.parse(dose) : 1, //frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId, itemId: drugId,
doseUnitId: doseUnitId:

@ -25,33 +25,30 @@ postProcedure(
PatiantInformtion patient, PatiantInformtion patient,
List<EntityList> entityList}) async { List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) { entityList.forEach((element) {
List<Controls> controls = List();
controls.add( controls.add(
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), Controls(
code: "remarks",
controlValue: element.remarks.isNotEmpty ? element.remarks : ""),
); );
controls.add( controls.add(
Controls( Controls(code: "ordertype", controlValue: element.type),
code: "ordertype",
controlValue:
orderType.toString().isNotEmpty ? orderType.toString() : '1'),
); );
});
entityList.forEach((element) {
controlsProcedure.add(Procedures( controlsProcedure.add(Procedures(
category: element.categoryID, category: element.categoryID,
procedure: element.procedureId, procedure: element.procedureId,
controls: controls)); controls: controls));
}); });
postProcedureReqModel.procedures = controlsProcedure;
postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel, patient.patientMRN); await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -218,43 +215,43 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( // Container(
child: Row( // child: Row(
children: [ // children: [
AppText( // AppText(
TranslationBase.of(context).orderType), // TranslationBase.of(context).orderType),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
value: 1, // value: 1,
groupValue: selectedType, // groupValue: selectedType,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text('routine'), // Text('routine'),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
groupValue: selectedType, // groupValue: selectedType,
value: 0, // value: 0,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text(TranslationBase.of(context).urgent), // Text(TranslationBase.of(context).urgent),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 15.0, // height: 15.0,
), // ),
TextFields( // TextFields(
hintText: TranslationBase.of(context).remarks, // hintText: TranslationBase.of(context).remarks,
controller: remarksController, // controller: remarksController,
minLines: 3, // minLines: 3,
maxLines: 5, // maxLines: 5,
), // ),
SizedBox( SizedBox(
height: 50.0, height: 100.0,
), ),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
@ -266,6 +263,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
title: TranslationBase.of(context) title: TranslationBase.of(context)
.addSelectedProcedures, .addSelectedProcedures,
onPressed: () { onPressed: () {
//print(entityList.toString());
Navigator.pop(context); Navigator.pop(context);
postProcedure( postProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),

@ -17,6 +17,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final Function addSelectedHistories; final Function addSelectedHistories;
final Function(EntityList) removeHistory; final Function(EntityList) removeHistory;
final Function(EntityList) addHistory; final Function(EntityList) addHistory;
final Function(EntityList) addRemarks;
final bool Function(EntityList) isEntityListSelected; final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList; final List<EntityList> masterList;
@ -27,7 +29,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
this.removeHistory, this.removeHistory,
this.masterList, this.masterList,
this.addHistory, this.addHistory,
this.isEntityListSelected}) this.isEntityListSelected,
this.addRemarks})
: super(key: key); : super(key: key);
@override @override
@ -37,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
class _EntityListCheckboxSearchWidgetState class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> { extends State<EntityListCheckboxSearchWidget> {
int selectedType; int selectedType = 1;
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
selectedType = val; selectedType = val;
@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState
} }
List<EntityList> items = List(); List<EntityList> items = List();
List<String> remarksList = List();
List<int> typeList = List();
@override @override
void initState() { void initState() {
@ -52,6 +57,7 @@ class _EntityListCheckboxSearchWidgetState
super.initState(); super.initState();
} }
TextEditingController remarksController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -84,34 +90,87 @@ class _EntityListCheckboxSearchWidgetState
children: items.map((historyInfo) { children: items.map((historyInfo) {
return Column( return Column(
children: [ 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: [ children: [
Checkbox( Container(
value: widget.isEntityListSelected( child: Row(
historyInfo), children: [
activeColor: Colors.red[800], AppText(TranslationBase.of(context)
onChanged: (bool newValue) { .orderType),
setState(() { Radio(
if (widget.isEntityListSelected( activeColor: Color(0xFFB9382C),
historyInfo)) { value: 1,
widget groupValue: selectedType,
.removeHistory(historyInfo); onChanged: (value) {
} else { historyInfo.type =
widget.addHistory(historyInfo); setSelectedType(value)
} .toString();
}); historyInfo.type =
}), value.toString();
Expanded( },
child: Padding( ),
padding: const EdgeInsets.symmetric( Text('routine'),
horizontal: 10, vertical: 0), Radio(
child: Texts( activeColor: Color(0xFFB9382C),
historyInfo.procedureName, groupValue: selectedType,
variant: "bodyText", value: 0,
bold: true, onChanged: (value) {
color: Colors.black), 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(), DividerWithSpacesAround(),

@ -221,49 +221,69 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
child: Column( child: Column(
children: [ children: [
AppText( AppText(
DateTime.parse(model DateTime.parse(model
.procedureList[ .procedureList[
0] 0]
.entityList[ .entityList[
index] index]
.orderDate) .orderDate)
.day .year
.toString(), .toString(),
color: color: model
Colors.green, .procedureList[
), 0]
.entityList[
index]
.orderType ==
0
? Color(
0xFFB9382C)
: Colors
.green),
AppText( AppText(
Helpers.getMonth(model Helpers.getMonth(model.procedureList[0].entityList[index].orderDate !=
.procedureList[ null
0] ? (DateTime.parse(model.procedureList[0].entityList[index].orderDate)
.entityList[ .month)
index] : DateTime.now()
.orderDate != .month)
null .toUpperCase(),
? (DateTime.parse(model color: model
.procedureList[ .procedureList[
0] 0]
.entityList[ .entityList[
index] index]
.orderDate) .orderType ==
.month) 0
: DateTime ? Color(
.now() 0xFFB9382C)
.month) : Colors
.toUpperCase(), .green),
color: AppText(
Colors.green, DateTime.parse(model
) .procedureList[
0]
.entityList[
index]
.orderDate)
.day
.toString(),
color: model
.procedureList[
0]
.entityList[
index]
.orderType ==
0
? Color(
0xFFB9382C)
: Colors
.green),
], ],
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
// height: MediaQuery.of(
// context)
// .size
// .height *
// 0.21,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -308,17 +328,17 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
13.0, 13.0,
), ),
Expanded( Expanded(
child: child: AppText(
AppText( model.procedureList[0].entityList[index].orderType ==
model.procedureList[0].entityList[index].orderType == 1
1 ? 'Routine'
? 'Routine' : 'Urgent',
: 'Urgent', fontSize:
fontSize: 13.5,
11.5, color: model.procedureList[0].entityList[index].orderType ==
color: Color( 0
0xFFB9382C), ? Color(0xFFB9382C)
), : Colors.green),
), ),
], ],
), ),

@ -91,7 +91,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
builder: builder:
(BuildContext context, ProcedureViewModel model, Widget child) => (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: widget.model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
minChildSize: 0.90, minChildSize: 0.90,
initialChildSize: 0.95, initialChildSize: 0.95,
@ -200,51 +200,51 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
isEntityListSelected(master), isEntityListSelected(master),
), ),
), ),
Container( // Container(
child: Row( // child: Row(
children: [ // children: [
AppText( // AppText(
TranslationBase.of(context).orderType), // TranslationBase.of(context).orderType),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
value: 0, // value: 0,
groupValue: selectedType, // groupValue: selectedType,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text(TranslationBase.of(context).urgent), // Text(TranslationBase.of(context).urgent),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
groupValue: selectedType, // groupValue: selectedType,
value: 1, // value: 1,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text('routine'), // Text('routine'),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 12.0, // height: 12.0,
), // ),
Container( // Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: // borderRadius:
BorderRadius.all(Radius.circular(6.0)), // BorderRadius.all(Radius.circular(6.0)),
border: Border.all( // border: Border.all(
width: 1.0, // width: 1.0,
color: HexColor("#CCCCCC"))), // color: HexColor("#CCCCCC"))),
child: TextFields( // child: TextFields(
hintText: widget.remarks, // hintText: widget.remarks,
fontSize: 15.0, // fontSize: 15.0,
controller: widget.remarksController, // controller: widget.remarksController,
maxLines: 3, // maxLines: 3,
minLines: 2, // minLines: 2,
onChanged: (value) {}, // onChanged: (value) {},
), // ),
), // ),
SizedBox( SizedBox(
height: 50.0, height: 50.0,
), ),
@ -310,12 +310,16 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
updateProcedureReqModel.lineItemNo = 1; updateProcedureReqModel.lineItemNo = 1;
updateProcedureReqModel.orderNo = orderNo; updateProcedureReqModel.orderNo = orderNo;
controls.add( entityList.forEach((element) {
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), controls.add(
); Controls(
controls.add( code: "remarks",
Controls(code: "ordertype", controlValue: "1"), controlValue: element.remarks.isNotEmpty ? element.remarks : ""),
); );
controls.add(
Controls(code: "ordertype", controlValue: '1'),
);
});
entityList.isNotEmpty entityList.isNotEmpty
? entityList.forEach((element) { ? entityList.forEach((element) {

@ -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/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.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_scaffold_widget.dart';
@ -122,7 +123,14 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
// color: Colors.green, //Colors.black, // color: Colors.green, //Colors.black,
onPressed: () => { onPressed: () => {
if (item.status != 1) if (item.status == 1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
else
{ {
openSickLeave(context, true, openSickLeave(context, true,
extendedData: item) extendedData: item)

@ -84,10 +84,10 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
onModelReady: (model2) => model2.preSickLeaveStatistics( onModelReady: (model2) => model2.preSickLeaveStatistics(
widget.appointmentNo, widget.patientMRN), widget.appointmentNo, widget.patientMRN),
builder: (_, model2, w) => GestureDetector( builder: (_, model2, w) => GestureDetector(
onTap: (){ onTap: () {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: AppScaffold( child: AppScaffold(
baseViewModel: model2, baseViewModel: model2,
isShowAppBar: false, isShowAppBar: false,
body: Center( body: Center(
@ -113,10 +113,12 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
borderColor: Colors.white, borderColor: Colors.white,
@ -144,14 +146,15 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(
BorderRadius.all(Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
// AppText( // AppText(
// TranslationBase.of(context).sickLeaveDate, // TranslationBase.of(context).sickLeaveDate,
@ -168,7 +171,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
textInputType: TextInputType.number, textInputType: TextInputType.number,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
_presentDatePicker('_selectedToDate'); _presentDatePicker(
'_selectedToDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
@ -184,8 +188,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 10, left: 10, right: 10), top: 10, left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(
BorderRadius.all(Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
@ -193,7 +197,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, bottom:
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
@ -209,55 +214,59 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline( child:
child: new IgnorePointer( DropdownButtonHideUnderline(
ignoring: true, child: new IgnorePointer(
child: DropdownButton( ignoring: true,
isExpanded: true, child: DropdownButton(
value: getClinicName( isExpanded: true,
model) ?? value: getClinicName(
"", model) ??
iconSize: 0, "",
elevation: 16, iconSize: 0,
selectedItemBuilder: elevation: 16,
(BuildContext selectedItemBuilder:
context) { (BuildContext
return model context) {
.getClinicNameList() return model
.map((item) { .getClinicNameList()
return Row( .map((item) {
mainAxisSize: return Row(
MainAxisSize mainAxisSize:
.max, MainAxisSize
children: <Widget>[ .max,
AppText( 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, item,
fontSize: SizeConfig textAlign:
.textMultiplier * TextAlign
2.1, .end,
color:
Colors.grey,
), ),
], );
); }).toList(),
}).toList(); ))),
},
onChanged: (newValue) =>
{},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value:
item.toString(),
child: Text(
item,
textAlign:
TextAlign.end,
),
);
}).toList(),
))),
), ),
], ],
) )
@ -285,7 +294,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -317,7 +327,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -364,7 +375,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
model2.sickleaveResponse[ model2.sickleaveResponse[
'ListSickLeavesToExtent'] 'ListSickLeavesToExtent']
['success']); ['success']);
Navigator.of(context).popUntil((route) { Navigator.of(context)
.popUntil((route) {
return route.settings.name == return route.settings.name ==
PATIENTS_PROFILE; PATIENTS_PROFILE;
}); });
@ -396,7 +408,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
), ),
), ),
), ),
))); )));
} }
void _validateInputs(model2) async { void _validateInputs(model2) async {
@ -413,7 +425,15 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
} else { } else {
addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.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) { } catch (err) {
print(err); print(err);

@ -389,7 +389,7 @@ class TranslationBase {
String get replay2 => localizedValues['replay2'][locale.languageCode]; 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]; String get logout => localizedValues['logout'][locale.languageCode];
@ -765,8 +765,7 @@ class TranslationBase {
String get postPlansEstimatedCost => String get postPlansEstimatedCost =>
localizedValues['postPlansEstimatedCost'][locale.languageCode]; localizedValues['postPlansEstimatedCost'][locale.languageCode];
String get postPlans => String get postPlans => localizedValues['postPlans'][locale.languageCode];
localizedValues['postPlans'][locale.languageCode];
String get ucaf => localizedValues['ucaf'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode];
@ -1085,28 +1084,43 @@ class TranslationBase {
localizedValues['clinicSearch'][locale.languageCode]; localizedValues['clinicSearch'][locale.languageCode];
String get doctorSearch => String get doctorSearch =>
localizedValues['doctorSearch'][locale.languageCode]; localizedValues['doctorSearch'][locale.languageCode];
String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; String get referralResponse =>
String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; localizedValues['referralResponse'][locale.languageCode];
String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; String get estimatedCost =>
String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; localizedValues['estimatedCost'][locale.languageCode];
String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][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 => String get patientName =>
localizedValues['patient-name'][locale.languageCode]; localizedValues['patient-name'][locale.languageCode];
String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; String get appointmentNumber =>
String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; localizedValues['appointmentNumber'][locale.languageCode];
String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; String get sickLeaveComments =>
String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; localizedValues['sickLeaveComments'][locale.languageCode];
String get complications => localizedValues['complications'][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 floor => localizedValues['floor'][locale.languageCode];
String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; String get roomCategory =>
String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; localizedValues['roomCategory'][locale.languageCode];
String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; String get otherDepartmentsInterventions =>
String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; 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 infoStatus => localizedValues['infoStatus'][locale.languageCode];
String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode];
String get sickleaveonhold =>
localizedValues['sickleaveonhold'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -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/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';
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/otp/sms-popup.dart'; import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.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/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -233,7 +235,8 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => { onTap: () => {
authenticateUser(3, true, authProv) authenticateUser(3,
true, authProv)
}, },
child: getButton( child: getButton(
user.logInTypeID, user.logInTypeID,
@ -483,9 +486,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return InkWell( return InkWell(
onTap: () => { onTap: () => {
if (checkIfBiometricAvailable(BiometricType.fingerprint)) if (checkIfBiometricAvailable(BiometricType.fingerprint))
{ {authenticateUser(3, true, authProv)}
authenticateUser(3, true, authProv)
}
}, },
child: RoundedContainer( child: RoundedContainer(
backgroundColor: backgroundColor:
@ -703,10 +704,23 @@ class _VerificationMethodsState extends State<VerificationMethods> {
loginWithFingurePrintFace(type, isActive, authProv) async { loginWithFingurePrintFace(type, isActive, authProv) async {
if (isActive) { if (isActive) {
// this.startBiometricLoginIfAvailable(); // this.startBiometricLoginIfAvailable();
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate', const iosStrings = const IOSAuthMessages(
useErrorDialogs: true, cancelButton: 'cancel',
stickyAuth: true); 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)) { if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) {
this.sendActivationCode(type, authProv); this.sendActivationCode(type, authProv);
// this.checkActivationCode(authProv); // this.checkActivationCode(authProv);

@ -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<charts.Series> 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<charts.Series<GaugeSegment, String>> _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<GaugeSegment, String>(
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);
}

@ -7,9 +7,8 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ProfileWelcomeWidget extends StatelessWidget { class ProfileWelcomeWidget extends StatelessWidget {
final Widget clinicWidget; final Widget clinicWidget;
final double height; final double height;
ProfileWelcomeWidget(this.clinicWidget, {this.height = 140}); ProfileWelcomeWidget(this.clinicWidget, {this.height = 140});
@ -43,7 +42,7 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).dr + TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}', ' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
@ -62,16 +61,12 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
CircleAvatar( CircleAvatar(
// radius: (52) // radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius:BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: Image.network( child: Image.network(
authProvider authProvider.doctorProfile.doctorImageURL,
.doctorProfile.doctorImageURL,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 70, width: 70,
height: 60, height: 60,
@ -79,7 +74,6 @@ final double height;
), ),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
) )
], ],
), ),
), ),

Loading…
Cancel
Save