Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into medical-file

 Conflicts:
	lib/screens/prescription/add_prescription_form.dart
merge-requests/240/head
hussam al-habibeh 5 years ago
commit ebc09db053

@ -42,6 +42,8 @@ class BaseAppClient {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
if (body['DoctorID'] == "")
body['DoctorID'] = null;
body['EditedBy'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile?.projectID;

@ -504,9 +504,36 @@ const Map<String, Map<String, String>> localizedValues = {
'itemExist': {'en': "This item already exist", 'ar': "هذا العنصر موجود"}, 'itemExist': {'en': "This item already exist", 'ar': "هذا العنصر موجود"},
'selectAllergy': {'en': "Select Allergy", 'ar': "أختر الحساسية"}, 'selectAllergy': {'en': "Select Allergy", 'ar': "أختر الحساسية"},
'selectSeverity': {'en': "Select Severity", 'ar': "أختر الدرجه"}, 'selectSeverity': {'en': "Select Severity", 'ar': "أختر الدرجه"},
'leaveCreated': {'en': "Leave has been created", 'ar': "تم إنشاء الإجازة"},
'medications': {'en': "Medications", 'ar': "الأدوية"}, 'medications': {'en': "Medications", 'ar': "الأدوية"},
'procedures': {'en': "Procedures", 'ar': "الإجراءات"}, 'procedures': {'en': "Procedures", 'ar': "الإجراءات"},
'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar':"لا توجد علامات حيوية لهذا المريض" }, 'vitalSignEmptyMsg': {
'referralEmptyMsg': {'en': "There is no referral data", 'ar':"لا توجد بيانات إحالة" }, 'en': "There is no vital signs for this patient",
'referralSuccessMsg': {'en': "You make referral successfully", 'ar':"You make referral successfully" }, 'ar': "لا توجد علامات حيوية لهذا المريض"
},
'referralEmptyMsg': {
'en': "There is no referral data",
'ar': "لا توجد بيانات إحالة"
},
'referralSuccessMsg': {
'en': "You make referral successfully",
'ar': "You make referral successfully"
},
'fromTime': {'en': "From Time", 'ar': "من وقت"},
'toTime': {'en': "To Time", 'ar': "الى وقت"},
'diagnoseType': {'en': "Diagnose Type", 'ar': "نوع التشخيص"},
'condition': {'en': "Condition", 'ar': "الحالة"},
'id': {'en': "ID", 'ar': "بطاقة هوية"},
'quantity': {'en': "Quantity", 'ar': "الكمية"},
'codeNo': {'en': "Code #", 'ar': "# الرمز"},
'covered': {'en': "Covered", 'ar': "مغطى"},
'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"},
'uncoveredByDoctor': {
'en': "Uncovered By Doctor",
'ar': "غير مغطى من قبل الدكتور"
},
'chiefComplaintEmptyMsg': {
'en': "There is no Chief Complaint",
'ar': "ليس هناك شكوى رئيس"
},
}; };

@ -1,5 +1,58 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class UcafService extends BaseService { class UcafService extends BaseService {
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
VitalSignData patientVitalSigns;
Future getPatientChiefComplaint(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
body['DoctorID'] = "";
await baseAppClient.post (GET_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPatientVitalSign(PatiantInformtion patient) async {
patientVitalSigns = null;
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) {
if(response['VitalSignsList'] != null){
if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error.toString();
},
body: body,
);
}
} }

@ -11,43 +11,8 @@ class VitalSignsService extends BaseService{
List<VitalSignResModel> patientVitalSignOrderdSubList = []; List<VitalSignResModel> patientVitalSignOrderdSubList = [];
VitalSignData patientVitalSigns; VitalSignData patientVitalSigns;
/*Future getPatientVitalSign(patient) async {
hasError = false;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignList = [];
response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignList.add(new VitalSignResModel.fromJson(v));
});
if (patientVitalSignList.length > 0) {
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
patientVitalSignOrderdSubListTemp = patientVitalSignList;
patientVitalSignOrderdSubListTemp
.sort((VitalSignResModel a, VitalSignResModel b) {
return b.vitalSignDate.microsecondsSinceEpoch -
a.vitalSignDate.microsecondsSinceEpoch;
});
patientVitalSignOrderdSubList.clear();
int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
} // Vit*/
Future getPatientVitalSign(PatiantInformtion patient) async { Future getPatientVitalSign(PatiantInformtion patient) async {
patientVitalSigns = null;
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
@ -59,7 +24,7 @@ class VitalSignsService extends BaseService{
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if(response['VitalSignsList'] != null){ if(response['VitalSignsList'] != null){
if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){ if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList']['0']); patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]);
} }
} }
}, },

@ -21,6 +21,9 @@ class SickLeaveService extends BaseService {
List<GetRescheduleLeavesResponse> get getAllRescheduleLeave => List<GetRescheduleLeavesResponse> get getAllRescheduleLeave =>
_getReScheduleLeave; _getReScheduleLeave;
List<GetRescheduleLeavesResponse> _getReScheduleLeave = []; List<GetRescheduleLeavesResponse> _getReScheduleLeave = [];
dynamic get postReschedule => _postReschedule;
dynamic _postReschedule;
Future getStatistics(appoNo, patientMRN) async { Future getStatistics(appoNo, patientMRN) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -171,15 +174,17 @@ class SickLeaveService extends BaseService {
); );
} }
addReschedule(request) async { Future addReschedule(request) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
ADD_RESCHDEULE, ADD_RESCHDEULE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
Future.value(response); // return Future.value(response);
_postReschedule = response;
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
_postReschedule = null;
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
@ -193,9 +198,11 @@ class SickLeaveService extends BaseService {
await baseAppClient.post( await baseAppClient.post(
UPDATE_RESCHDEULE, UPDATE_RESCHDEULE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
Future.value(response); _postReschedule = response;
// return Future.value(response);
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
_postReschedule = null;
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },

@ -1,9 +1,30 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import '../../locator.dart'; import '../../locator.dart';
class UcafViewModel extends BaseViewModel { class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>(); UcafService _ucafService = locator<UcafService>();
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns;
Future getUCAFData(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _ucafService.getPatientVitalSign(patient);
await _ucafService.getPatientChiefComplaint(patient);
if (_ucafService.hasError) {
error = _ucafService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
} }

@ -95,7 +95,7 @@ class VitalSignsViewModel extends BaseViewModel {
); );
} }
String getBMI(double bodyMassIndex) { String getBMI(var bodyMassIndex) {
if (bodyMassIndex <= 18.5) { if (bodyMassIndex <= 18.5) {
return "Underweight"; return "Underweight";
} else if (bodyMassIndex <= 25.0) { } else if (bodyMassIndex <= 25.0) {

@ -16,6 +16,7 @@ class SickLeaveViewModel extends BaseViewModel {
List get allReasons => _sickLeaveService.getReasons; List get allReasons => _sickLeaveService.getReasons;
List get coveringDoctors => _sickLeaveService.coveringDoctorsList; List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave;
get postSechedule => _sickLeaveService.postReschedule;
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.addSickLeave(addSickLeaveRequest); await _sickLeaveService.addSickLeave(addSickLeaveRequest);
@ -99,6 +100,7 @@ class SickLeaveViewModel extends BaseViewModel {
Future addReschedule(request) async { Future addReschedule(request) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.addReschedule(request); await _sickLeaveService.addReschedule(request);
if (_sickLeaveService.hasError) { if (_sickLeaveService.hasError) {
error = _sickLeaveService.error; error = _sickLeaveService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -4,9 +4,10 @@ class MySelectedAllergy {
MasterKeyModel selectedAllergySeverity; MasterKeyModel selectedAllergySeverity;
MasterKeyModel selectedAllergy; MasterKeyModel selectedAllergy;
String remark; String remark;
bool isChecked;
MySelectedAllergy( MySelectedAllergy(
{this.selectedAllergySeverity, this.selectedAllergy, this.remark}); {this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked});
MySelectedAllergy.fromJson(Map<String, dynamic> json) { MySelectedAllergy.fromJson(Map<String, dynamic> json) {
selectedAllergySeverity = json['selectedAllergySeverity'] != null selectedAllergySeverity = json['selectedAllergySeverity'] != null
@ -16,6 +17,7 @@ class MySelectedAllergy {
? new MasterKeyModel.fromJson(json['selectedAllergy']) ? new MasterKeyModel.fromJson(json['selectedAllergy'])
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isChecked'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -27,6 +29,7 @@ class MySelectedAllergy {
data['selectedAllergy'] = this.selectedAllergy.toJson(); data['selectedAllergy'] = this.selectedAllergy.toJson();
} }
data['remark'] = this.remark; data['remark'] = this.remark;
data['isChecked'] = this.remark;
return data; return data;
} }
} }

@ -5,7 +5,7 @@ class VitalSignData {
int bloodPressureHigher; int bloodPressureHigher;
int bloodPressureLower; int bloodPressureLower;
int bloodPressurePatientPosition; int bloodPressurePatientPosition;
double bodyMassIndex; var bodyMassIndex;
int fio2; int fio2;
int headCircumCm; int headCircumCm;
int heightCm; int heightCm;

@ -124,11 +124,13 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
'Doctor : '.toUpperCase(), 'Doctor : '.toUpperCase(),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
AppText( Expanded(
child: AppText(
model.medicalFileList[0].entityList[0] model.medicalFileList[0].entityList[0]
.timelines[index].doctorName, .timelines[index].doctorName,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
], ],
), ),
Row( Row(

@ -466,13 +466,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
height: height:
10.0, 10.0,
), ),
Padding(
padding: EdgeInsets.symmetric(
vertical:
5.5,
horizontal:
22.5),
child:
AppText( AppText(
item.firstName + item.firstName +
" " + " " +
@ -484,7 +477,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
backGroundcolor: backGroundcolor:
Colors.white, Colors.white,
), ),
),
], ],
), ),
Row( Row(

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -5,6 +6,7 @@ import 'package:doctor_app_flutter/util/helpers.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/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -14,7 +16,6 @@ class UcafDetailScreen extends StatefulWidget {
} }
class _UcafDetailScreenState extends State<UcafDetailScreen> { class _UcafDetailScreenState extends State<UcafDetailScreen> {
int _activeTap = 0; int _activeTap = 0;
@override @override
@ -45,7 +46,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
SizedBox( SizedBox(
height: 16, height: 16,
), ),
getSelectedTreatmentStepItem(context), ...getSelectedTreatmentStepItem(context),
], ],
), ),
), ),
@ -64,8 +65,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
]; ];
return Container( return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: decoration: Helpers.containerBorderDecoration(
Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -105,8 +106,296 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
); );
} }
Widget getSelectedTreatmentStepItem(BuildContext _context) { List<Widget> getSelectedTreatmentStepItem(BuildContext _context) {
return Container(); switch (_activeTap) {
case 0:
return [...List.generate(2, (index) => DiagnosisWidget()).toList()];
case 1:
return [...List.generate(2, (index) => MedicationWidget()).toList()];
case 2:
return [...List.generate(2, (index) => ProceduresWidget()).toList()];
default:
return [
Container(),
];
}
}
}
class DiagnosisWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).diagnoseType}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"Preliminary Diagnosis",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
"B34.2 | CORONA VIRUS INFECTION, UNSPECIFIED SITE",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).condition}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"174.00 Same",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
],
);
}
} }
class MedicationWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).id}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"6",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
width: 16,
),
AppText(
"${TranslationBase.of(context).price}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"35.6",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
width: 16,
),
AppText(
"${TranslationBase.of(context).quantity}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"3",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
"EVE SKIN CREAM WITH HONEY -170GM",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
"Every other day for 5 days",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
],
);
}
}
class ProceduresWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).codeNo}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"019054846",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
AppText(
"${TranslationBase.of(context).quantity}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"1",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Expanded(
child: AppText(
"SCAN - RENAL MASS PROTOCOL",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).covered}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"Yes",
fontWeight: FontWeight.normal,
color: Colors.green,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
width: 16,
),
AppText(
"${TranslationBase.of(context).approvalRequired}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"Yes",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).uncoveredByDoctor}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"Yes",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 16,
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 16,
),
],
);
}
} }

@ -14,6 +14,7 @@ import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
import '../../../QR_reader_screen.dart';
class UCAFInputScreen extends StatefulWidget { class UCAFInputScreen extends StatefulWidget {
@override @override
@ -55,15 +56,20 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>( return BaseView<UcafViewModel>(
onModelReady: (model) => model.getUCAFData(patient),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).ucaf, appBarTitle: TranslationBase.of(context).ucaf,
body: SingleChildScrollView( body: model.patientVitalSigns != null &&
model.patientChiefComplaintList != null &&
model.patientChiefComplaintList.length > 0
? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
PatientHeaderWidgetNoAvatar(patient), PatientHeaderWidgetNoAvatar(patient),
Container( Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -101,7 +107,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).durationOfIllness, TranslationBase.of(context)
.durationOfIllness,
null, null,
false), false),
enabled: true, enabled: true,
@ -130,7 +137,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
width: 8, width: 8,
), ),
AppText( AppText(
"120/80", "${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -149,7 +156,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
width: 8, width: 8,
), ),
AppText( AppText(
"37.5(C), 98.6(F)", "${model.patientVitalSigns.temperatureCelcius}(C), ${model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32}(F)",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -176,7 +183,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
width: 8, width: 8,
), ),
AppText( AppText(
"80", "${model.patientVitalSigns.pulseBeatPerMinute}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -189,7 +196,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).chiefComplaintsAndSymptoms, TranslationBase.of(context)
.chiefComplaintsAndSymptoms,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
), ),
@ -208,14 +216,17 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Container( Container(
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).additionalTextComplaints, TranslationBase.of(context)
null, .additionalTextComplaints,
helpers.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint),
false), false),
enabled: true, enabled: false,
controller: _additionalComplaintsController, controller: _additionalComplaintsController,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
minLines: 4, /*minLines: 4,
maxLines: 6, maxLines: 6,*/
)), )),
SizedBox( SizedBox(
height: 16, height: 16,
@ -236,10 +247,12 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
value: conditionsData[index]['isChecked'], value: conditionsData[index]['isChecked'],
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
conditionsData[index]['isChecked'] = newValue; conditionsData[index]['isChecked'] =
newValue;
}); });
}, },
controlAffinity: ListTileControlAffinity.leading, controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.all(0),
)), )),
SizedBox( SizedBox(
@ -279,7 +292,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).when, TranslationBase.of(context).when,
null, null,
false), false),
@ -295,7 +309,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).where, TranslationBase.of(context).where,
null, null,
false), false),
@ -312,7 +327,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Container( Container(
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).specifyPossibleLineManagement, TranslationBase.of(context)
.specifyPossibleLineManagement,
null, null,
false), false),
enabled: true, enabled: true,
@ -325,8 +341,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).significantSigns,
.significantSigns,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -342,8 +357,6 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
enabled: true, enabled: true,
controller: _signsController, controller: _signsController,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)), )),
SizedBox( SizedBox(
height: 16, height: 16,
@ -352,7 +365,9 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
onPressed: () { onPressed: () {
Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {'patient': patient}); Navigator.of(context).pushNamed(
PATIENT_UCAF_DETAIL,
arguments: {'patient': patient});
}, },
), ),
], ],
@ -360,6 +375,18 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
], ],
), ),
)
: Container(
child: Center(
child: AppText(
model.patientVitalSigns == null
? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
),
), ),
), ),
); );

@ -415,44 +415,58 @@ class _TemperatureWidgetState extends State<TemperatureWidget> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).temperature} (C):", "${TranslationBase.of(context).temperature} (C):",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.temperatureCelcius}", "${widget.vitalSign.temperatureCelcius}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
Row( ),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).temperature} (F):", "${TranslationBase.of(context).temperature} (F):",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}", "${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
),
], ],
), ),
SizedBox( SizedBox(
@ -534,45 +548,60 @@ class _PulseWidgetState extends State<PulseWidget> {
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).pulseBeats}", "${TranslationBase.of(context).pulseBeats}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.pulseBeatPerMinute}", "${widget.vitalSign.pulseBeatPerMinute}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
Row( ),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).rhythm}", "${TranslationBase.of(context).rhythm}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.pulseRhythm}", "${widget.vitalSign.pulseRhythm}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
),
], ],
), ),
], ],
@ -628,44 +657,58 @@ class _RespirationWidgetState extends State<RespirationWidget> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).respBeats}", "${TranslationBase.of(context).respBeats}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.respirationBeatPerMinute}", "${widget.vitalSign.respirationBeatPerMinute}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
Row( ),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).patternOfRespiration}", "${TranslationBase.of(context).patternOfRespiration}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.respirationPattern}", "${widget.vitalSign.respirationPattern}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
),
], ],
), ),
], ],
@ -721,44 +764,58 @@ class _BloodPressureWidgetState extends State<BloodPressureWidget> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).bloodPressureDiastoleAndSystole}", "${TranslationBase.of(context).bloodPressureDiastoleAndSystole}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}", "${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
Row( ),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).cuffLocation}", "${TranslationBase.of(context).cuffLocation}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.bloodPressureCuffLocation}", "${widget.vitalSign.bloodPressureCuffLocation}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
),
], ],
), ),
SizedBox( SizedBox(
@ -766,27 +823,36 @@ class _BloodPressureWidgetState extends State<BloodPressureWidget> {
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Expanded(
child: AppText(
"${TranslationBase.of(context).patientPosition}", "${TranslationBase.of(context).patientPosition}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
child: AppText(
"${widget.vitalSign.bloodPressurePatientPosition}", "${widget.vitalSign.bloodPressurePatientPosition}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
Row( ),
Expanded(
child: Row(
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).cuffSize}", "${TranslationBase.of(context).cuffSize}",
@ -805,6 +871,7 @@ class _BloodPressureWidgetState extends State<BloodPressureWidget> {
), ),
], ],
), ),
),
], ],
), ),
], ],
@ -953,7 +1020,8 @@ class _PainScaleWidgetState extends State<PainScaleWidget> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Expanded(
child: Row(
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).painScale}", "${TranslationBase.of(context).painScale}",
@ -972,7 +1040,9 @@ class _PainScaleWidgetState extends State<PainScaleWidget> {
), ),
], ],
), ),
Row( ),
Expanded(
child: Row(
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).painManagement}", "${TranslationBase.of(context).painManagement}",
@ -991,6 +1061,7 @@ class _PainScaleWidgetState extends State<PainScaleWidget> {
), ),
], ],
), ),
),
], ],
), ),
], ],

@ -696,11 +696,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
selectDate(BuildContext context, PrescriptionViewModel model) async { selectDate(BuildContext context, PrescriptionViewModel model) async {
DateTime selectedDate; DateTime selectedDate;
selectedDate = DateTime.now().add(Duration(hours: 1)); selectedDate = DateTime.now().add(Duration(hours: 15));
final DateTime picked = await showDatePicker( final DateTime picked = await showDatePicker(
context: context, context: context,
initialDate: selectedDate, initialDate: selectedDate,
firstDate: DateTime.now().add(Duration(hours: 5)), firstDate: DateTime.now().add(Duration(hours: 15)),
lastDate: DateTime(2040), lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar, initialEntryMode: DatePickerEntryMode.calendar,
); );

@ -45,23 +45,49 @@ class AddRescheduleLeavScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( InkWell(
hintText: child: Row(
TranslationBase.of(context).requestLeave, children: [
borderColor: Colors.white, Expanded(
prefix: IconButton( flex: 4,
child: AppText(
TranslationBase.of(context)
.requestLeave),
),
IconButton(
icon: Icon( icon: Icon(
Icons.add_circle, Icons.add_circle,
color: Colors.red, color: Colors.red,
)), ))
textInputType: TextInputType.text, ],
)
// AppTextFormField(
// hintText:
// TranslationBase.of(context).requestLeave,
// borderColor: Colors.white,
// prefix: IconButton(
// icon: Icon(
// Icons.add_circle,
// color: Colors.red,
// )),
// // textInputType: TextInputType.text,
// readOnly: true,
// onTap: () {
// openLeave(
// context,
// false,
// );
// return false;
// },
// inputFormatter: ONLY_LETTERS,
// )
,
onTap: () { onTap: () {
openLeave( openLeave(
context, context,
false, false,
); );
}, },
inputFormatter: ONLY_LETTERS,
) )
], ],
), ),
@ -158,7 +184,7 @@ class AddRescheduleLeavScreen extends StatelessWidget {
AppText(getDoctor( AppText(getDoctor(
model model
.coveringDoctors, .coveringDoctors,
item.doctorId)) item.coveringDoctorId))
]) ])
: SizedBox(), : SizedBox(),
AppText( AppText(
@ -272,8 +298,8 @@ class AddRescheduleLeavScreen extends StatelessWidget {
getDoctor(model, doctorId) { getDoctor(model, doctorId) {
var obj; var obj;
obj = model.where((i) => i['doctorID'] == doctorId).toList(); obj = model.where((i) => i['doctorID'].toString() == doctorId).toList();
print(obj); //print(obj);
return obj.length > 0 ? obj[0]['doctorName'] : ""; return obj.length > 0 ? obj[0]['doctorName'] : "";
} }
@ -281,7 +307,7 @@ class AddRescheduleLeavScreen extends StatelessWidget {
getReasons(model, reasonID) { getReasons(model, reasonID) {
var obj; var obj;
obj = model.where((i) => i['id'] == reasonID).toList(); obj = model.where((i) => i['id'] == reasonID).toList();
print(obj); //print(obj);
return obj.length > 0 return obj.length > 0
? projectsProvider.isArabic == true ? projectsProvider.isArabic == true

@ -6,8 +6,10 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/routes.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/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/text_validator.dart'; import 'package:doctor_app_flutter/util/text_validator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -23,6 +25,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.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:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
Helpers helpers = Helpers(); Helpers helpers = Helpers();
@ -39,21 +42,32 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController = new TextEditingController();
TextEditingController _toDateController2 = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController();
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
SickLeaveViewModel sickLeaveViewModel;
String _selectedClinic; String _selectedClinic;
Map profile = {}; Map profile = {};
var offTime = '2'; var offTime = '1';
var date; var date;
var doctorID; var doctorID;
var reason; var reason;
var fromDate; var fromDate;
var toDate; var toDate;
var clinicID; var clinicID;
var fromTime;
var toTime;
TextEditingController _controller4; TextEditingController _controller4;
TextEditingController _controller5;
void _presentDatePicker(id) { void _presentDatePicker(id) {
var date = new DateTime.now();
var initialDate = id == 'fromDate'
? new DateTime(date.year, date.month, date.day + 15)
: new DateTime(fromDate.year, fromDate.month, fromDate.day);
var firstDate = id == 'fromDate'
? new DateTime(date.year, date.month, date.day + 15)
: new DateTime(fromDate.year, fromDate.month, fromDate.day);
showDatePicker( showDatePicker(
context: context, context: context,
initialDate: DateTime.now(), initialDate: initialDate,
firstDate: DateTime.now(), firstDate: firstDate,
lastDate: DateTime(2050), lastDate: DateTime(2050),
).then((pickedDate) { ).then((pickedDate) {
if (pickedDate == null) { if (pickedDate == null) {
@ -69,6 +83,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
_toDateController2.text = df.format(pickedDate); _toDateController2.text = df.format(pickedDate);
} }
}); });
setState(() {
final df = new DateFormat('yyyy-MM-dd');
fromDate = pickedDate; //df.format();
_toDateController.text = df.format(pickedDate);
toDate = pickedDate;
});
}); });
} }
@ -82,6 +103,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
@ -130,10 +152,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: DropdownButton( child: DropdownButton(
focusColor: Colors.grey, focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
dropdownColor:
Colors.grey,
value: getClinicName( value: getClinicName(
model) ?? model) ??
"", "",
iconSize: 40, iconSize: 0,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext (BuildContext
@ -151,8 +175,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
2.1, 2.1,
color: color: Colors
Colors.grey, .grey[500],
), ),
], ],
); );
@ -234,7 +258,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: child:
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: DropdownButton( child: DropdownButton(
focusColor: Colors.grey, // focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: offTime == null value: offTime == null
? model2.allOffTime[0] ? model2.allOffTime[0]
@ -256,8 +280,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
2.1, 2.1,
color: // color:
Colors.grey, // Colors.grey,
), ),
], ],
); );
@ -313,13 +337,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: TranslationBase.of( hintText:
context) TranslationBase.of(context)
.fromDate, .fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon(Icons icon: Icon(
.calendar_today)), Icons.calendar_today)),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
controller: _toDateController, controller: _toDateController,
@ -328,9 +352,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
'fromDate'); 'fromDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (val) =>
fromDate = value; fromDate = val,
}), onSaved: (val) =>
fromDate = val,
)
], ],
)), )),
Row( Row(
@ -351,32 +377,24 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
// new AppTextFormField(
// readOnly: true,
// hintText: "",
// borderColor: Colors.white,
// onSaved: (value) {},
// inputFormatter: ONLY_NUMBERS),
DateTimePicker( DateTimePicker(
timeHintText:
TranslationBase.of(
context)
.fromTime,
type: type:
DateTimePickerType.time, DateTimePickerType.time,
controller: _controller4, controller: _controller4,
//initialValue: _initialValue, onChanged: (val) =>
// icon: Icon(Icons.access_time), fromTime = val,
//use24HourFormat: false,
//locale: Locale('en', 'US'),
onChanged: (val) => () {
print(val);
},
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
// () => _valueToValidate4 = val); // () => _valueToValidate4 = val);
return null; return null;
}, },
onSaved: (val) => {}, onSaved: (val) =>
fromTime = val,
) )
], ],
), ),
@ -399,17 +417,15 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( DateTimePicker(
timeHintText:
TranslationBase.of(
context)
.toTime,
type: type:
DateTimePickerType.time, DateTimePickerType.time,
controller: _controller4, controller: _controller5,
//initialValue: _initialValue, onChanged: (val) =>
// icon: Icon(Icons.access_time), toTime = val,
//use24HourFormat: false,
//locale: Locale('en', 'US'),
onChanged: (val) => () {
print(val);
},
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
@ -417,7 +433,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
return null; return null;
}, },
onSaved: (val) => onSaved: (val) =>
{print(val)}, toTime = val,
) )
], ],
), ),
@ -481,7 +497,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
AppTextFormField( AppTextFormField(
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.fromDate, .toDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon( icon: Icon(
@ -560,8 +576,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
2.1, 2.1,
color: // color:
Colors.grey, // Colors.grey,
), ),
], ],
); );
@ -654,8 +670,6 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
2.1, 2.1,
color:
Colors.grey,
), ),
], ],
); );
@ -731,9 +745,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
getProfile() async { getProfile() async {
Map p = await sharedPref.getObj(DOCTOR_PROFILE); Map p = await sharedPref.getObj(DOCTOR_PROFILE);
setState(() { setState(() {
if (widget.updateData != null) {
this.profile = p; this.profile = p;
if (widget.updateData != null) {
this.clinicID = widget.updateData.clinicId; this.clinicID = widget.updateData.clinicId;
_toDateController.text = widget.updateData.dateTimeFrom; _toDateController.text = widget.updateData.dateTimeFrom;
@ -749,16 +764,34 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
} }
addRecheduleLeave(model) { addRecheduleLeave(model) async {
final df = new DateFormat('yyyy-MM-ddThh:mm:ss'); final df = new DateFormat('yyyy-MM-ddTHH:MM:ss');
final dateFormat = new DateFormat('yyyy-MM-dd');
var fromDates = fromDate;
var toDates = toDate;
if (offTime == '1') {
fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
'T' +
fromTime +
':' +
DateTime.now().second.toString()));
toDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
'T' +
toTime +
':' +
DateTime.now().second.toString()));
} else {
fromDate = df.format(fromDates);
toDate = df.format(toDates);
}
Map<String, dynamic> request = { Map<String, dynamic> request = {
"Requisition": { "Requisition": {
"requisitionNo": 0, "requisitionNo": 0,
"requisitionType": offTime, "requisitionType": offTime,
"clinicId": this.profile['ClinicID'], "clinicId": this.profile['ClinicID'],
"doctorId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'],
"dateTimeFrom": df.format(fromDate), "dateTimeFrom": fromDate,
"dateTimeTo": df.format(toDate), "dateTimeTo": toDate,
"date": df.format(DateTime.now()), "date": df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId":
@ -769,8 +802,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"weekDayId": 1, "weekDayId": 1,
"shiftId": 1, "shiftId": 1,
"isOpen": true, "isOpen": true,
"timeFrom": null, "timeFrom": "",
"timeTo": null, "timeTo": "",
"timeFromstr": "", "timeFromstr": "",
"timeTostr": "" "timeTostr": ""
} }
@ -778,21 +811,41 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} }
}; };
model.addReschedule(request).then((response) { await model.addReschedule(request).then((value) {
print(response); if (model.postSechedule != null) {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated);
Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(),
// MyReferredPatient(),
),
);
}
}); });
} }
updateRecheduleLeave(model) { updateRecheduleLeave(model) {
final df = new DateFormat('yyyy-MM-ddThh:mm:ss'); final df = new DateFormat('yyyy-MM-ddThh:mm:ss');
final dateFormat = new DateFormat('yyyy-MM-dd');
if (offTime == '1') {
fromDate = dateFormat.format(fromDate) + 'T' + fromTime + '00';
toDate = dateFormat.format(fromDate) + 'T' + toTime + '00';
} else {
fromDate = df.format(fromDate);
toDate = df.format(toDate);
}
Map<String, dynamic> request = { Map<String, dynamic> request = {
"Requisition": { "Requisition": {
"requisitionNo": 0, "requisitionNo": 0,
"requisitionType": offTime, "requisitionType": offTime,
"clinicId": this.profile['ClinicID'], "clinicId": this.profile['ClinicID'],
"doctorId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'],
"dateTimeFrom": df.format(fromDate), "dateTimeFrom": fromDate,
"dateTimeTo": df.format(toDate), "dateTimeTo": toDate,
"date": df.format(DateTime.now()), "date": df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId":
@ -803,8 +856,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"weekDayId": 1, "weekDayId": 1,
"shiftId": 1, "shiftId": 1,
"isOpen": true, "isOpen": true,
"timeFrom": null, "timeFrom": fromTime,
"timeTo": null, "timeTo": toTime,
"timeFromstr": "", "timeFromstr": "",
"timeTostr": "" "timeTostr": ""
} }
@ -813,7 +866,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
}; };
model.updateReschedule(request).then((response) { model.updateReschedule(request).then((response) {
print(response); if (model.postSechedule != null) {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated);
Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(),
// MyReferredPatient(),
),
);
}
}); });
} }
} }

@ -203,7 +203,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
value: getClinicName( value: getClinicName(
model) ?? model) ??
"", "",
iconSize: 40, iconSize: 0,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext (BuildContext
@ -221,6 +221,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
2.1, 2.1,
color:
Colors.grey,
), ),
], ],
); );
@ -310,18 +312,19 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
// TranslationBase.of(context).remarks, // TranslationBase.of(context).remarks,
// fontSize: 10, // fontSize: 10,
// ), // ),
AppTextFormField( TextField(
borderColor: Colors.white, maxLines: 3,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(20.0),
border: InputBorder.none,
hintText: widget.extendedData != null hintText: widget.extendedData != null
? widget.extendedData.remarks ? widget.extendedData.remarks
: TranslationBase.of(context).remarks, : TranslationBase.of(context)
.remarks),
onChanged: (value) { onChanged: (value) {
addSickLeave.remarks = value; addSickLeave.remarks = value;
}, },
validator: (value) { )
// return TextValidator().validateName(value);
},
inputFormatter: ONLY_LETTERS)
], ],
), ),
), ),

@ -289,6 +289,10 @@ class TranslationBase {
String get toDate => localizedValues['toDate'][locale.languageCode]; String get toDate => localizedValues['toDate'][locale.languageCode];
String get fromTime => localizedValues['fromTime'][locale.languageCode];
String get toTime => localizedValues['toTime'][locale.languageCode];
String get searchPatientImageCaptionTitle => String get searchPatientImageCaptionTitle =>
localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; localizedValues['searchPatientImageCaptionTitle'][locale.languageCode];
@ -532,9 +536,23 @@ class TranslationBase {
localizedValues['selectAllergy'][locale.languageCode]; localizedValues['selectAllergy'][locale.languageCode];
String get selectSeverity => String get selectSeverity =>
localizedValues['selectSeverity'][locale.languageCode]; localizedValues['selectSeverity'][locale.languageCode];
String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; String get leaveCreated =>
String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; localizedValues['leaveCreated'][locale.languageCode];
String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; String get vitalSignEmptyMsg =>
localizedValues['vitalSignEmptyMsg'][locale.languageCode];
String get referralEmptyMsg =>
localizedValues['referralEmptyMsg'][locale.languageCode];
String get referralSuccessMsg =>
localizedValues['referralSuccessMsg'][locale.languageCode];
String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode];
String get condition => localizedValues['condition'][locale.languageCode];
String get id => localizedValues['id'][locale.languageCode];
String get quantity => localizedValues['quantity'][locale.languageCode];
String get codeNo => localizedValues['codeNo'][locale.languageCode];
String get covered => localizedValues['covered'][locale.languageCode];
String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode];
String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode];
String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -94,7 +94,7 @@ class PatientProfileWidget extends StatelessWidget {
color: Color(0xffCCCCCC), color: Color(0xffCCCCCC),
), ),
Container( Container(
height: 10 * SizeConfig.textMultiplier, height: 11 * SizeConfig.textMultiplier,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -232,7 +232,8 @@ class PatientProfileWidget extends StatelessWidget {
SizeConfig.textMultiplier, SizeConfig.textMultiplier,
), ),
), ),
AppText( Expanded(
child: AppText(
patient.admissionDate != null patient.admissionDate != null
? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}"
: "", : "",
@ -241,6 +242,7 @@ class PatientProfileWidget extends StatelessWidget {
fontSize: fontSize:
1.6 * SizeConfig.textMultiplier, 1.6 * SizeConfig.textMultiplier,
), ),
),
], ],
), ),
SizedBox( SizedBox(
@ -374,7 +376,8 @@ class PatientProfileWidget extends StatelessWidget {
SizedBox( SizedBox(
width: 4, width: 4,
), ),
AppText( Expanded(
child: AppText(
"${patient.nursingStationName}\n${patient.roomId}", "${patient.nursingStationName}\n${patient.roomId}",
fontWeight: fontWeight:
FontWeight.normal, FontWeight.normal,
@ -382,6 +385,7 @@ class PatientProfileWidget extends StatelessWidget {
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
), ),
),
], ],
), ),
), ),

@ -34,7 +34,7 @@ class StepsWidget extends StatelessWidget {
top: index == 0 ? 15 : 30, top: index == 0 ? 15 : 30,
left: 0, left: 0,
child: InkWell( child: InkWell(
//onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -84,7 +84,7 @@ class StepsWidget extends StatelessWidget {
top: index == 1 ? 15 : 30, top: index == 1 ? 15 : 30,
left: MediaQuery.of(context).size.width * 0.28, left: MediaQuery.of(context).size.width * 0.28,
child: InkWell( child: InkWell(
//onTap: () => index >= 1 ? changeCurrentTab(1) : null, onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -187,7 +187,7 @@ class StepsWidget extends StatelessWidget {
top: index == 3 ? 15 : 30, top: index == 3 ? 15 : 30,
right: 0, right: 0,
child: InkWell( child: InkWell(
//onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -257,7 +257,7 @@ class StepsWidget extends StatelessWidget {
top: index == 0 ? 15 : 30, top: index == 0 ? 15 : 30,
right: 0, right: 0,
child: InkWell( child: InkWell(
//onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -307,7 +307,7 @@ class StepsWidget extends StatelessWidget {
top: index == 1 ? 15 : 30, top: index == 1 ? 15 : 30,
right: MediaQuery.of(context).size.width * 0.28, right: MediaQuery.of(context).size.width * 0.28,
child: InkWell( child: InkWell(
//onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -357,7 +357,7 @@ class StepsWidget extends StatelessWidget {
top: index == 2 ? 15 : 30, top: index == 2 ? 15 : 30,
right: MediaQuery.of(context).size.width * 0.52, right: MediaQuery.of(context).size.width * 0.52,
child: InkWell( child: InkWell(
//onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -411,7 +411,7 @@ class StepsWidget extends StatelessWidget {
top: index == 3 ? 15 : 30, top: index == 3 ? 15 : 30,
left: 0, left: 0,
child: InkWell( child: InkWell(
//onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -28,6 +28,7 @@ class UpdateAllergiesWidget extends StatefulWidget {
} }
class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> { class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
@override @override
@ -52,7 +53,9 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
// controller: messageController, // controller: messageController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase.of(context).emptyMessage; return TranslationBase
.of(context)
.emptyMessage;
else else
return null; return null;
}), }),
@ -61,22 +64,31 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
height: 20, height: 20,
), ),
Container( Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 15), margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column( child: Column(
children: widget.myAllergiesList.map((selectedAllergy) { children: widget.myAllergiesList.map((selectedAllergy) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,children: [ mainAxisAlignment: MainAxisAlignment.start,
children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
child: Expanded( child: Expanded(
child: Texts(projectViewModel.isArabic ? selectedAllergy child: Texts(
.selectedAllergy.nameAr : selectedAllergy projectViewModel.isArabic
.selectedAllergy.nameEn.toUpperCase(), ? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
variant: "bodyText", variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true, bold: true,
color: Colors.black), color: Colors.black),
), ),
@ -88,8 +100,12 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
.selectedAllergySeverity.nameEn .selectedAllergySeverity.nameEn
.toUpperCase(), .toUpperCase(),
variant: "bodyText", variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true, bold: true,
color: AppGlobal.appPrimaryColor), color: AppGlobal.appPrimaryColor),
if(selectedAllergy.isChecked)
InkWell( InkWell(
child: Icon( child: Icon(
FontAwesomeIcons.trash, FontAwesomeIcons.trash,
@ -112,15 +128,24 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
} }
removeAllergy(MySelectedAllergy mySelectedAllergy) { removeAllergy(MySelectedAllergy mySelectedAllergy) {
Iterable<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
widget.myAllergiesList.where((element) => mySelectedAllergy == element); // ignore: missing_return
widget.myAllergiesList.where((element) =>
mySelectedAllergy.selectedAllergySeverity.id ==
element.selectedAllergySeverity.id &&
mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id
).toList();
if (allergy.length > 0) if (allergy.length > 0) {
setState(() { setState(() {
widget.myAllergiesList.remove(allergy.first); allergy[0].isChecked = false;
}); });
} }
print(allergy);
}
openAllergiesList(BuildContext context) { openAllergiesList(BuildContext context) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -130,14 +155,29 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
return AddAllergies( return AddAllergies(
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
setState(() { setState(() {
if (!widget.myAllergiesList.contains(mySelectedAllergy)) { List<MySelectedAllergy> allergy =
// ignore: missing_return
widget.myAllergiesList.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id
).toList();
if (allergy.isEmpty) {
widget.myAllergiesList.add(mySelectedAllergy); widget.myAllergiesList.add(mySelectedAllergy);
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
helpers.showErrorToast(TranslationBase allergy.first.selectedAllergy =
.of(context) mySelectedAllergy.selectedAllergy;
.itemExist); allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
} }
}); });
},); },);
}); });
@ -162,9 +202,9 @@ class _AddAllergiesState extends State<AddAllergies> {
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown, InputDecoration textFieldSelectorDecoration(String hintText,
{IconData icon}) { String selectedText, bool isDropDown,{IconData icon}) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -204,7 +244,8 @@ class _AddAllergiesState extends State<AddAllergies> {
await model.getMasterLookup(MasterKeysService.AllergySeverity); await model.getMasterLookup(MasterKeysService.AllergySeverity);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) =>
AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
@ -214,6 +255,7 @@ class _AddAllergiesState extends State<AddAllergies> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 16, height: 16,
), ),
@ -237,17 +279,14 @@ class _AddAllergiesState extends State<AddAllergies> {
}); });
} }
: null, : null,
child: _selectedAllergy == null child: _selectedAllergy==null? AutoCompleteTextField<MasterKeyModel>(
? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase TranslationBase
.of(context) .of(context)
.selectAllergy, .selectAllergy,
_selectedAllergy != null _selectedAllergy != null
? _selectedAllergy.nameEn ? _selectedAllergy.nameEn
: null, : null, true, icon: EvaIcons.search),
true,
icon: EvaIcons.search),
itemSubmitted: (item) => itemSubmitted: (item) =>
setState(() => _selectedAllergy = item), setState(() => _selectedAllergy = item),
key: key, key: key,
@ -255,29 +294,23 @@ class _AddAllergiesState extends State<AddAllergies> {
itemBuilder: (context, suggestion) => itemBuilder: (context, suggestion) =>
new Padding( new Padding(
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? suggestion
? suggestion.nameAr .nameAr : suggestion.nameEn),
: suggestion.nameEn),
padding: EdgeInsets.all(8.0)), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1, itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) => itemFilter: (suggestion, input) =>
suggestion.nameAr suggestion.nameAr.toLowerCase().startsWith(
.toLowerCase() input.toLowerCase()) ||
.startsWith(input.toLowerCase()) || suggestion.nameEn.toLowerCase()
suggestion.nameEn
.toLowerCase()
.startsWith(input.toLowerCase()), .startsWith(input.toLowerCase()),
) ):TextField(
: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase TranslationBase
.of(context) .of(context)
.selectAllergy, .selectAllergy,
_selectedAllergy != null _selectedAllergy != null
? projectViewModel.isArabic?_selectedAllergy.nameAr: _selectedAllergy.nameEn ? projectViewModel.isArabic?_selectedAllergy.nameAr: _selectedAllergy.nameEn
: null, : null, true, icon: EvaIcons.search),
true,
icon: EvaIcons.search),
enabled: false, enabled: false,
), ),
), ),
@ -292,12 +325,13 @@ class _AddAllergiesState extends State<AddAllergies> {
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.allergySeverityList, list: model.allergySeverityList,
okText: TranslationBase.of(context).ok, okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedAllergySeverity = _selectedAllergySeverity =
selectedValue; selectedValue;
}); });
}, },
); );
@ -327,7 +361,8 @@ class _AddAllergiesState extends State<AddAllergies> {
height: 10, height: 10,
), ),
Container( Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
@ -338,28 +373,29 @@ class _AddAllergiesState extends State<AddAllergies> {
controller: remarkController, controller: remarkController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase.of(context) return TranslationBase
.of(context)
.emptyMessage; .emptyMessage;
else else
return null; return null;
}), }),
), ), SizedBox(
SizedBox(
height: 10, height: 10,
), ),
AppButton( AppButton(
title: "Add".toUpperCase(), title: "Add".toUpperCase(),
onPressed: () { onPressed: () {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy mySelectedAllergy = new MySelectedAllergy(
new MySelectedAllergy(
remark: remarkController.text, remark: remarkController.text,
selectedAllergy: _selectedAllergy, selectedAllergy: _selectedAllergy,
selectedAllergySeverity: isChecked: true,
_selectedAllergySeverity); selectedAllergySeverity: _selectedAllergySeverity,);
widget.addAllergiesFun(mySelectedAllergy); widget.addAllergiesFun(mySelectedAllergy);
}, },
), ),
]), ]
),
), ),
), ),
)), )),
@ -367,3 +403,8 @@ class _AddAllergiesState extends State<AddAllergies> {
); );
} }
} }

@ -131,6 +131,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.myAllergiesList.clear();
widget.myHistoryList.clear();
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
@ -165,6 +169,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
MySelectedAllergy mySelectedAllergy = MySelectedAllergy( MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: selectedAllergy, selectedAllergy: selectedAllergy,
isChecked: element.isChecked,
selectedAllergySeverity: selectedAllergySeverity); selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) if (selectedAllergy != null && selectedAllergySeverity != null)
widget.myAllergiesList.add(mySelectedAllergy); widget.myAllergiesList.add(mySelectedAllergy);

@ -505,6 +505,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
baseViewModel: model, baseViewModel: model,
child: MasterKeyCheckboxSearchWidget( child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
hintSearchText: 'Search Examination',
buttonName: 'Add Examination',
masterList: model.physicalExaminationList, masterList: model.physicalExaminationList,
removeHistory: (history){ removeHistory: (history){
setState(() { setState(() {

@ -16,11 +16,12 @@ class Texts extends StatefulWidget {
final bool readMore; final bool readMore;
final String style; final String style;
final bool allowExpand; final bool allowExpand;
final TextDecoration textDecoration;
Texts(this.text, {Key key, this.variant, this.color, Texts(this.text, {Key key, this.variant, this.color,
this.bold, this.regular, this.medium, this.allowExpand = true, this.bold, this.regular, this.medium, this.allowExpand = true,
this.italic:false, this.textAlign, this.maxLength=60, this.italic:false, this.textAlign, this.maxLength=60,
this.maxLines, this.readMore=false, this.style this.maxLines, this.readMore=false, this.style, this.textDecoration
}) : super(key: key); }) : super(key: key);
@override @override
@ -192,6 +193,7 @@ class _TextsState extends State<Texts> {
fontSize: _getFontSize(), fontSize: _getFontSize(),
letterSpacing: widget.variant=="overline" ? 1.5 : null, letterSpacing: widget.variant=="overline" ? 1.5 : null,
fontWeight: _getFontWeight(), fontWeight: _getFontWeight(),
decoration: widget.textDecoration//TextDecoration.lineThrough
) )
), ),
if (widget.readMore && text.length > widget.maxLength && hidden) if (widget.readMore && text.length > widget.maxLength && hidden)
@ -228,7 +230,8 @@ class _TextsState extends State<Texts> {
style: _getFontStyle().copyWith( style: _getFontStyle().copyWith(
color: HexColor('#FF0000'), color: HexColor('#FF0000'),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: "WorkSans" fontFamily: "WorkSans",
) )
), ),
), ),

@ -503,7 +503,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -760,7 +760,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
@ -895,5 +895,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save