Compare commits

...

11 Commits

Author SHA1 Message Date
hussam al-habibeh 7d3e59e060 flutter version 2 4 years ago
hussam al-habibeh f53920d040 Merge branch 'flutter_2_developemt' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into hussam_flutter_2
 Conflicts:
	lib/core/viewModel/PatientRegistrationViewModel.dart
	lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart
	lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart
	lib/screens/patients/profile/referral/my-referral-detail-screen.dart
	lib/screens/reschedule-leaves/reschedule_leave.dart
4 years ago
hussam al-habibeh 8720e281ff flutter version 2 4 years ago
Elham Ali 209954ca55 Merge branch 'flutter_vervion_2_by_elham' into 'flutter_2_developemt'
Flutter vervion 2 by elham

See merge request Cloud_Solution/doctor_app_flutter!896
4 years ago
Elham Rababh 359b337b27 6 step from fix screen 4 years ago
Elham Rababh 28d8449345 Merge branch 'flutter_2_developemt' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into flutter_vervion_2_by_elham
 Conflicts:
	lib/models/SOAP/selected_items/my_selected_allergy.dart
4 years ago
hussam al-habibeh 772c2d300d Merge branch 'flutter_2_developemt' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into hussam_flutter_2 4 years ago
Elham Ali 49ab6382c3 Merge branch 'hussam_flutter_2' into 'flutter_2_developemt'
flutter 2 models

See merge request Cloud_Solution/doctor_app_flutter!895
4 years ago
Elham Rababh a54ec0ef78 5 step from fix screen 4 years ago
hussam al-habibeh fe20bfd9b9 Merge branch 'flutter_2_developemt' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into hussam_flutter_2 4 years ago
Elham Ali 7d835ee280 Merge branch 'hussam_flutter_2' into 'flutter_2_developemt'
Hussam flutter 2

See merge request Cloud_Solution/doctor_app_flutter!892
4 years ago

@ -141,11 +141,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future sendActivationCodeByOTPNotificationType( Future sendActivationCodeByOTPNotificationType({required int otpType}) async {
{required SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
required int otpType,
required PatientRegistrationViewModel user}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel);
print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel);

@ -1,16 +1,16 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination { class MySelectedExamination {
MasterKeyModel selectedExamination; MasterKeyModel? selectedExamination;
String remark; String? remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined; bool notExamined;
bool isNew; bool isNew;
bool isLocal; bool isLocal;
int createdBy; int? createdBy;
String createdOn; String? createdOn;
String editedOn; String? editedOn;
MySelectedExamination({ MySelectedExamination({
this.selectedExamination, this.selectedExamination,

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedHistory { class MySelectedHistory {
MasterKeyModel selectedHistory; MasterKeyModel? selectedHistory;
String remark; String? remark;
bool? isChecked; bool? isChecked;
bool? isLocal; bool? isLocal;

@ -26,7 +26,10 @@ import 'package:hexcolor/hexcolor.dart';
class EndCallScreen extends StatefulWidget { class EndCallScreen extends StatefulWidget {
final PatiantInformtion? patient; final PatiantInformtion? patient;
const EndCallScreen({Key? key, this.patient,}) : super(key: key); const EndCallScreen({
Key? key,
this.patient,
}) : super(key: key);
@override @override
_EndCallScreenState createState() => _EndCallScreenState(); _EndCallScreenState createState() => _EndCallScreenState();
@ -46,28 +49,26 @@ class _EndCallScreenState extends State<EndCallScreen> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if(widget.patient!=null) if (widget.patient != null) patient = widget.patient;
patient = widget.patient;
} }
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
if(routeArgs.containsKey('patient')) if (routeArgs.containsKey('patient')) patient = routeArgs['patient'];
patient = routeArgs['patient'];
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).resume!,
TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png',
isInPatient: isInpatient, isInPatient: isInpatient, color: Colors.green[800]!, onTap: () async {
color: Colors.green[800]!,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async { await liveCareModel
.startCall(isReCall: false, vCID: patient!.vcId!)
.then((value) async {
await liveCareModel.getDoctorProfile(); await liveCareModel.getDoctorProfile();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
@ -78,8 +79,13 @@ class _EndCallScreenState extends State<EndCallScreen> {
kSessionId: liveCareModel.startCallRes.openSessionID, kSessionId: liveCareModel.startCallRes.openSessionID,
kApiKey: '46209962', kApiKey: '46209962',
vcId: patient!.vcId, vcId: patient!.vcId,
isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording: false, isRecording: liveCareModel.startCallRes != null
patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"), ? liveCareModel.startCallRes.isRecording!
: false,
patientName: patient!.fullName ??
(patient!.firstName != null
? "${patient!.firstName} ${patient!.lastName}"
: "-"),
tokenID: await liveCareModel.getToken(), tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID, generalId: GENERAL_ID,
doctorId: liveCareModel.doctorProfile!.doctorID, doctorId: liveCareModel.doctorProfile!.doctorID,
@ -92,13 +98,14 @@ class _EndCallScreenState extends State<EndCallScreen> {
await liveCareModel.endCall( await liveCareModel.endCall(
patient!.vcId!, patient!.vcId!,
false, false,
);
);GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
} }
}, },
onCallNotRespond: (SessionStatusModel sessionStatusModel) async { onCallNotRespond:
(SessionStatusModel sessionStatusModel) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall( await liveCareModel.endCall(
@ -117,10 +124,12 @@ class _EndCallScreenState extends State<EndCallScreen> {
} }
}, isDartIcon: true, dartIcon: DoctorApp.call), }, isDartIcon: true, dartIcon: DoctorApp.call),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', TranslationBase.of(context).endLC!,
TranslationBase.of(context).consultation!,
'',
'patient/vital_signs.png',
isInPatient: isInpatient, isInPatient: isInpatient,
color: Colors.red[800]!, color: Colors.red[800]!, onTap: () {
onTap: () {
Helpers.showConfirmationDialog(context, Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?",
() async { () async {
@ -131,14 +140,17 @@ class _EndCallScreenState extends State<EndCallScreen> {
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
} else { } else {
showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { showAlternativesDialog(context, liveCareModel,
(bool isConfirmed) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCallWithCharge(patient!.vcId!, isConfirmed); await liveCareModel.endCallWithCharge(
patient!.vcId!, isConfirmed);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
} else { } else {
DrAppToastMsg.showSuccesToast("You successfully completed call with charge"); DrAppToastMsg.showSuccesToast(
"You successfully completed call with charge");
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
@ -146,9 +158,11 @@ class _EndCallScreenState extends State<EndCallScreen> {
} }
}); });
}, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion),
PatientProfileCardModel(TranslationBase.of(context).sendLC!, TranslationBase.of(context).instruction!, "", PatientProfileCardModel(
'patient/health_summary.png', TranslationBase.of(context).sendLC!,
onTap: () { TranslationBase.of(context).instruction!,
"",
'patient/health_summary.png', onTap: () {
Helpers.showConfirmationDialog(context, Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?", "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?",
() async { () async {
@ -159,7 +173,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
} else { } else {
DrAppToastMsg.showSuccesToast("You successfully sent SMS instructions"); DrAppToastMsg.showSuccesToast(
"You successfully sent SMS instructions");
} }
}); });
}, },
@ -168,12 +183,22 @@ class _EndCallScreenState extends State<EndCallScreen> {
// isDisable: true, // isDisable: true,
dartIcon: DoctorApp.send_instruction), dartIcon: DoctorApp.send_instruction),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', TranslationBase.of(context).transferTo!,
onTap: () { TranslationBase.of(context).admin!,
Navigator.push(context, '',
MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!), 'patient/health_summary.png', onTap: () {
settings: RouteSettings(name: 'LivaCareTransferToAdmin'),),); Navigator.push(
}, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), context,
MaterialPageRoute(
builder: (BuildContext context) =>
LivaCareTransferToAdmin(patient: patient!),
settings: RouteSettings(name: 'LivaCareTransferToAdmin'),
),
);
},
isInPatient: isInpatient,
isDartIcon: true,
dartIcon: DoctorApp.transfer_to_admin),
]; ];
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
@ -182,18 +207,11 @@ class _EndCallScreenState extends State<EndCallScreen> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase appBarTitle: TranslationBase.of(context).patientProfile!,
.of(context) backgroundColor: Theme.of(context).scaffoldBackgroundColor,
.patientProfile!,
backgroundColor: Theme
.of(context)
.scaffoldBackgroundColor,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(patient, onPressed: () {
patient,
onPressed: (){
Navigator.pop(context); Navigator.pop(context);
}, },
isInpatient: isInpatient, isInpatient: isInpatient,
height: (patient!.patientStatusType != null && height: (patient!.patientStatusType != null &&
@ -212,7 +230,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
child: ListView( child: ListView(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), padding:
const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -237,7 +256,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
crossAxisCount: 3, crossAxisCount: 3,
itemCount: cardsList.length, itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1), staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton( itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: patient!, patient: patient!,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -248,7 +268,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
route: cardsList[index].route, route: cardsList[index].route,
icon: cardsList[index].icon, icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient, isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient, isDischargedPatient:
cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable, isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap, onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading, isLoading: cardsList[index].isLoading,

@ -74,7 +74,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
DoctorApp.filter_1, DoctorApp.filter_1,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20, onPressed: () { },
), ),
), ),
SizedBox( SizedBox(
@ -209,10 +209,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
25, 25,
width: width:
30, 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext? context,
Object Object?
exception, exception,
StackTrace StackTrace?
stackTrace) { stackTrace) {
return AppText( return AppText(
'', '',

@ -24,14 +24,15 @@ class UcafDetailScreen extends StatefulWidget {
final UcafViewModel model; final UcafViewModel model;
final Function changeLoadingState; final Function changeLoadingState;
UcafDetailScreen(this.patient, this.model, {this.changeLoadingState}); UcafDetailScreen(this.patient, this.model,
{required this.changeLoadingState});
@override @override
_UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model); _UcafDetailScreenState createState() =>
_UcafDetailScreenState(this.patient, this.model);
} }
class _UcafDetailScreenState extends State<UcafDetailScreen> { class _UcafDetailScreenState extends State<UcafDetailScreen> {
final PatiantInformtion patient; final PatiantInformtion patient;
final UcafViewModel model; final UcafViewModel model;
@ -49,11 +50,9 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
widget.changeLoadingState(false); widget.changeLoadingState(false);
if (ucafModel.state == ViewState.Idle) { if (ucafModel.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
TranslationBase.of(context) TranslationBase.of(context).postUcafSuccessMsg);
.postUcafSuccessMsg);
Navigator.of(context).popUntil((route) { Navigator.of(context).popUntil((route) {
return route.settings.name == return route.settings.name == PATIENTS_PROFILE;
PATIENTS_PROFILE;
}); });
} else { } else {
DrAppToastMsg.showErrorToast(ucafModel.error); DrAppToastMsg.showErrorToast(ucafModel.error);
@ -86,14 +85,17 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column( child: Column(
children: [ children: [
treatmentStepsBar(context, model, screenSize, patient), treatmentStepsBar(
context, model, screenSize, patient),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
...getSelectedTreatmentStepItem(context, model), ...getSelectedTreatmentStepItem(
context, model),
], ],
), ),
), ),
@ -107,7 +109,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
)); ));
} }
Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) { Widget treatmentStepsBar(BuildContext _context, UcafViewModel model,
Size screenSize, PatiantInformtion patient) {
List<String> __treatmentSteps = [ List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis ?? "".toUpperCase(), TranslationBase.of(context).diagnosis ?? "".toUpperCase(),
TranslationBase.of(context).medications ?? "".toUpperCase(), TranslationBase.of(context).medications ?? "".toUpperCase(),
@ -115,7 +118,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
]; ];
return Container( return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), decoration: Helpers.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -127,13 +131,16 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: Helpers.containerBorderDecoration( decoration: Helpers.containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), _isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center( child: Center(
child: Text( child: Text(
item, item,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: _isActive ? Colors.white : Colors.black, //Colors.black, color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@ -166,17 +173,20 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
); );
} }
List<Widget> getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) { List<Widget> getSelectedTreatmentStepItem(
BuildContext _context, UcafViewModel model) {
switch (_activeTap) { switch (_activeTap) {
case 0: case 0:
if (model.patientAssessmentList != null) { if (model.patientAssessmentList != null) {
return [ return [
ListView.builder(itemCount: model.patientAssessmentList.length, ListView.builder(
itemCount: model.patientAssessmentList.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
physics: ScrollPhysics(), physics: ScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DiagnosisWidget(model, model.patientAssessmentList[index]); return DiagnosisWidget(
model, model.patientAssessmentList[index]);
}) })
]; ];
} else { } else {
@ -187,12 +197,16 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
break; break;
case 1: case 1:
return [ return [
ListView.builder(itemCount:model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, ListView.builder(
itemCount: model.prescriptionList != null
? model.prescriptionList!.entityList!.length
: 0,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
physics: ScrollPhysics(), physics: ScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return MedicationWidget(model, model.prescriptionList!.entityList![index]); return MedicationWidget(
model, model.prescriptionList!.entityList![index]);
}) })
]; ];
break; break;
@ -200,7 +214,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
if (model.orderProcedures != null) { if (model.orderProcedures != null) {
return [ return [
ListView.builder( ListView.builder(
itemCount:model.orderProcedures.length, scrollDirection: Axis.vertical, itemCount: model.orderProcedures.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(), physics: ScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -219,7 +234,6 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
]; ];
} }
} }
} }
class DiagnosisWidget extends StatelessWidget { class DiagnosisWidget extends StatelessWidget {
@ -230,10 +244,12 @@ class DiagnosisWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
MasterKeyModel? diagnosisType = MasterKeyModel? diagnosisType = model.findMasterDataById(
model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID); masterKeys: MasterKeysService.DiagnosisType,
MasterKeyModel? diagnosisCondition = id: diagnosis.diagnosisTypeID);
model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID); MasterKeyModel? diagnosisCondition = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisCondition,
id: diagnosis.conditionID);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -21,7 +21,7 @@ class UCAFInputScreen extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final Function changeLoadingState; final Function changeLoadingState;
UCAFInputScreen(this.patient, {this.changeLoadingState}); UCAFInputScreen(this.patient, {required this.changeLoadingState});
@override @override
_UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient); _UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient);
@ -83,7 +83,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
children: [ children: [
// PatientHeaderWidgetNoAvatar(patient), // PatientHeaderWidgetNoAvatar(patient),
Container( Container(
margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), margin: EdgeInsets.symmetric(
vertical: 0, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -137,7 +138,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 16, height: 16,
),*/ ),*/
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
@ -151,7 +153,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppText( AppText(
"BP (H/L)", "BP (H/L)",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
@ -160,7 +163,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppText( AppText(
"${model.bloodPressure}", "${model.bloodPressure}",
fontSize: SizeConfig.textMultiplier * 2, fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -174,7 +178,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).temperature}", "${TranslationBase.of(context).temperature}",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize:
SizeConfig.textMultiplier * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
@ -184,7 +189,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Expanded( Expanded(
child: AppText( child: AppText(
"${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)", "${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize: SizeConfig.textMultiplier * 2, fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -198,13 +204,15 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 2, height: 2,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
AppText( 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.normal, fontWeight: FontWeight.normal,
), ),
@ -213,7 +221,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppText( AppText(
"${model.hartRat}", "${model.hartRat}",
fontSize: SizeConfig.textMultiplier * 2, fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -225,7 +234,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).chiefComplaintsAndSymptoms, TranslationBase.of(context)
.chiefComplaintsAndSymptoms,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2, fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -246,9 +256,12 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 8, height: 8,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).instruction, hintText:
dropDownText: TranslationBase.of(context).instruction,
Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint ?? ""), dropDownText: Helpers.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint ??
""),
controller: _additionalComplaintsController, controller: _additionalComplaintsController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
enabled: false, enabled: false,
@ -381,9 +394,11 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText( child: AppText(
model.patientVitalSignsHistory == null ||model.patientVitalSignsHistory.length == 0 model.patientVitalSignsHistory == null ||
model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg ? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg, : TranslationBase.of(context)
.chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
@ -392,7 +407,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
) )
], ],
), ),
): Container(), )
: Container(),
), ),
); );
} }

@ -16,9 +16,13 @@ class PageStepperWidget extends StatelessWidget {
final int stepsCount; final int stepsCount;
final int currentStepIndex; final int currentStepIndex;
final Size screenSize; final Size screenSize;
final List<String> stepsTitles; final List<String>? stepsTitles;
PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize, this.stepsTitles}); PageStepperWidget(
{required this.stepsCount,
required this.currentStepIndex,
required this.screenSize,
this.stepsTitles});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -33,9 +37,23 @@ class PageStepperWidget extends StatelessWidget {
children: [ children: [
for (int i = 1; i <= stepsCount; i++) for (int i = 1; i <= stepsCount; i++)
if (i == currentStepIndex) if (i == currentStepIndex)
StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) StepWidget(
i,
true,
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles!,
)
else else
StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) StepWidget(
i,
false,
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles!,
)
], ],
) )
], ],
@ -52,7 +70,9 @@ class StepWidget extends StatelessWidget {
final double dividerWidth; final double dividerWidth;
final List<String> stepsTitles; final List<String> stepsTitles;
StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles}); StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish,
this.dividerWidth,
{required this.stepsTitles});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -96,7 +116,9 @@ class StepWidget extends StatelessWidget {
child: Icon( child: Icon(
Icons.check, Icons.check,
size: 20, size: 20,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.white, color: status == StepStatus.Locked
? Color(0xFF969696)
: Colors.white,
)), )),
), ),
if (!isFinalStep) if (!isFinalStep)
@ -104,7 +126,9 @@ class StepWidget extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
width: dividerWidth, width: dividerWidth,
height: 2, height: 2,
color: status == StepStatus.Completed ? Color(0xFF359846) : Color(0xFFCCCCCC), color: status == StepStatus.Completed
? Color(0xFF359846)
: Color(0xFFCCCCCC),
), ),
], ],
), ),
@ -112,7 +136,9 @@ class StepWidget extends StatelessWidget {
height: 8, height: 8,
), ),
AppText( AppText(
stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles[index - 1]}", stepsTitles == null
? "${TranslationBase.of(context).step} $index"
: "${stepsTitles[index - 1]}",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',

@ -23,13 +23,13 @@ class UCAFPagerScreen extends StatefulWidget {
class _UCAFPagerScreenState extends State<UCAFPagerScreen> class _UCAFPagerScreenState extends State<UCAFPagerScreen>
with TickerProviderStateMixin { with TickerProviderStateMixin {
PageController _controller; late PageController _controller;
int _currentIndex = 0; int _currentIndex = 0;
bool _isLoading = true; bool _isLoading = true;
PatiantInformtion patient; late PatiantInformtion patient;
String patientType; late String patientType;
String arrivalType; late String arrivalType;
changePageViewIndex(pageIndex, {isChangeState = true}) { changePageViewIndex(pageIndex, {isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
@ -65,7 +65,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
isShowAppBar: true, isShowAppBar: true,
isLoading: _isLoading, isLoading: _isLoading,
appBar: PatientProfileAppBar(patient), appBar: PatientProfileAppBar(patient),
appBarTitle: TranslationBase.of(context).ucaf, appBarTitle: TranslationBase.of(context).ucaf!,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -215,7 +215,7 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
.getDateTimeFromServerFormat(model .getDateTimeFromServerFormat(model
.admissionOrderList[ .admissionOrderList[
index] index]
.createdOn), .createdOn!),
isArabic: isArabic:
projectViewModel projectViewModel
.isArabic, .isArabic,
@ -241,7 +241,7 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
.getDateTimeFromServerFormat(model .getDateTimeFromServerFormat(model
.admissionOrderList[ .admissionOrderList[
index] index]
.createdOn)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -12,7 +12,10 @@ class LineChartForDiabetic extends StatelessWidget {
final bool isOX; final bool isOX;
LineChartForDiabetic( LineChartForDiabetic(
{required this.title, required this.timeSeries1, required this.indexes, this.isOX= false}); {required this.title,
required this.timeSeries1,
required this.indexes,
this.isOX = false});
List<int> xAxixs = []; List<int> xAxixs = [];
List<double> yAxixs = []; List<double> yAxixs = [];
@ -121,13 +124,16 @@ class LineChartForDiabetic extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, interval: getMaxY() - getMinY() <= 500
? 50
: getMaxY() - getMinY() <= 1000
? 100
: 200,
margin: 12, margin: 12,
), ),
), ),

@ -71,21 +71,22 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
isCopyable: false, isCopyable: false,
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).dischargeDate! + ": ", label:
TranslationBase.of(context).dischargeDate! + ": ",
value: AppDateUtils.getDateTimeFromServerFormat( value: AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn) widget.dischargeSummary.createdOn!)
.day .day
.toString() + .toString() +
" " + " " +
AppDateUtils.getMonth( AppDateUtils.getMonth(
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn) widget.dischargeSummary.createdOn!)
.month) .month)
.toString() .toString()
.substring(0, 3) + .substring(0, 3) +
' ' + ' ' +
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn) widget.dischargeSummary.createdOn!)
.year .year
.toString(), .toString(),
isCopyable: false, isCopyable: false,
@ -140,7 +141,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
)), )),
new TextSpan( new TextSpan(
text: Helpers.parseHtmlString( text: Helpers.parseHtmlString(
widget.dischargeSummary.pastHistory), widget.dischargeSummary.pastHistory!),
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig
@ -215,7 +216,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
)), )),
new TextSpan( new TextSpan(
text: Helpers.parseHtmlString(widget text: Helpers.parseHtmlString(widget
.dischargeSummary.conditionOnDischarge), .dischargeSummary.conditionOnDischarge!),
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig
@ -252,7 +253,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
)), )),
new TextSpan( new TextSpan(
text: Helpers.parseHtmlString( text: Helpers.parseHtmlString(
widget.dischargeSummary.planedProcedure), widget.dischargeSummary.planedProcedure!),
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig

@ -91,11 +91,12 @@ class LineChartCurvedState extends State<LineChartCurved> {
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 11, fontSize: 11,
), ),
@ -103,7 +104,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
rotateAngle: -65, rotateAngle: -65,
getTitles: (value) { getTitles: (value) {
print(value); print(value);
DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime!); DateTime date = AppDateUtils.convertStringToDate(
widget.labResult[value.toInt()].verifiedOnDateTime!);
if (widget.labResult.length < 8) { if (widget.labResult.length < 8) {
if (widget.labResult.length > value.toInt()) { if (widget.labResult.length > value.toInt()) {
return '${date.day}/ ${date.year}'; return '${date.day}/ ${date.year}';
@ -111,7 +113,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
return ''; return '';
} else { } else {
if (value.toInt() == 0) return '${date.day}/ ${date.year}'; if (value.toInt() == 0) return '${date.day}/ ${date.year}';
if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}'; if (value.toInt() == widget.labResult.length - 1)
return '${date.day}/ ${date.year}';
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return '${date.day}/ ${date.year}'; return '${date.day}/ ${date.year}';
} }
@ -122,7 +125,7 @@ class LineChartCurvedState extends State<LineChartCurved> {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
@ -195,7 +198,8 @@ class LineChartCurvedState extends State<LineChartCurved> {
List<FlSpot> spots = []; List<FlSpot> spots = [];
for (int index = 0; index < widget.labResult.length; index++) { for (int index = 0; index < widget.labResult.length; index++) {
try { try {
var resultValueDouble = double.parse(widget.labResult[index].resultValue ?? ""); var resultValueDouble =
double.parse(widget.labResult[index].resultValue ?? "");
spots.add(FlSpot(index.toDouble(), resultValueDouble)); spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) { } catch (e) {
print(e); print(e);

@ -9,7 +9,8 @@ class LineChartCurvedLabHistory extends StatefulWidget {
final String title; final String title;
final List<LabResultHistory> labResultHistory; final List<LabResultHistory> labResultHistory;
LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); LineChartCurvedLabHistory(
{required this.title, required this.labResultHistory});
@override @override
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState(); State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
@ -98,7 +99,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 11, fontSize: 11,
), ),
@ -107,7 +108,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
getTitles: (value) { getTitles: (value) {
print(value); print(value);
DateTime date = AppDateUtils.convertStringToDate( DateTime date = AppDateUtils.convertStringToDate(
widget.labResultHistory[value.toInt()].verifiedOnDateTime); widget.labResultHistory[value.toInt()].verifiedOnDateTime!);
if (widget.labResultHistory.length < 8) { if (widget.labResultHistory.length < 8) {
if (widget.labResultHistory.length > value.toInt()) { if (widget.labResultHistory.length > value.toInt()) {
return '${date.day}/ ${date.year}'; return '${date.day}/ ${date.year}';
@ -127,7 +128,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
@ -169,7 +170,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double max = 0; double max = 0;
widget.labResultHistory.forEach((element) { widget.labResultHistory.forEach((element) {
try { try {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
} catch (e) { } catch (e) {
print(e); print(e);
@ -182,10 +183,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double getMinY() { double getMinY() {
double min = 0; double min = 0;
try { try {
min = double.parse(widget.labResultHistory[0].resultValue); min = double.parse(widget.labResultHistory[0].resultValue!);
widget.labResultHistory.forEach((element) { widget.labResultHistory.forEach((element) {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue!);
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
} catch (e) { } catch (e) {
@ -201,7 +202,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
for (int index = 0; index < widget.labResultHistory.length; index++) { for (int index = 0; index < widget.labResultHistory.length; index++) {
try { try {
var resultValueDouble = var resultValueDouble =
double.parse(widget.labResultHistory[index].resultValue); double.parse(widget.labResultHistory[index].resultValue!);
spots.add(FlSpot(index.toDouble(), resultValueDouble)); spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) { } catch (e) {
print(e); print(e);

@ -68,8 +68,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
color: Colors.grey[200], color: Colors.grey[200],
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
model.reservationList == null || model.reservationList == null || model.reservationList.length == 0
model.reservationList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote!) error: TranslationBase.of(context).errorNoProgressNote!)
: Expanded( : Expanded(
@ -136,9 +135,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Column( Column(
children: [ children: [
AppText( AppText(
model model.reservationList[index]
.reservationList[
index]
.createdOn != .createdOn !=
null null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
@ -146,7 +143,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
.getDateTimeFromServerFormat(model .getDateTimeFromServerFormat(model
.reservationList[ .reservationList[
index] index]
.createdOn), .createdOn!),
isArabic: isArabic:
projectViewModel projectViewModel
.isArabic, .isArabic,
@ -161,9 +158,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model model.reservationList[index]
.reservationList[
index]
.createdOn != .createdOn !=
null null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
@ -171,7 +166,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
.getDateTimeFromServerFormat(model .getDateTimeFromServerFormat(model
.reservationList[ .reservationList[
index] index]
.createdOn)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -196,7 +191,9 @@ class _ProgressNoteState extends State<OperationReportScreen> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.reservationList[index].oTReservationID.toString(), model.reservationList[index]
.oTReservationID
.toString(),
fontSize: 10, fontSize: 10,
), ),
) )
@ -222,7 +219,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
.getDateTimeFromServerFormat(model .getDateTimeFromServerFormat(model
.reservationList[ .reservationList[
index] index]
.operationDate), .operationDate!),
isArabic: isArabic:
projectViewModel projectViewModel
.isArabic, .isArabic,

@ -100,34 +100,33 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
return BaseView<OperationReportViewModel>( return BaseView<OperationReportViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model await model.getOperationReportDetails(widget.reservation);
.getOperationReportDetails(widget.reservation);
OTReservationID.text = widget.reservation.oTReservationID.toString(); OTReservationID.text = widget.reservation.oTReservationID.toString();
if (model.operationDetailsList.isNotEmpty) { if (model.operationDetailsList.isNotEmpty) {
GetOperationDetailsResponseModel oldDetails = GetOperationDetailsResponseModel oldDetails =
model.operationDetailsList[0]; model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction; postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis; preOpDiagmosisController.text = oldDetails.preOpDiagnosis!;
surgeonController.text = oldDetails.surgeon; surgeonController.text = oldDetails.surgeon!;
assistantNoteController.text = oldDetails.assistant; assistantNoteController.text = oldDetails.assistant!;
operationController.text = oldDetails.operation; operationController.text = oldDetails.operation!;
inasionController.text = oldDetails.inasion; inasionController.text = oldDetails.inasion!;
findingController.text = oldDetails.finding; findingController.text = oldDetails.finding!;
surgeryProcedureController.text = oldDetails.surgeryProcedure; surgeryProcedureController.text = oldDetails.surgeryProcedure!;
postOpInstructionController.text = oldDetails.postOpInstruction; postOpInstructionController.text = oldDetails.postOpInstruction!;
complicationDetailsController.text = oldDetails.complicationDetail; complicationDetailsController.text = oldDetails.complicationDetail!;
bloodLossDetailController.text = oldDetails.bloodLossDetail; bloodLossDetailController.text = oldDetails.bloodLossDetail!;
histopathSpecimenController.text = oldDetails.histopathSpecimen; histopathSpecimenController.text = oldDetails.histopathSpecimen!;
microbiologySpecimenController.text = microbiologySpecimenController.text =
oldDetails.microbiologySpecimen; oldDetails.microbiologySpecimen!;
otherSpecimenController.text = oldDetails.otherSpecimen; otherSpecimenController.text = oldDetails.otherSpecimen!;
scrubNurseController.text = oldDetails.scrubNurse; scrubNurseController.text = oldDetails.scrubNurse;
circulatingNurseController.text = oldDetails.circulatingNurse; circulatingNurseController.text = oldDetails.circulatingNurse;
BloodTransfusedDetailController.text = BloodTransfusedDetailController.text =
oldDetails.bloodTransfusedDetail; oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist; anasthetistController.text = oldDetails.anasthetist!;
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -530,7 +529,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
), ),
), ),
), ),
bottomSheet: model.state != ViewState.Idle?Container(height: 0,): Container( bottomSheet: model.state != ViewState.Idle
? Container(
height: 0,
)
: Container(
height: 70, height: 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column( child: Column(
@ -551,8 +554,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
}); });
if (isFormValid()) { if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model.getDoctorProfile();
.getDoctorProfile();
CreateUpdateOperationReportRequestModel CreateUpdateOperationReportRequestModel
createUpdateOperationReportRequestModel = createUpdateOperationReportRequestModel =
@ -560,48 +562,52 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
inasion: inasionController.text, inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation /// TODO Elham* Add dynamic reservation
reservationNo: reservationNo: widget
widget.reservation.oTReservationID, .reservation.oTReservationID,
preOpDiagmosis: preOpDiagmosis:
preOpDiagmosisController.text, preOpDiagmosisController.text,
postOpDiagmosis: postOpDiagmosis:
postOpDiagmosisNoteController.text, postOpDiagmosisNoteController
.text,
surgeon: surgeonController.text, surgeon: surgeonController.text,
assistant: assistantNoteController.text, assistant:
anasthetist: assistantNoteController.text, assistantNoteController.text,
anasthetist:
assistantNoteController.text,
operation: operationController.text, operation: operationController.text,
finding: findingController.text, finding: findingController.text,
surgeryProcedure: surgeonController.text, surgeryProcedure:
surgeonController.text,
postOpInstruction: postOpInstruction:
postOpInstructionController.text, postOpInstructionController.text,
complicationDetails: complicationDetails:
complicationDetailsController.text, complicationDetailsController
.text,
bloodLossDetail: bloodLossDetail:
bloodLossDetailController.text, bloodLossDetailController.text,
histopathSpecimen: histopathSpecimen:
histopathSpecimenController.text, histopathSpecimenController.text,
microbiologySpecimen: microbiologySpecimen:
microbiologySpecimenController.text, microbiologySpecimenController
otherSpecimen: otherSpecimenController.text, .text,
otherSpecimen:
otherSpecimenController.text,
scrubNurse: surgeonController.text, scrubNurse: surgeonController.text,
circulatingNurse: circulatingNurse:
circulatingNurseController.text, circulatingNurseController.text,
bloodTransfusedDetail: bloodTransfusedDetail:
bloodLossDetailController.text, bloodLossDetailController.text,
patientID: widget.patient.patientId, patientID: widget.patient.patientId,
admissionNo: admissionNo: int.parse(
int.parse(widget.patient.admissionNo!), widget.patient.admissionNo!),
createdBy: model createdBy:
.doctorProfile!.doctorID!, model.doctorProfile!.doctorID!,
setupID: "010266"); setupID: "010266");
await model await model.updateOperationReport(
.updateOperationReport(
createUpdateOperationReportRequestModel); createUpdateOperationReportRequestModel);
if (model.state == if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { Helpers.showErrorToast(model.error);
Helpers.showErrorToast(
model.error);
} else { } else {
// await model.( // await model.(
// operationReportsRequest.toJson()); // operationReportsRequest.toJson());

@ -9,22 +9,19 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PendingOrdersScreen extends StatelessWidget { class PendingOrdersScreen extends StatelessWidget {
const PendingOrdersScreen({Key key}) : super(key: key); const PendingOrdersScreen({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<PendingOrdersViewModel>( return BaseView<PendingOrdersViewModel>(
onModelReady: (model) => model.getPendingOrders( onModelReady: (model) async {},
patientId: patient.patientMRN, builder: (_, model, w) => AppScaffold(
admissionNo: int.parse(patient.admissionNo)),
builder:
(BuildContext context, PendingOrdersViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
isInpatient: isInpatient, isInpatient: isInpatient,
@ -35,7 +32,7 @@ class PendingOrdersScreen extends StatelessWidget {
body: model.pendingOrdersList == null || body: model.pendingOrdersList == null ||
model.pendingOrdersList.length == 0 model.pendingOrdersList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase.of(context).noDataAvailable) error: TranslationBase.of(context).noDataAvailable!)
: Column( : Column(
children: [ children: [
Padding( Padding(

@ -70,7 +70,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
_tabController.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
if (isFromLiveCare) { if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId); _liveCareViewModel.removePatientFromDoctorList(patient.vcId!);
} }
} }
@ -139,7 +139,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) if (isFromLiveCare && patient.patientStatus == 1)
await model.addPatientToDoctorList(patient.vcId); await model.addPatientToDoctorList(patient!.vcId!);
},builder: (_, model, w) => AppScaffold( },builder: (_, model, w) => AppScaffold(
baseViewModel: model,isLoading: true, baseViewModel: model,isLoading: true,
appBarTitle: TranslationBase.of(context).patientProfile ?? "", appBarTitle: TranslationBase.of(context).patientProfile ?? "",
@ -151,6 +151,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Column( Column(
children: [ children: [
PatientProfileAppBar( PatientProfileAppBar(
patient,
patientProfileAppBarModel: PatientProfileAppBarModel( patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient, patient: patient,
videoCallDurationStream: videoCallDurationStream, videoCallDurationStream: videoCallDurationStream,
@ -364,7 +365,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.startCall( await model.startCall(
isReCall: false, vCID: patient.vcId); isReCall: false, vCID: patient.vcId!);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -398,7 +399,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: true, : true,
callConnected, callConnected,
callDisconnected); callDisconnected);
}); }, type: '');
} }
} }
}, },
@ -417,16 +418,16 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
); );
} }
createEpisode({PatiantInformtion patient, SOAPViewModel model}) async { createEpisode({required PatiantInformtion patient, required SOAPViewModel model}) async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile", eventCategory: "Patient Profile",
eventAction: "Create Episode", eventAction: "Create Episode",
); );
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel postEpisodeReqModel =
PostEpisodeForInpatientRequestModel( PostEpisodeForInpatientRequestModel(
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient!.admissionNo!),
patientID: patient.patientId); patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel); await model.postEpisodeForInPatient(postEpisodeReqModel);
} else { } else {

@ -35,39 +35,69 @@ class ProfileGridForInPatient extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital ?? "", TranslationBase.of(context).signs ?? "", PatientProfileCardModel(
VITAL_SIGN_DETAILS, 'patient/vital_signs.png', TranslationBase.of(context).vital ?? "",
TranslationBase.of(context).signs ?? "",
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab ?? "", TranslationBase.of(context).result ?? "", PatientProfileCardModel(
LAB_RESULT, 'patient/lab_results.png', TranslationBase.of(context).lab ?? "",
TranslationBase.of(context).result ?? "",
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab, TranslationBase.of(context).lab!,
TranslationBase.of(context).special, TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT, ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png', 'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).result!, PatientProfileCardModel(
RADIOLOGY_PATIENT, 'patient/health_summary.png', TranslationBase.of(context).radiology!,
TranslationBase.of(context).result!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).prescription!, PatientProfileCardModel(
ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', TranslationBase.of(context).patient!,
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).progress!, TranslationBase.of(context).note!, PROGRESS_NOTE, PatientProfileCardModel(
TranslationBase.of(context).progress!,
TranslationBase.of(context).note!,
PROGRESS_NOTE,
'patient/Progress_notes.png', 'patient/Progress_notes.png',
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).order!, TranslationBase.of(context).sheet!, ORDER_NOTE, isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).order!,
TranslationBase.of(context).sheet!,
ORDER_NOTE,
'patient/Progress_notes.png', 'patient/Progress_notes.png',
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, isDischargedPatient: isDischargedPatient),
ORDER_PROCEDURE, 'patient/Order_Procedures.png', PatientProfileCardModel(
TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, PatientProfileCardModel(
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png', 'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).medical!, TranslationBase.of(context).report!, PatientProfileCardModel(
PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', TranslationBase.of(context).medical!,
isInPatient: isInpatient, isDisable: false), TranslationBase.of(context).report!,
PATIENT_MEDICAL_REPORT,
'patient/health_summary.png',
isInPatient: isInpatient,
isDisable: false),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral!, TranslationBase.of(context).referral!,
TranslationBase.of(context).patient!, TranslationBase.of(context).patient!,
@ -76,13 +106,19 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch, isDisable: isDischargedPatient || isFromSearch,
), ),
PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).approvals!, PatientProfileCardModel(
PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', TranslationBase.of(context).insurance!,
TranslationBase.of(context).approvals!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, DISCHARGE_SUMMARY, PatientProfileCardModel(
TranslationBase.of(context).discharge!,
TranslationBase.of(context).report!,
DISCHARGE_SUMMARY,
'patient/patient_sick_leave.png', 'patient/patient_sick_leave.png',
isInPatient: isInpatient, ) isInPatient: isInpatient,
, ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patientSick!, TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!, TranslationBase.of(context).leave!,

@ -33,41 +33,77 @@ class ProfileGridForOther extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', PatientProfileCardModel(
TranslationBase.of(context).vital!,
TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', TranslationBase.of(context).lab!,
TranslationBase.of(context).result!,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, PatientProfileCardModel(
ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', TranslationBase.of(context).lab!,
TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, PatientProfileCardModel(
RADIOLOGY_PATIENT, 'patient/health_summary.png', TranslationBase.of(context).radiology!,
TranslationBase.of(context).service!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, PatientProfileCardModel(
ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', TranslationBase.of(context).orders!,
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, PatientProfileCardModel(
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png', 'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG",
PATIENT_ECG, 'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, PatientProfileCardModel(
ORDER_PROCEDURE, 'patient/Order_Procedures.png', TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, PatientProfileCardModel(
PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', TranslationBase.of(context).insurance!,
TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', PatientProfileCardModel(
TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) if (isFromLiveCare ||
PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, (patient.appointmentNo != null && patient.appointmentNo != 0))
PATIENT_UCAF_REQUEST, 'patient/ucaf.png', PatientProfileCardModel(
TranslationBase.of(context).patient!,
TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable: isFromLiveCare
? patient.appointmentNo == null ? patient.appointmentNo == null
: patient.patientStatusType != 43 || patient.appointmentNo == null), : patient.patientStatusType != 43 ||
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) patient.appointmentNo == null),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral!, TranslationBase.of(context).referral!,
TranslationBase.of(context).patient!, TranslationBase.of(context).patient!,
@ -76,15 +112,21 @@ class ProfileGridForOther extends StatelessWidget {
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable: isFromLiveCare
? patient.appointmentNo == null ? patient.appointmentNo == null
: patient.patientStatusType != 43 || patient.appointmentNo == null, : patient.patientStatusType != 43 ||
patient.appointmentNo == null,
), ),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) if (isFromLiveCare ||
PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, (patient.appointmentNo != null && patient.appointmentNo != 0))
PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', PatientProfileCardModel(
TranslationBase.of(context).admission!,
TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable: isFromLiveCare
? patient.appointmentNo == null ? patient.appointmentNo == null
: patient.patientStatusType != 43 || patient.appointmentNo == null), : patient.patientStatusType != 43 ||
patient.appointmentNo == null),
]; ];
return Column( return Column(
@ -99,7 +141,8 @@ class ProfileGridForOther extends StatelessWidget {
crossAxisCount: 3, crossAxisCount: 3,
itemCount: cardsList.length, itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1), staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton( itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,

@ -30,45 +30,87 @@ class ProfileGridForSearch extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', PatientProfileCardModel(
TranslationBase.of(context).vital!,
TranslationBase.of(context).signs!,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', TranslationBase.of(context).lab!,
TranslationBase.of(context).result!,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, PatientProfileCardModel(
ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', TranslationBase.of(context).lab!,
TranslationBase.of(context).special!,
ALL_SPECIAL_LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, PatientProfileCardModel(
RADIOLOGY_PATIENT, 'patient/health_summary.png', TranslationBase.of(context).radiology!,
TranslationBase.of(context).service!,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, PatientProfileCardModel(
ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', TranslationBase.of(context).orders!,
TranslationBase.of(context).prescription!,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, PatientProfileCardModel(
TranslationBase.of(context).health!,
TranslationBase.of(context).summary!,
HEALTH_SUMMARY,
'patient/health_summary.png', 'patient/health_summary.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG",
PATIENT_ECG, 'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, PatientProfileCardModel(
ORDER_PROCEDURE, 'patient/Order_Procedures.png', TranslationBase.of(context).orders!,
TranslationBase.of(context).procedures!,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, PatientProfileCardModel(
PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', TranslationBase.of(context).insurance!,
TranslationBase.of(context).service!,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', PatientProfileCardModel(
TranslationBase.of(context).patientSick!,
TranslationBase.of(context).leave!,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, PatientProfileCardModel(
PATIENT_UCAF_REQUEST, 'patient/ucaf.png', TranslationBase.of(context).patient!,
isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), TranslationBase.of(context).ucaf!,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(TranslationBase.of(context).referral!, TranslationBase.of(context).patient!, PatientProfileCardModel(
REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', TranslationBase.of(context).referral!,
isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), TranslationBase.of(context).patient!,
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, PatientProfileCardModel(
PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', TranslationBase.of(context).admission!,
isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), TranslationBase.of(context).request!,
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
]; ];
return Column( return Column(
@ -83,7 +125,8 @@ class ProfileGridForSearch extends StatelessWidget {
crossAxisCount: 3, crossAxisCount: 3,
itemCount: cardsList.length, itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1), staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton( itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,

@ -16,9 +16,10 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class MyReferralDetailScreen extends StatelessWidget { class MyReferralDetailScreen extends StatelessWidget {
final MyReferralPatientModel referralPatient; final MyReferralPatientModel? referralPatient;
const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key); const MyReferralDetailScreen({Key? key, this.referralPatient})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -29,7 +30,7 @@ class MyReferralDetailScreen extends StatelessWidget {
onModelReady: (model) => model.getDoctorProfile(), onModelReady: (model) => model.getDoctorProfile(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient!,
isShowAppBar: false, isShowAppBar: false,
body: Column( body: Column(
children: [ children: [
@ -53,13 +54,15 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Helpers.capitalize(referralPatient.firstName + " " + referralPatient.lastName)), (Helpers.capitalize(referralPatient!.firstName! +
" " +
referralPatient!.lastName!)),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
referralPatient.gender == 1 referralPatient!.gender! == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -79,7 +82,7 @@ class MyReferralDetailScreen extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
referralPatient.gender == 1 referralPatient!.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -93,23 +96,32 @@ class MyReferralDetailScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referralPatient.referralStatus != null referralPatient!.referralStatus != null
? model.getReferralStatusNameByCode(referralPatient.referralStatus, context) ? model.getReferralStatusNameByCode(
referralPatient!.referralStatus!,
context)
: "", : "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referralPatient.referralStatus == 1 color: referralPatient!.referralStatus ==
1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referralPatient.referralStatus == 46 || referralPatient.referralStatus == 2 : referralPatient!.referralStatus ==
46 ||
referralPatient!
.referralStatus! ==
2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : Colors.red[700],
), ),
AppText( AppText(
AppDateUtils.getDayMonthYearDateFormatted(referralPatient.referralDate), AppDateUtils.getDayMonthYearDateFormatted(
referralPatient!.referralDate!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
@ -118,29 +130,35 @@ class MyReferralDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNumber, TranslationBase.of(context)
.fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize:
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
"${referralPatient.patientID}", "${referralPatient!.patientID}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
), ),
AppText( AppText(
AppDateUtils.getTimeHHMMA(referralPatient.referralDate), AppDateUtils.getTimeHHMMA(
referralPatient!.referralDate!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -149,50 +167,70 @@ class MyReferralDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).referredFrom, TranslationBase.of(context)
.referredFrom,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
referralPatient.targetProjectId == referralPatient.sourceProjectId referralPatient!
? TranslationBase.of(context).sameBranch .targetProjectId! ==
: TranslationBase.of(context).otherBranch, referralPatient!
.sourceProjectId!
? TranslationBase.of(
context)
.sameBranch
: TranslationBase.of(
context)
.otherBranch,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).remarks + " : ", TranslationBase.of(context)
.remarks! +
" : ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referralPatient.referringDoctorRemarks ?? '', referralPatient!
.referringDoctorRemarks ??
'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -204,22 +242,29 @@ class MyReferralDetailScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
referralPatient.nationalityName != null referralPatient!.nationalityName !=
? referralPatient.nationalityName null
? referralPatient!.nationalityName
: "", : "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier, fontSize:
1.4 * SizeConfig.textMultiplier,
), ),
referralPatient.nationalityFlagURL != null referralPatient!.nationalityFlagURL !=
null
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius:
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referralPatient.nationalityFlagURL, referralPatient!
.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder: (BuildContext?
(BuildContext context, Object exception, StackTrace stackTrace) { context,
Object? exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -232,7 +277,8 @@ class MyReferralDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10, right: 0), margin:
EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png', 'assets/images/patient/ic_ref_arrow_up.png',
height: 50, height: 50,
@ -240,14 +286,20 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), margin: EdgeInsets.only(
padding: EdgeInsets.only(left: 4.0, right: 4.0), left: 0,
top: 25,
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: Container( child: Container(
width: 40, width: 40,
height: 40, height: 40,
child: CircleAvatar( child: CircleAvatar(
radius: 25.0, radius: 25.0,
backgroundImage: NetworkImage(referralPatient.doctorImageURL), backgroundImage: NetworkImage(
referralPatient!.doctorImageURL!),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
), ),
), ),
@ -255,14 +307,19 @@ class MyReferralDetailScreen extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), margin: EdgeInsets.only(
left: 10,
top: 25,
right: 10,
bottom: 0),
child: Column( child: Column(
children: [ children: [
AppText( AppText(
referralPatient.doctorName, referralPatient!.doctorName,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -293,7 +350,8 @@ class MyReferralDetailScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox( child: SizedBox(
child: ProfileMedicalInfoWidgetSearch( child: ProfileMedicalInfoWidgetSearch(
patient: model.getPatientFromReferralO(referralPatient), patient: model
.getPatientFromReferralO(referralPatient!),
patientType: "7", patientType: "7",
isInpatient: false, isInpatient: false,
from: null, from: null,
@ -306,7 +364,7 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
), ),
if (referralPatient.referralStatus == 1) if (referralPatient!.referralStatus == 1)
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row( child: Row(
@ -321,11 +379,14 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12, vPadding: 12,
disabled: model.state == ViewState.Busy, disabled: model.state == ViewState.Busy,
onPressed: () async { onPressed: () async {
await model.responseReferral(referralPatient, true); await model.responseReferral(
referralPatient!, true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgAccept);
model.getMyReferralOutPatientService(); model.getMyReferralOutPatientService();
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
@ -346,11 +407,14 @@ class MyReferralDetailScreen extends StatelessWidget {
vPadding: 12, vPadding: 12,
disabled: model.state == ViewState.Busy, disabled: model.state == ViewState.Busy,
onPressed: () async { onPressed: () async {
await model.responseReferral(referralPatient, false); await model.responseReferral(
referralPatient!, false);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgReject);
model.getMyReferralOutPatientService(); model.getMyReferralOutPatientService();
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);

@ -115,7 +115,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails), title: TranslationBase.of(context).addAssessmentDetails!),
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
@ -210,9 +210,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
.width * 0.7, .width * 0.7,
child: AppText( child: AppText(
widget.mySelectedAssessment widget.mySelectedAssessment
.selectedICD.description + .selectedICD!.description! +
(' (${widget.mySelectedAssessment (' (${widget.mySelectedAssessment
.selectedICD.code} )'), .selectedICD!.code!} )'),
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,

@ -165,7 +165,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
new TextSpan( new TextSpan(
text: assessment text: assessment
.selectedICD.code .selectedICD!.code
.trim() .trim()
.toUpperCase() ?? .toUpperCase() ??
""), ""),
@ -191,7 +191,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: assessment text: assessment
.selectedICD.description .selectedICD!.description
.toString(), .toString(),
), ),
], ],
@ -249,7 +249,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.condition + .condition! +
" : ", " : ",
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
@ -260,11 +260,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: projectViewModel text: projectViewModel
.isArabic .isArabic
? assessment ? assessment
.selectedDiagnosisCondition .selectedDiagnosisCondition!
.nameAr .nameAr!
: assessment : assessment
.selectedDiagnosisCondition .selectedDiagnosisCondition!
.nameEn, .nameEn!,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
@ -289,7 +289,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.dType + .dType! +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
@ -300,10 +300,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
text: projectViewModel text: projectViewModel
.isArabic .isArabic
? assessment ? assessment
.selectedDiagnosisType .selectedDiagnosisType!
.nameAr .nameAr
: assessment : assessment
.selectedDiagnosisType .selectedDiagnosisType!
.nameEn, .nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
@ -331,7 +331,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.doctor + .doctor! +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
@ -374,7 +374,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
'') '')
? TranslationBase.of( ? TranslationBase.of(
context) context)
.remarks + .remarks! +
" : " " : "
: '', : '',
fontSize: SizeConfig fontSize: SizeConfig
@ -405,8 +405,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
? AppDateUtils ? AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.parse( DateTime.parse(
assessment assessment!
.createdOn)) .createdOn!))
: AppDateUtils : AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
@ -419,8 +419,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
assessment.createdOn != null assessment.createdOn != null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
assessment assessment!
.createdOn)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -25,7 +25,7 @@ class AddExaminationPage extends StatefulWidget {
} }
class _AddExaminationPageState extends State<AddExaminationPage> { class _AddExaminationPageState extends State<AddExaminationPage> {
List<MySelectedExamination> mySelectedExaminationLocal; late List<MySelectedExamination> mySelectedExaminationLocal;
@override @override
initState() { initState() {

@ -20,7 +20,7 @@ class AddExaminationWidget extends StatefulWidget {
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand; bool isExpand;
final VoidCallback expandClick; final VoidCallback expandClick;
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination>? mySelectedExamination;
AddExaminationWidget({ AddExaminationWidget({
required this.item, required this.item,
@ -44,13 +44,13 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override @override
void initState() { void initState() {
if (getSelectedExam(widget.item) != null) { if (getSelectedExam(widget.item) != null) {
examination = getSelectedExam(widget.item); examination = getSelectedExam(widget.item)!;
status = examination.isNormal status = examination.isNormal
? 1 ? 1
: examination.isAbnormal : examination.isAbnormal
? 2 ? 2
: 3; : 3;
remarksController.text = examination.remark; remarksController.text = examination!.remark!;
} else { } else {
examination.selectedExamination = widget.item; examination.selectedExamination = widget.item;
} }
@ -75,7 +75,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Checkbox( Checkbox(
value:widget.isServiceSelected(widget.item), value:widget.isServiceSelected(widget.item),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool ?newValue) {
onExamTap(); onExamTap();
}), }),
Container( Container(
@ -274,11 +274,11 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
}); });
} }
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where( Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where(
(element) => (element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination!.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) { if (exam.length > 0) {
return exam.first; return exam.first;
} }

@ -73,7 +73,7 @@ class ExaminationItemCard extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
if (examination.remark.isNotEmpty) if (examination.remark!.isNotEmpty)
RemarkText(remark: examination.remark), RemarkText(remark: examination.remark),
], ],
), ),

@ -19,7 +19,7 @@ class ExaminationsListSearchWidget extends StatefulWidget {
{required this.removeExamination, {required this.removeExamination,
required this.addExamination, required this.addExamination,
required this.isServiceSelected, required this.isServiceSelected,
required this.masterList, this.mySelectedExamination}); required this.masterList, required this.mySelectedExamination});
@override @override
_ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState();

@ -71,7 +71,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
model.patientPhysicalExamList.forEach((element) { model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey( MasterKeyModel? examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination, masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId, id: element.examId,
); );
@ -152,7 +152,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
examination.selectedExamination); examination!.selectedExamination!);
}); });
}).toList(), }).toList(),
), ),
@ -181,7 +181,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
examination.selectedExamination); examination.selectedExamination!);
}); });
}).toList(), }).toList(),
) )
@ -205,7 +205,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
Navigator.of(context).pop(); Navigator.of(context).pop();
}else{ }else{
widget.changeLoadingState(true); widget.changeLoadingState(true);
@ -230,8 +230,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id, examId: exam.selectedExamination!.id,
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal, isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal, isNormal: exam.isNormal,
notExamined: exam.notExamined, notExamined: exam.notExamined,
@ -248,13 +248,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
isNew: exam.isNew, isNew: exam.isNew,
); );
if (widget.patientInfo.admissionNo != null && if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo); int.parse(widget.patientInfo.admissionNo!);
} else { } else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0; listHisProgNotePhysicalExaminationVM.admissionNo = 0;
} }
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!
.add(listHisProgNotePhysicalExaminationVM); .add(listHisProgNotePhysicalExaminationVM);
}); });
@ -268,13 +268,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
widget.changeLoadingState(false); widget.changeLoadingState(false);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
if(widget.patientInfo.admissionNo != null && if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
} }
} else { } else {
if(widget.patientInfo.admissionNo != null && if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
widget.changeLoadingState(false); widget.changeLoadingState(false);
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
@ -322,9 +322,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExaminationLocal.forEach((element) { mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere( if ((mySelectedExamination.singleWhere(
(it) => (it) =>
it.selectedExamination.id == it.selectedExamination!.id ==
element.selectedExamination.id, element.selectedExamination!.id)) ==
orElse: () => null)) ==
null) { null) {
mySelectedExamination.insert(0,element); mySelectedExamination.insert(0,element);
} }
@ -335,16 +334,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExamination.forEach((element) { mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere( if ((mySelectedExaminationLocal.singleWhere(
(it) => (it) =>
it.selectedExamination.id == it.selectedExamination!.id ==
element.selectedExamination.id, element.selectedExamination!.id,
orElse: () => null)) == )) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }
}); });
removedList.forEach((element) { removedList.forEach((element) {
removeExamination(element.selectedExamination); removeExamination(element.selectedExamination!);
}); });
Navigator.of(context).pop(); Navigator.of(context).pop();
} }

@ -37,7 +37,8 @@ class UpdatePlanPage extends StatefulWidget {
required this.changeLoadingState, required this.changeLoadingState,
required this.currentIndex, required this.currentIndex,
required this.sOAPViewModel, required this.sOAPViewModel,
this.changeStateFun}); required this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
@ -90,7 +91,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
///TODO set progressNote in model; ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel!.patientProgressNoteList[0]!.planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
@ -126,7 +127,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
@ -253,7 +254,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn!))
: AppDateUtils : AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
@ -288,7 +289,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -385,7 +386,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
.getPatientProgressNote(getGetProgressNoteReqModel); .getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;

@ -9,7 +9,7 @@ class SOAPStepHeader extends StatelessWidget {
const SOAPStepHeader({ const SOAPStepHeader({
Key? key, Key? key,
required this.currentIndex, required this.currentIndex,
required this.changePageViewIndex, this.patientInfo, required this.changePageViewIndex, required this.patientInfo,
}) : super(key: key); }) : super(key: key);
final int currentIndex; final int currentIndex;

@ -4,8 +4,8 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class BottomSheetDialogButton extends StatelessWidget { class BottomSheetDialogButton extends StatelessWidget {
final Function onTap; final VoidCallback? onTap;
final String label; final String? label;
double headerHeight = SizeConfig.heightMultiplier * 12; double headerHeight = SizeConfig.heightMultiplier * 12;

@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RemarkText extends StatelessWidget { class RemarkText extends StatelessWidget {
final String remark; final String? remark;
const RemarkText({ const RemarkText({
Key key, this.remark, Key? key, this.remark,
}) : super(key: key); }) : super(key: key);
@override @override

@ -7,8 +7,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class RemoveButton extends StatelessWidget { class RemoveButton extends StatelessWidget {
final Function onTap; final VoidCallback? onTap;
final String label; final String? label;
const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key); const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key);

@ -4,10 +4,10 @@ import 'package:flutter/material.dart';
class StepDetailsWidget extends StatelessWidget { class StepDetailsWidget extends StatelessWidget {
final String stepLabel; final String stepLabel;
final double marginLeft; final double? marginLeft;
const StepDetailsWidget({ const StepDetailsWidget({
Key key, this.stepLabel, this.marginLeft = 0, Key? key, required this.stepLabel, this.marginLeft = 0,
}) : super(key: key); }) : super(key: key);
@override @override

@ -6,9 +6,9 @@ import 'package:hexcolor/hexcolor.dart';
class StatusLabel extends StatelessWidget { class StatusLabel extends StatelessWidget {
const StatusLabel({ const StatusLabel({
Key key, Key? key,
this.stepId, required this.stepId,
this.selectedStepId, required this.selectedStepId,
}) : super(key: key); }) : super(key: key);
final int stepId; final int stepId;

@ -17,10 +17,10 @@ class StepsWidget extends StatelessWidget {
StepsWidget( StepsWidget(
{Key? key, {Key? key,
this.index, required this.index,
this.changeCurrentTab, required this.changeCurrentTab,
this.height = 0.0, this.height = 0.0,
this.patientInfo}); required this.patientInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -52,7 +52,7 @@ class StepsWidget extends StatelessWidget {
child: Container( child: Container(
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width *
(patientInfo.admissionNo == null || (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty patientInfo.admissionNo!.isEmpty
? 0.9 ? 0.9
: 0.85), : 0.85),
child: Divider( child: Divider(
@ -115,7 +115,7 @@ class StepsWidget extends StatelessWidget {
Positioned( Positioned(
top: circleTop, top: circleTop,
left: patientInfo.admissionNo == null || left: patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty patientInfo.admissionNo!.isEmpty
? MediaQuery.of(context).size.width * 0.25 ? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.71, : MediaQuery.of(context).size.width * 0.71,
child: InkWell( child: InkWell(
@ -167,7 +167,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: MediaQuery.of(context).size.width * 0.47, left: MediaQuery.of(context).size.width * 0.47,
@ -222,7 +222,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: 0, right: 0,
@ -289,7 +289,7 @@ class StepsWidget extends StatelessWidget {
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.9:0.85), patientInfo.admissionNo!.isEmpty?0.9:0.85),
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
@ -349,7 +349,7 @@ class StepsWidget extends StatelessWidget {
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.25:0.71), patientInfo.admissionNo!.isEmpty?0.25:0.71),
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -396,7 +396,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery.of(context).size.width * 0.50, right: MediaQuery.of(context).size.width * 0.50,
@ -451,7 +451,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: 0, left: 0,

@ -100,7 +100,7 @@ class _AddAllergiesState extends State<AddAllergies> {
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
getServiceSelectedAllergy: (master) => getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master), getSelectedAllergy(master)!, hintSearchText: '', buttonName: '',
), ),
), ),
), ),

@ -27,12 +27,12 @@ class AddAllergiesItem extends StatefulWidget {
const AddAllergiesItem( const AddAllergiesItem(
{Key? key, {Key? key,
this.model, required this.model,
this.removeAllergy, required this.removeAllergy,
this.addAllergy, required this.addAllergy,
this.isServiceSelected, required this.isServiceSelected,
this.getServiceSelectedAllergy, required this.getServiceSelectedAllergy,
this.item}) required this.item})
: super(key: key); : super(key: key);
@override @override
@ -40,7 +40,7 @@ class AddAllergiesItem extends StatefulWidget {
} }
class _AddAllergiesItemState extends State<AddAllergiesItem> { class _AddAllergiesItemState extends State<AddAllergiesItem> {
MasterKeyModel _selectedAllergySeverity; late MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false; bool isSubmitted = false;
@override @override
@ -48,7 +48,7 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
bool isSelected = widget.isServiceSelected(widget.item); bool isSelected = widget.isServiceSelected(widget.item);
MySelectedAllergy mySelectedAllergy; MySelectedAllergy mySelectedAllergy =MySelectedAllergy() ;
if (isSelected) { if (isSelected) {
mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item); mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item);
} }
@ -58,8 +58,8 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
text: isSelected text: isSelected
? mySelectedAllergy.selectedAllergySeverity != null ? mySelectedAllergy.selectedAllergySeverity != null
? projectViewModel.isArabic ? projectViewModel.isArabic
? mySelectedAllergy.selectedAllergySeverity.nameAr ? mySelectedAllergy.selectedAllergySeverity!.nameAr
: mySelectedAllergy.selectedAllergySeverity.nameEn : mySelectedAllergy.selectedAllergySeverity!.nameEn
: null : null
: null); : null);
return HeaderBodyExpandableNotifier( return HeaderBodyExpandableNotifier(
@ -71,7 +71,7 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
Checkbox( Checkbox(
value: widget.isServiceSelected(widget.item), value: widget.isServiceSelected(widget.item),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool ?newValue) {
onTapItem(); onTapItem();
}), }),
InkWell( InkWell(
@ -97,12 +97,12 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
if (mySelectedAllergy != null) { if (mySelectedAllergy != null) {
setState(() { setState(() {
mySelectedAllergy.isExpanded = mySelectedAllergy.isExpanded =
mySelectedAllergy.isExpanded ? false : true; mySelectedAllergy.isExpanded! ? false : true;
}); });
} }
}, },
child: Icon( child: Icon(
(mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false) (mySelectedAllergy!.isExpanded!)
? EvaIcons.arrowIosUpwardOutline ? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline, : EvaIcons.arrowIosDownwardOutline,
color: Color(0xFF575757), color: Color(0xFF575757),
@ -142,14 +142,14 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
} }
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity + "*", hintText: TranslationBase.of(context).selectSeverity! + "*",
enabled: false, enabled: false,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
height: Helpers.getTextFieldHeight(), height: Helpers.getTextFieldHeight(),
validationError: mySelectedAllergy != null && validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError mySelectedAllergy!.hasValidationError!
? TranslationBase.of(context).severityValidationError ? TranslationBase.of(context).severityValidationError
: null, : null,
controller: severityController, controller: severityController,

@ -25,15 +25,15 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
MasterKeyCheckboxSearchAllergiesWidget( MasterKeyCheckboxSearchAllergiesWidget(
{Key? key, {Key? key,
this.model, required this.model,
this.addSelectedAllergy, required this.addSelectedAllergy,
this.removeAllergy, required this.removeAllergy,
this.masterList, required this.masterList,
this.addAllergy, required this.addAllergy,
this.isServiceSelected, required this.isServiceSelected,
this.buttonName, required this.buttonName,
this.hintSearchText, required this.hintSearchText,
this.getServiceSelectedAllergy}) required this.getServiceSelectedAllergy})
: super(key: key); : super(key: key);
@override @override
@ -80,7 +80,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.black, color: Colors.black,
)), ), onPressed: () { },),
), ),
DividerWithSpacesAround(), DividerWithSpacesAround(),
SizedBox( SizedBox(
@ -127,8 +127,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((items) { dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) { items.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items); dummyListData.add(items);
} }
}); });

@ -77,11 +77,11 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy ? selectedAllergy
.selectedAllergySeverity.nameAr .selectedAllergySeverity!.nameAr
: selectedAllergy : selectedAllergy
.selectedAllergySeverity.nameEn .selectedAllergySeverity!.nameEn!
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy!.isChecked!
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
color: Color(0xFFCC9B14), color: Color(0xFFCC9B14),
@ -132,7 +132,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
.toList(); .toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if (allergy.first.isLocal) { if (allergy!.first!.isLocal!) {
setState(() { setState(() {
widget.myAllergiesList.remove(allergy.first); widget.myAllergiesList.remove(allergy.first);
}); });
@ -165,9 +165,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere( if ((widget.myAllergiesList.singleWhere(
(it) => (it) =>
it.selectedAllergy.id == it.selectedAllergy!.id ==
element.selectedAllergy.id, element.selectedAllergy!.id,)) ==
orElse: () => null)) ==
null) { null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
@ -178,9 +177,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
widget.myAllergiesList.forEach((element) { widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere( if ((mySelectedAllergy.singleWhere(
(it) => (it) =>
it.selectedAllergy.id == it.selectedAllergy!.id ==
element.selectedAllergy.id, element.selectedAllergy!.id)) ==
orElse: () => null)) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }

@ -59,7 +59,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: appBar:
BottomSheetTitle(title: TranslationBase.of(context).addHistory), BottomSheetTitle(title: TranslationBase.of(context).addHistory!),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(

@ -70,9 +70,9 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerPr
letterSpacing: -0.48,), letterSpacing: -0.48,),
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
if (myHistory.isChecked) if (myHistory!.isChecked!)
RemoveButton( RemoveButton(
onTap: () => removeHistory(myHistory.selectedHistory), onTap: () => removeHistory(myHistory!.selectedHistory!),
) )
], ],
), ),
@ -97,7 +97,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerPr
.toList(); .toList();
if (history.length > 0){ if (history.length > 0){
if (history.first.isLocal) { if (history!.first!.isLocal!) {
setState(() { setState(() {
widget.myHistoryList.remove(history.first); widget.myHistoryList.remove(history.first);
}); });

@ -10,7 +10,8 @@ class LineChartCurved extends StatelessWidget {
final List<TimeSeriesSales2> timeSeries; final List<TimeSeriesSales2> timeSeries;
final int indexes; final int indexes;
LineChartCurved({required this.title, required this.timeSeries, required this.indexes}); LineChartCurved(
{required this.title, required this.timeSeries, required this.indexes});
List<int> xAxixs = []; List<int> xAxixs = [];
List<double> yAxixs = []; List<double> yAxixs = [];
@ -105,11 +106,12 @@ class LineChartCurved extends StatelessWidget {
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
@ -129,7 +131,9 @@ class LineChartCurved extends StatelessWidget {
return ''; return '';
} }
} else { } else {
if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { if (value.toInt() == 0 ||
value.toInt() == timeSeries.length - 1 ||
xAxixs.contains(value.toInt())) {
DateTime dateTime = timeSeries[value.toInt()].time; DateTime dateTime = timeSeries[value.toInt()].time;
if (isDatesSameYear) { if (isDatesSameYear) {
return monthFormat.format(dateTime); return monthFormat.format(dateTime);
@ -159,7 +163,7 @@ class LineChartCurved extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
@ -235,7 +239,9 @@ class LineChartCurved extends StatelessWidget {
int previousDateYear = 0; int previousDateYear = 0;
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { if (isDatesSameYear == false ||
(previousDateYear != 0 &&
previousDateYear != timeSeries[index].time.year)) {
isDatesSameYear = false; isDatesSameYear = false;
} }
previousDateYear = timeSeries[index].time.year; previousDateYear = timeSeries[index].time.year;

@ -58,7 +58,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), padding:
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
@ -77,12 +78,15 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
Container( Container(
width: 20, width: 20,
height: 20, height: 20,
decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Theme.of(context).primaryColor),
), ),
SizedBox( SizedBox(
width: 5, width: 5,
), ),
AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng) AppText(
isOX ? "SAO2" : TranslationBase.of(context).systolicLng)
], ],
), ),
SizedBox( SizedBox(
@ -93,7 +97,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
Container( Container(
width: 20, width: 20,
height: 20, height: 20,
decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red), decoration: BoxDecoration(
shape: BoxShape.rectangle, color: Colors.red),
), ),
SizedBox( SizedBox(
width: 5, width: 5,
@ -129,11 +134,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
@ -160,7 +166,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (context, value) => TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -20,7 +20,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
int? projectID; int? projectID;
bool isNotOneAppointment; bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); VitalSignDetailsScreen(
{this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,7 +36,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
String assetBasePath = "${imageBasePath}patient/vital_signs/"; String assetBasePath = "${imageBasePath}patient/vital_signs/";
return BaseView<VitalSignsViewModel>( return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient), onModelReady: (model) =>
model.getPatientVitalSignHistory(patient, from, to, isInpatient),
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
baseViewModel: mode, baseViewModel: mode,
isShowAppBar: true, isShowAppBar: true,
@ -74,7 +76,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.23, height: MediaQuery.of(context).size.height * 0.23,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: Colors.white, color: Colors.white,
@ -98,13 +101,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 1 mode.getBMIStatus() != 1
? '${assetBasePath}underweight_BMI.png' ? '${assetBasePath}underweight_BMI.png'
: '${assetBasePath}underweight_BMI-r.png', : '${assetBasePath}underweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10, height: MediaQuery.of(context)
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -112,28 +119,38 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiUnderWeight}", "${TranslationBase.of(context).bmiUnderWeight}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
AppText( AppText(
"(<18.5)", "(<18.5)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, SizeConfig.textMultiplier * 1.15,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 2 mode.getBMIStatus() != 2
? '${assetBasePath}health_BMI.png' ? '${assetBasePath}health_BMI.png'
: '${assetBasePath}health_BMI-r.png', : '${assetBasePath}health_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10, height: MediaQuery.of(context)
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -142,29 +159,40 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText( child: AppText(
"${TranslationBase.of(context).normal}", "${TranslationBase.of(context).normal}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
SizeConfig.textMultiplier *
1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
), ),
), ),
AppText( AppText(
"(18.5-24.9)", "(18.5-24.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 2
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 3 mode.getBMIStatus() != 3
? '${assetBasePath}ovrweight_BMI.png' ? '${assetBasePath}ovrweight_BMI.png'
: '${assetBasePath}ovrweight_BMI-r.png', : '${assetBasePath}ovrweight_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10, height: MediaQuery.of(context)
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -172,28 +200,38 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiOverWeight}", "${TranslationBase.of(context).bmiOverWeight}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155, fontSize:
SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
), ),
AppText( AppText(
"(25-29.9)", "(25-29.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.155, fontSize:
SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 3
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 4 mode.getBMIStatus() != 4
? '${assetBasePath}Obese_BMI.png' ? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png', : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10, height: MediaQuery.of(context)
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -201,28 +239,38 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiObese}", "${TranslationBase.of(context).bmiObese}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
), ),
AppText( AppText(
"(30-34.9)", "(30-34.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 4
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 5 mode.getBMIStatus() != 5
? '${assetBasePath}Obese_BMI.png' ? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png', : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context).size.height * 0.10, height: MediaQuery.of(context)
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -232,17 +280,24 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText( child: AppText(
"${TranslationBase.of(context).bmiObeseExtreme}", "${TranslationBase.of(context).bmiObeseExtreme}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
SizeConfig.textMultiplier *
1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
), ),
), ),
AppText( AppText(
"(35<)", "(35<)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.15, fontSize:
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, color: mode.getBMIStatus() == 5
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
@ -254,7 +309,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -270,10 +326,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.Height, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).height, pageKey: vitalSignDetails
vitalList: mode.patientVitalSignsHistory, .Height,
pageTitle:
TranslationBase.of(
context)
.height,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -283,28 +345,40 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null, : null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).height!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}height.png", .height!,
imagePath:
"${assetBasePath}height.png",
lastVal: mode.heightCm, lastVal: mode.heightCm,
unit: TranslationBase.of(context).cm!, unit: TranslationBase.of(context)
.cm!,
), ),
), ),
), ),
if (isNotOneAppointment) if (isNotOneAppointment)
InkWell( InkWell(
onTap: () async { onTap: () async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>()
eventCategory: "Vital Sign Details Screen", .logEvent(
eventAction: "Vital Sign Details", eventCategory:
"Vital Sign Details Screen",
eventAction:
"Vital Sign Details",
); );
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.Weight, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).weight, pageKey:
vitalList: mode.patientVitalSignsHistory, vitalSignDetails.Weight,
pageTitle:
TranslationBase.of(
context)
.weight,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -313,9 +387,12 @@ class VitalSignDetailsScreen extends StatelessWidget {
); );
}, },
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).weight!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}weight.png", .weight!,
unit: TranslationBase.of(context).kg!, imagePath:
"${assetBasePath}weight.png",
unit: TranslationBase.of(context)
.kg!,
lastVal: mode.weightKg, lastVal: mode.weightKg,
), ),
), ),
@ -324,10 +401,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.Temperature, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).temperature, pageKey: vitalSignDetails
vitalList: mode.patientVitalSignsHistory, .Temperature,
pageTitle:
TranslationBase.of(
context)
.temperature,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -337,10 +420,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null, : null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).temperature!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}temperature.png", .temperature!,
imagePath:
"${assetBasePath}temperature.png",
lastVal: mode.temperatureCelcius, lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context).tempC!, unit: TranslationBase.of(context)
.tempC!,
), ),
), ),
), ),
@ -349,10 +435,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.heart, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).heart, pageKey: vitalSignDetails
vitalList: mode.patientVitalSignsHistory, .heart,
pageTitle:
TranslationBase.of(
context)
.heart,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -361,10 +453,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).heart!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}heart_rate.png", .heart!,
imagePath:
"${assetBasePath}heart_rate.png",
lastVal: mode.hartRat, lastVal: mode.hartRat,
unit: TranslationBase.of(context).bpm!, unit: TranslationBase.of(context)
.bpm!,
), ),
), ),
InkWell( InkWell(
@ -372,10 +467,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.Respiration, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).respirationRate, pageKey: vitalSignDetails
vitalList: mode.patientVitalSignsHistory, .Respiration,
pageTitle:
TranslationBase.of(
context)
.respirationRate,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -384,10 +485,14 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).respirationRate!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}respiration_rate.png", .respirationRate!,
lastVal: mode.respirationBeatPerMinute, imagePath:
unit: TranslationBase.of(context).respirationSigns!, "${assetBasePath}respiration_rate.png",
lastVal:
mode.respirationBeatPerMinute,
unit: TranslationBase.of(context)
.respirationSigns!,
), ),
), ),
InkWell( InkWell(
@ -395,10 +500,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.BloodPressure, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).bloodPressure, pageKey: vitalSignDetails
vitalList: mode.patientVitalSignsHistory, .BloodPressure,
pageTitle:
TranslationBase.of(
context)
.bloodPressure,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -407,10 +518,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).bloodPressure!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}blood_pressure.png", .bloodPressure!,
imagePath:
"${assetBasePath}blood_pressure.png",
lastVal: mode.bloodPressure, lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias!, unit: TranslationBase.of(context)
.sysDias!,
), ),
), ),
InkWell( InkWell(
@ -418,10 +532,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.Oxygenation, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).oxygenation, pageKey: vitalSignDetails
vitalList: mode.patientVitalSignsHistory, .Oxygenation,
pageTitle:
TranslationBase.of(
context)
.oxygenation,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -430,8 +550,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).oxygenation!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}oxg.png", .oxygenation!,
imagePath:
"${assetBasePath}oxg.png",
lastVal: "${mode.oxygenation}%", lastVal: "${mode.oxygenation}%",
unit: "", unit: "",
), ),
@ -441,10 +563,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page:
pageKey: vitalSignDetails.PainScale, VitalSignItemDetailsScreen(
pageTitle: TranslationBase.of(context).painScale, pageKey: vitalSignDetails
vitalList: mode.patientVitalSignsHistory, .PainScale,
pageTitle:
TranslationBase.of(
context)
.painScale,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -453,10 +581,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).painScale!, des: TranslationBase.of(context)
imagePath: "${assetBasePath}painScale.png", .painScale!,
imagePath:
"${assetBasePath}painScale.png",
lastVal: mode.painScore, lastVal: mode.painScore,
unit: TranslationBase.of(context).severe!, unit: TranslationBase.of(context)
.severe!,
), ),
), ),
], ],
@ -475,7 +606,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
: Container( : Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).vitalSignEmptyMsg, error: TranslationBase.of(context).vitalSignEmptyMsg!,
)), )),
), ),
); );

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class CustomEditableText extends StatefulWidget { class CustomEditableText extends StatefulWidget {
CustomEditableText({ CustomEditableText({
Key key, Key? key,
required this.controller, required this.controller,
this.hint, this.hint,
this.isEditable = false, this.isEditable = false,
@ -15,9 +15,9 @@ class CustomEditableText extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
final String hint; final String? hint;
bool isEditable; bool isEditable;
final bool isSubmitted; final bool? isSubmitted;
@override @override
_CustomEditableTextState createState() => _CustomEditableTextState(); _CustomEditableTextState createState() => _CustomEditableTextState();
@ -80,7 +80,7 @@ class _CustomEditableTextState extends State<CustomEditableText> {
//TranslationBase.of(context).addoperationReports, //TranslationBase.of(context).addoperationReports,
controller: widget.controller, controller: widget.controller,
validationError: validationError:
widget.controller.text.isEmpty && widget.isSubmitted widget.controller.text.isEmpty && widget.isSubmitted!
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
maxLines: 1, maxLines: 1,

@ -39,12 +39,15 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'CustomEditableText.dart'; import 'CustomEditableText.dart';
class RegisterConfirmationPatientPage extends StatefulWidget { class RegisterConfirmationPatientPage extends StatefulWidget {
final OperationReportViewModel operationReportViewModel; final OperationReportViewModel? operationReportViewModel;
final PatiantInformtion patient; final PatiantInformtion? patient;
final PatientRegistrationViewModel model; final PatientRegistrationViewModel model;
const RegisterConfirmationPatientPage( const RegisterConfirmationPatientPage(
{Key? key, this.operationReportViewModel, this.patient, this.model}) {Key? key,
this.operationReportViewModel,
this.patient,
required this.model})
: super(key: key); : super(key: key);
@override @override
@ -55,14 +58,14 @@ class RegisterConfirmationPatientPage extends StatefulWidget {
class _RegisterConfirmationPatientPageState class _RegisterConfirmationPatientPageState
extends State<RegisterConfirmationPatientPage> { extends State<RegisterConfirmationPatientPage> {
bool isSubmitted = false; bool isSubmitted = false;
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
TextEditingController firstNameN; late TextEditingController firstNameN;
TextEditingController middleNameN; late TextEditingController middleNameN;
TextEditingController lastNameN; late TextEditingController lastNameN;
TextEditingController firstNameAr; late TextEditingController firstNameAr;
TextEditingController middleNameAr; late TextEditingController middleNameAr;
TextEditingController lastNameAr; late TextEditingController lastNameAr;
TextEditingController emailAddressController; late TextEditingController emailAddressController;
TextEditingController langController = TextEditingController(text: "English"); TextEditingController langController = TextEditingController(text: "English");
int selectedLang = 1; int selectedLang = 1;
@ -392,8 +395,8 @@ class _RegisterConfirmationPatientPageState
print( print(
widget.model.getPatientInfoResponseModel.dateOfBirth); widget.model.getPatientInfoResponseModel.dateOfBirth);
var dateFormat = DateFormat('MM/dd/yyyy').parse( var dateFormat = DateFormat('MM/dd/yyyy').parse(widget
widget.model.getPatientInfoResponseModel.dateOfBirth); .model.getPatientInfoResponseModel.dateOfBirth!);
String wellFormat = String wellFormat =
"${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}";
print( print(
@ -425,7 +428,7 @@ class _RegisterConfirmationPatientPageState
strDateofBirth: dateFormat.toUtc().toString(), strDateofBirth: dateFormat.toUtc().toString(),
dateofBirth: AppDateUtils.convertToServerFormat( dateofBirth: AppDateUtils.convertToServerFormat(
widget.model.getPatientInfoResponseModel widget.model.getPatientInfoResponseModel
.dateOfBirth, .dateOfBirth!,
'MM/dd/yyyy'), 'MM/dd/yyyy'),
dateofBirthN: '$hijriDate', dateofBirthN: '$hijriDate',
gender: (widget.model.getPatientInfoResponseModel.gender == "M") gender: (widget.model.getPatientInfoResponseModel.gender == "M")

@ -20,7 +20,7 @@ class RegisterPatientPage extends StatefulWidget {
class _RegisterPatientPageState extends State<RegisterPatientPage> class _RegisterPatientPageState extends State<RegisterPatientPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
PageController _controller; late PageController _controller;
int _currentIndex = 0; int _currentIndex = 0;
bool _isLoading = false; bool _isLoading = false;
@ -61,7 +61,7 @@ class _RegisterPatientPageState extends State<RegisterPatientPage>
isShowAppBar: true, isShowAppBar: true,
isLoading: _isLoading, isLoading: _isLoading,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: TranslationBase.of(context).registeraPatient, title: TranslationBase.of(context).registeraPatient!,
), ),
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -30,7 +30,7 @@ class RegisterSearchPatientPage extends StatefulWidget {
final PatientRegistrationViewModel model; final PatientRegistrationViewModel model;
const RegisterSearchPatientPage( const RegisterSearchPatientPage(
{Key? key, this.changePageViewIndex, this.model}) {Key? key, required this.changePageViewIndex, required this.model})
: super(key: key); : super(key: key);
@override @override
@ -39,10 +39,10 @@ class RegisterSearchPatientPage extends StatefulWidget {
} }
class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> { class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
String countryError; late String countryError;
dynamic _selectedCountry; dynamic _selectedCountry;
List<dynamic> countryList; late List<dynamic> countryList;
dynamic country; dynamic country;
@ -52,14 +52,14 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
TextEditingController(text: "508079569"); TextEditingController(text: "508079569");
TextEditingController _phoneCode = TextEditingController(text: "966"); TextEditingController _phoneCode = TextEditingController(text: "966");
String phoneError; late String phoneError;
TextEditingController _idController = TextEditingController _idController =
TextEditingController(text: "1062938285"); TextEditingController(text: "1062938285");
String idError; late String idError;
DateTime _birthDateInGregorian; late DateTime _birthDateInGregorian;
String birthdateError; late String birthdateError;
var birthDateInHijri = new HijriCalendar.now(); var birthDateInHijri = new HijriCalendar.now();
CalenderType calenderType = CalenderType.Gregorian; CalenderType calenderType = CalenderType.Gregorian;
@ -191,9 +191,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
title: AppText("Gregorian"), title: AppText("Gregorian"),
value: CalenderType.Gregorian, value: CalenderType.Gregorian,
groupValue: calenderType, groupValue: calenderType,
onChanged: (CalenderType value) { onChanged: (CalenderType? value) {
setState(() { setState(() {
calenderType = value; calenderType = value!;
}); });
}, },
), ),
@ -203,9 +203,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
title: AppText("Hijri"), title: AppText("Hijri"),
value: CalenderType.Hijri, value: CalenderType.Hijri,
groupValue: calenderType, groupValue: calenderType,
onChanged: (CalenderType value) { onChanged: (CalenderType? value) {
setState(() { setState(() {
calenderType = value; calenderType = value!;
}); });
}, },
), ),
@ -221,7 +221,8 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
dropDownText: getBirthdate(), dropDownText: getBirthdate(),
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: _birthDateInGregorian == null && isSubmitted validationError:
_birthDateInGregorian == null && isSubmitted
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
suffixIcon: IconButton( suffixIcon: IconButton(
@ -240,7 +241,8 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
setState(() { setState(() {
if (calenderType == CalenderType.Hijri) { if (calenderType == CalenderType.Hijri) {
birthDateInHijri = selectedDate; birthDateInHijri = selectedDate;
_birthDateInGregorian = HijriCalendar().hijriToGregorian( _birthDateInGregorian = HijriCalendar()
.hijriToGregorian(
birthDateInHijri.hYear, birthDateInHijri.hYear,
birthDateInHijri.hMonth, birthDateInHijri.hMonth,
birthDateInHijri.hDay); birthDateInHijri.hDay);
@ -249,8 +251,8 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
} else { } else {
_birthDateInGregorian = selectedDate; _birthDateInGregorian = selectedDate;
birthDateInHijri = HijriCalendar() birthDateInHijri = HijriCalendar()
.gregorianToHijri( .gregorianToHijri(selectedDate.year,
selectedDate.year, selectedDate.month, selectedDate.day); selectedDate.month, selectedDate.day);
print(_birthDateInGregorian); print(_birthDateInGregorian);
print(birthDateInHijri); print(birthDateInHijri);
@ -307,9 +309,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
isSubmitted = true; isSubmitted = true;
}); });
if (country == null) { if (country == null) {
countryError = TranslationBase.of(context).fieldRequired; countryError = TranslationBase.of(context).fieldRequired!;
} else { } else {
countryError = null; countryError = "";
} }
if (isFormValid()) { if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -397,7 +399,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
); );
if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH); if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH);
} else { } else {
final DateTime picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: dateTime ?? DateTime.now(), initialDate: dateTime ?? DateTime.now(),
firstDate: DateTime(DateTime.now().year - 150), firstDate: DateTime(DateTime.now().year - 150),
@ -432,16 +434,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
} }
getBirthdate() { getBirthdate() {
if (calenderType == CalenderType.Hijri) { if (calenderType == CalenderType.Hijri) {
return birthDateInHijri != null return birthDateInHijri != null ? "$birthDateInHijri" : null;
? "$birthDateInHijri"
: null;
} else { } else {
return _birthDateInGregorian != null return _birthDateInGregorian != null
? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}" ? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}"
: null; : null;
} }
} }
} }

@ -16,7 +16,7 @@ class ActivationPage extends StatefulWidget {
final PatientRegistrationViewModel model; final PatientRegistrationViewModel model;
final Function changePageViewIndex; final Function changePageViewIndex;
ActivationPage({this.model, this.changePageViewIndex}); ActivationPage({required this.model, required this.changePageViewIndex});
@override @override
_ActivationPageState createState() => _ActivationPageState(); _ActivationPageState createState() => _ActivationPageState();
@ -393,7 +393,7 @@ class _ActivationPageState extends State<ActivationPage> {
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.validationMessage + .validationMessage! +
' ', ' ',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
@ -481,7 +481,6 @@ class _ActivationPageState extends State<ActivationPage> {
sendActivationCode(type) async { sendActivationCode(type) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.sendActivationCodeByOTPNotificationType(otpType: type); await widget.model.sendActivationCodeByOTPNotificationType(otpType: type);
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.model.error); Helpers.showErrorToast(widget.model.error);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -35,7 +35,8 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { addPrescriptionForm(context, PrescriptionViewModel model,
PatiantInformtion patient, prescription) {
showModalBottomSheet( showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
@ -60,7 +61,8 @@ postPrescription(
String? icdCode, String? icdCode,
PatiantInformtion? patient, PatiantInformtion? patient,
String? patientType}) async { String? patientType}) async {
PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> prescriptionList = []; List<PrescriptionRequestModel> prescriptionList = [];
postProcedureReqModel.appointmentNo = patient!.appointmentNo; postProcedureReqModel.appointmentNo = patient!.appointmentNo;
@ -125,7 +127,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
DateTime? selectedDate; DateTime? selectedDate;
int? strengthChar; int? strengthChar;
GetMedicationResponseModel? _selectedMedication; GetMedicationResponseModel? _selectedMedication;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController(); TextEditingController drugIdController = TextEditingController();
TextEditingController doseController = TextEditingController(); TextEditingController doseController = TextEditingController();
@ -169,7 +172,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
@ -212,7 +216,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech); print(hasSpeech);
if (!mounted) return; if (!mounted) return;
} }
@ -257,13 +262,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
initialChildSize: 0.98, initialChildSize: 0.98,
maxChildSize: 0.98, maxChildSize: 0.98,
minChildSize: 0.9, minChildSize: 0.9,
builder: (BuildContext context, ScrollController scrollController) { builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 1.65, height: MediaQuery.of(context).size.height * 1.65,
color: Color(0xffF8F8F8), color: Color(0xffF8F8F8),
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0),
child: Column( child: Column(
children: [ children: [
Column( Column(
@ -285,8 +292,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppTextFormField( child: AppTextFormField(
onTap: () { onTap: () {
@ -294,7 +304,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
visbiltySearch = true; visbiltySearch = true;
}, },
borderColor: Colors.white, borderColor: Colors.white,
hintText: TranslationBase.of(context).searchMedicineNameHere, hintText: TranslationBase.of(context)
.searchMedicineNameHere,
controller: myController, controller: myController,
onSaved: (value) {}, onSaved: (value) {},
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
@ -320,9 +331,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: <Widget>[ children: <Widget>[
// TODO change it secondary button and add loading // TODO change it secondary button and add loading
AppButton( AppButton(
title: TranslationBase.of(context).search, title: TranslationBase.of(
context)
.search,
onPressed: () async { onPressed: () async {
await searchMedicine(context, model); await searchMedicine(
context, model);
}, },
), ),
], ],
@ -331,23 +345,44 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
if (myController.text != '') if (myController.text != '')
Container( Container(
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context)
.size
.height *
0.5,
child: ListView.builder( child: ListView.builder(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(
top: 20),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.allMedicationList == null itemCount:
model.allMedicationList ==
null
? 0 ? 0
: model.allMedicationList.length, : model
itemBuilder: (BuildContext context, int index) { .allMedicationList
.length,
itemBuilder:
(BuildContext context,
int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: model.allMedicationList[index].description), label: model
.allMedicationList[
index]
.description),
onTap: () { onTap: () {
model.getItem(itemID: model.allMedicationList[index].itemId!); model.getItem(
visbiltyPrescriptionForm = true; itemID: model
.allMedicationList[
index]
.itemId!);
visbiltyPrescriptionForm =
true;
visbiltySearch = false; visbiltySearch = false;
_selectedMedication = model.allMedicationList[index]; _selectedMedication =
uom = _selectedMedication!.uom; model.allMedicationList[
index];
uom = _selectedMedication!
.uom;
}, },
); );
}, },
@ -366,53 +401,69 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column( child: Column(
children: [ children: [
AppText( AppText(
_selectedMedication?.description ?? "", _selectedMedication?.description ??
"",
bold: true, bold: true,
), ),
Container( Container(
child: Row( child: Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).orderType, TranslationBase.of(context)
.orderType,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor:
Color(0xFFB9382C),
value: 1, value: 1,
groupValue: selectedType, groupValue: selectedType,
onChanged: (int? value) { onChanged: (int? value) {
setSelectedType(value!); setSelectedType(value!);
}, },
), ),
Text(TranslationBase.of(context).regular ?? ""), Text(TranslationBase.of(context)
.regular ??
""),
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
Container( Container(
width: double.infinity, width: double.infinity,
child: Row( child: Row(
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context)
.size
.width *
0.35,
child: AppTextFieldCustom( child: AppTextFieldCustom(
height: 40, height: 40,
validationError: strengthError, validationError:
strengthError,
hintText: 'Strength', hintText: 'Strength',
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
enabled: true, enabled: true,
controller: strengthController, controller:
strengthController,
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar =
value.length;
}); });
if (strengthChar! >= 5) { if (strengthChar! >= 5) {
DrAppToastMsg.showErrorToast( DrAppToastMsg
TranslationBase.of(context).only5DigitsAllowedForStrength, .showErrorToast(
TranslationBase.of(
context)
.only5DigitsAllowedForStrength,
); );
} }
}, },
inputType: TextInputType.numberWithOptions( inputType: TextInputType
.numberWithOptions(
decimal: true, decimal: true,
), ),
), ),
@ -422,15 +473,23 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
PrescriptionTextFiled( PrescriptionTextFiled(
isSubmitted: isSubmitted, isSubmitted: isSubmitted,
width: MediaQuery.of(context).size.width * 0.517, width: MediaQuery.of(context)
element: model.itemMedicineListUnit.length == 1 .size
? model.itemMedicineListUnit[0] .width *
0.517,
element: model
.itemMedicineListUnit
.length ==
1
? model
.itemMedicineListUnit[0]
: units, : units,
elementError: unitError, elementError: unitError!,
keyName: 'description', keyName: 'description',
keyId: 'parameterCode', keyId: 'parameterCode',
hintText: 'Select', hintText: 'Select',
elementList: model.itemMedicineListUnit, elementList: model
.itemMedicineListUnit,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
units = selectedValue; units = selectedValue;
@ -441,14 +500,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled( PrescriptionTextFiled(
isSubmitted: isSubmitted, isSubmitted: isSubmitted,
elementList: model.itemMedicineListRoute, elementList:
element: model.itemMedicineListRoute.length == 1 model.itemMedicineListRoute,
element: model.itemMedicineListRoute
.length ==
1
? model.itemMedicineListRoute[0] ? model.itemMedicineListRoute[0]
: route, : route,
elementError: routeError, elementError: routeError!,
keyId: 'parameterCode', keyId: 'parameterCode',
keyName: 'description', keyName: 'description',
okFunction: (selectedValue) { okFunction: (selectedValue) {
@ -457,44 +520,69 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
route['isDefault'] = true; route['isDefault'] = true;
}); });
}, },
hintText: TranslationBase.of(context).route ?? "", hintText:
TranslationBase.of(context)
.route ??
"",
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled( PrescriptionTextFiled(
isSubmitted: isSubmitted, isSubmitted: isSubmitted,
hintText: TranslationBase.of(context).frequency ?? "", hintText:
elementError: frequencyError ?? "", TranslationBase.of(context)
element: model.itemMedicineList.length == 1 .frequency ??
? frequency = model.itemMedicineList[0] "",
elementError:
frequencyError ?? "",
element: model.itemMedicineList
.length ==
1
? frequency =
model.itemMedicineList[0]
: frequency, : frequency,
elementList: model.itemMedicineList, elementList:
model.itemMedicineList,
keyId: 'parameterCode', keyId: 'parameterCode',
keyName: 'description', keyName: 'description',
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
frequency = selectedValue; frequency = selectedValue;
frequency['isDefault'] = true; frequency['isDefault'] = true;
if (_selectedMedication != null && if (_selectedMedication !=
null &&
duration != null && duration != null &&
frequency != null && frequency != null &&
strengthController.text != null) { strengthController.text !=
null) {
model.getBoxQuantity( model.getBoxQuantity(
freq: frequency['parameterCode'], freq: frequency[
duration: duration['id'], 'parameterCode'],
itemCode: _selectedMedication!.itemId!, duration:
strength: double.parse(strengthController.text)); duration['id'],
itemCode:
_selectedMedication!
.itemId!,
strength: double.parse(
strengthController
.text));
return; return;
} }
}); });
}), }),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled( PrescriptionTextFiled(
isSubmitted: isSubmitted, isSubmitted: isSubmitted,
hintText: TranslationBase.of(context).doseTime ?? "", hintText:
TranslationBase.of(context)
.doseTime ??
"",
elementError: doseTimeError ?? "", elementError: doseTimeError ?? "",
element: doseTime, element: doseTime,
elementList: model.medicationDoseTimeList, elementList:
model.medicationDoseTimeList,
keyId: 'id', keyId: 'id',
keyName: 'nameEn', keyName: 'nameEn',
okFunction: (selectedValue) { okFunction: (selectedValue) {
@ -502,8 +590,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTime = selectedValue; doseTime = selectedValue;
}); });
}), }),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
if (model.patientAssessmentList.isNotEmpty) height: spaceBetweenTextFileds),
if (model
.patientAssessmentList.isNotEmpty)
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
width: double.infinity, width: double.infinity,
@ -511,24 +601,48 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.29, width:
MediaQuery.of(context)
.size
.width *
0.29,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
model.patientAssessmentList[0].icdCode10ID.toString(), textFieldSelectorDecoration(
indication != null ? indication['name'] : null, model
.patientAssessmentList[
0]
.icdCode10ID
.toString(),
indication != null
? indication[
'name']
: null,
false), false),
enabled: true, enabled: true,
readOnly: true, readOnly: true,
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.59, width:
MediaQuery.of(context)
.size
.width *
0.59,
color: Colors.white, color: Colors.white,
child: TextField( child: TextField(
maxLines: 5, maxLines: 5,
decoration: textFieldSelectorDecoration( decoration:
model.patientAssessmentList[0].asciiDesc.toString(), textFieldSelectorDecoration(
indication != null ? indication['name'] : null, model
.patientAssessmentList[
0]
.asciiDesc
.toString(),
indication != null
? indication[
'name']
: null,
false), false),
enabled: true, enabled: true,
readOnly: true, readOnly: true,
@ -537,15 +651,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
onTap: () => selectDate(context, widget.model), onTap: () => selectDate(
context, widget.model),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
TranslationBase.of(context).date ?? "", textFieldSelectorDecoration(
TranslationBase.of(
context)
.date ??
"",
selectedDate != null selectedDate != null
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null, : null,
@ -558,27 +678,39 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled( PrescriptionTextFiled(
isSubmitted: isSubmitted, isSubmitted: isSubmitted,
element: duration, element: duration,
elementError: durationError ?? "", elementError: durationError ?? "",
hintText: TranslationBase.of(context).duration ?? "", hintText:
elementList: model.medicationDurationList, TranslationBase.of(context)
.duration ??
"",
elementList:
model.medicationDurationList,
keyName: 'nameEn', keyName: 'nameEn',
keyId: 'id', keyId: 'id',
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
duration = selectedValue; duration = selectedValue;
if (_selectedMedication != null && if (_selectedMedication !=
null &&
duration != null && duration != null &&
frequency != null && frequency != null &&
strengthController.text != null) { strengthController.text !=
null) {
model.getBoxQuantity( model.getBoxQuantity(
freq: frequency['parameterCode'], freq: frequency[
'parameterCode'],
duration: duration['id'], duration: duration['id'],
itemCode: _selectedMedication!.itemId!, itemCode:
strength: double.parse(strengthController.text), _selectedMedication!
.itemId!,
strength: double.parse(
strengthController
.text),
); );
box = model.boxQuintity; box = model.boxQuintity;
@ -587,38 +719,53 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
}, },
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
Container( Container(
color: Colors.white, color: Colors.white,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: "UOM", hintText: "UOM",
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
dropDownText: uom != null ? uom : null, dropDownText:
uom != null ? uom : null,
enabled: false, enabled: false,
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
Container( Container(
color: Colors.white, color: Colors.white,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).boxQuantity, hintText:
TranslationBase.of(context)
.boxQuantity,
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
dropDownText: box != null ? model.boxQuintity.toString() : null, dropDownText: box != null
? model.boxQuintity.toString()
: null,
enabled: false, enabled: false,
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
child: Stack( child: Stack(
children: [ children: [
TextFields( TextFields(
maxLines: 6, maxLines: 6,
minLines: 4, minLines: 4,
hintText: TranslationBase.of(context).instruction, hintText: TranslationBase.of(
controller: instructionController, context)
.instruction,
controller:
instructionController,
//keyboardType: TextInputType.number, //keyboardType: TextInputType.number,
), ),
Positioned( Positioned(
@ -631,51 +778,77 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
size: 35, size: 35,
), ),
onPressed: () { onPressed: () {
initSpeechState().then((value) => {onVoiceText()}); initSpeechState().then(
(value) =>
{onVoiceText()});
}, },
), ),
), ),
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(
height: spaceBetweenTextFileds),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
color: Color(0xff359846), color: Color(0xff359846),
title: TranslationBase.of(context).addMedication, title: TranslationBase.of(
context)
.addMedication,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onPressed: () async { onPressed: () async {
await locator<AnalyticsService>().logEvent( await locator<
eventCategory: "Add Prescription Form", AnalyticsService>()
eventAction: "Add Prescription", .logEvent(
eventCategory:
"Add Prescription Form",
eventAction:
"Add Prescription",
); );
if (duration != null && if (duration != null &&
doseTime != null && doseTime != null &&
frequency != null && frequency != null &&
selectedDate != null && selectedDate != null &&
strengthController.text != "") { strengthController
if (_selectedMedication!.isNarcotic == true) { .text !=
DrAppToastMsg.showErrorToast(TranslationBase.of(context) "") {
if (_selectedMedication!
.isNarcotic ==
true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.narcoticMedicineCanOnlyBePrescribedFromVida); .narcoticMedicineCanOnlyBePrescribedFromVida);
// Navigator.pop(context); // Navigator.pop(context);
return; return;
} }
if (double.parse(strengthController.text) > 1000.0) { if (double.parse(
DrAppToastMsg.showErrorToast( strengthController
.text) >
1000.0) {
DrAppToastMsg
.showErrorToast(
"1000 is the MAX for the strength"); "1000 is the MAX for the strength");
return; return;
} }
if (double.parse(strengthController.text) < 0.0) { if (double.parse(
DrAppToastMsg.showErrorToast("strength can't be zero"); strengthController
.text) <
0.0) {
DrAppToastMsg
.showErrorToast(
"strength can't be zero");
return; return;
} }
if (formKey.currentState!.validate()) { if (formKey.currentState!
.validate()) {
Navigator.pop(context); Navigator.pop(context);
openDrugToDrug(model); openDrugToDrug(model);
{ {
@ -765,39 +938,60 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
setState(() { setState(() {
isSubmitted = true; isSubmitted = true;
if (duration == null) { if (duration == null) {
durationError = TranslationBase.of(context).fieldRequired; durationError =
TranslationBase.of(
context)
.fieldRequired;
} else { } else {
durationError = ""; durationError = "";
} }
if (doseTime == null) { if (doseTime == null) {
doseTimeError = TranslationBase.of(context).fieldRequired; doseTimeError =
TranslationBase.of(
context)
.fieldRequired;
} else { } else {
doseTimeError = ""; doseTimeError = "";
} }
if (route == null) { if (route == null) {
routeError = TranslationBase.of(context).fieldRequired; routeError =
TranslationBase.of(
context)
.fieldRequired;
} else { } else {
routeError = ""; routeError = "";
} }
if (frequency == null) { if (frequency == null) {
frequencyError = TranslationBase.of(context).fieldRequired; frequencyError =
TranslationBase.of(
context)
.fieldRequired;
} else { } else {
frequencyError = ""; frequencyError = "";
} }
if (units == null) { if (units == null) {
unitError = TranslationBase.of(context).fieldRequired; unitError =
TranslationBase.of(
context)
.fieldRequired;
} else { } else {
unitError = ""; unitError = "";
} }
if (strengthController.text == "") { if (strengthController
strengthError = TranslationBase.of(context).fieldRequired; .text ==
"") {
strengthError =
TranslationBase.of(
context)
.fieldRequired;
} else { } else {
strengthError = ""; strengthError = "";
} }
}); });
} }
formKey.currentState!.save(); formKey.currentState!
.save();
}, },
), ),
], ],
@ -840,7 +1034,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} }
} }
InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, InputDecoration textFieldSelectorDecoration(
String? hintText, String? selectedText, bool isDropDown,
{Icon? suffixIcon}) { {Icon? suffixIcon}) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -891,7 +1086,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
DrugToDrug(widget.patient, getPriscriptionforDrug(widget.prescriptionList, model), DrugToDrug(
widget.patient,
getPriscriptionforDrug(widget.prescriptionList, model),
model.patientAssessmentList), model.patientAssessmentList),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
@ -902,23 +1099,28 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
postPrescription( postPrescription(
icdCode: model.patientAssessmentList.isNotEmpty icdCode: model.patientAssessmentList.isNotEmpty
? model.patientAssessmentList[0].icdCode10ID.isEmpty ? model.patientAssessmentList[0].icdCode10ID
.isEmpty
? "test" ? "test"
: model.patientAssessmentList[0].icdCode10ID.toString() : model.patientAssessmentList[0].icdCode10ID
.toString()
: "test", : "test",
dose: strengthController.text, dose: strengthController.text,
doseUnit: model.itemMedicineListUnit.length == 1 doseUnit: model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['parameterCode'].toString() ? model.itemMedicineListUnit[0]['parameterCode']
.toString()
: units['parameterCode'].toString(), : units['parameterCode'].toString(),
patient: widget.patient, patient: widget.patient,
doseTimeIn: doseTime['id'].toString(), doseTimeIn: doseTime['id'].toString(),
model: widget.model, model: widget.model,
duration: duration['id'].toString(), duration: duration['id'].toString(),
frequency: model.itemMedicineList.length == 1 frequency: model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode'].toString() ? model.itemMedicineList[0]['parameterCode']
.toString()
: frequency['parameterCode'].toString(), : frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1 route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString() ? model.itemMedicineListRoute[0]['parameterCode']
.toString()
: route['parameterCode'].toString(), : route['parameterCode'].toString(),
drugId: _selectedMedication!.itemId.toString(), drugId: _selectedMedication!.itemId.toString(),
strength: strengthController.text, strength: strengthController.text,
@ -937,7 +1139,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
} }
getPriscriptionforDrug(List<PrescriptionModel> prescriptionList, MedicineViewModel model) { getPriscriptionforDrug(
List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
var prescriptionDetails = []; var prescriptionDetails = [];
if (prescriptionList.length > 0) { if (prescriptionList.length > 0) {
prescriptionList[0].entityList!.forEach((element) { prescriptionList[0].entityList!.forEach((element) {

@ -37,9 +37,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController = new TextEditingController();
TextEditingController _toDateController2 = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController();
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
SickLeaveViewModel sickLeaveViewModel; late SickLeaveViewModel sickLeaveViewModel;
String _selectedClinic; late String _selectedClinic;
Map profile = {}; Map profile = {};
var offTime = '1'; var offTime = '1';
var date; var date;
@ -48,8 +48,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDate; dynamic fromDate;
dynamic toDate; dynamic toDate;
var clinicID; var clinicID;
String fromTime; late String fromTime;
String toTime; late String toTime;
TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller4 = new TextEditingController();
TextEditingController _controller5 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController();
void _presentDatePicker(id) { void _presentDatePicker(id) {
@ -99,7 +99,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime; offTime = widget.updateData != null
? widget.updateData.requisitionType.toString()
: offTime;
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
@ -119,7 +121,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: AppScaffold( child: AppScaffold(
baseViewModel: model2, baseViewModel: model2,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves, appBarTitle: TranslationBase.of(context).rescheduleLeaves!,
body: Center( body: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
@ -127,136 +129,25 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
widthFactor: 0.9, widthFactor: 0.9,
child: ListView( child: ListView(
children: [ children: [
// Container(
// margin: EdgeInsets.all(8),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(6.0)),
// border: Border.all(
// width: 1.0,
// color: HexColor("#CCCCCC"))),
// width: double.infinity,
// child: Padding(
// padding: EdgeInsets.only(
// top: SizeConfig.widthMultiplier * 0.9,
// bottom:
// SizeConfig.widthMultiplier * 0.9,
// right: SizeConfig.widthMultiplier * 3,
// left: SizeConfig.widthMultiplier * 3),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Expanded(
// // add Expanded to have your dropdown button fill remaining space
// child:
// DropdownButtonHideUnderline(
// child: new IgnorePointer(
// ignoring: true,
// child: DropdownButton(
// focusColor:
// Colors.grey,
// isExpanded: true,
// dropdownColor:
// Colors.grey,
// value: getClinicName(
// model) ??
// "",
// iconSize: 0,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext
// context) {
// return model
// .getClinicNameList()
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize
// .max,
// children: <
// Widget>[
// AppText(
// item,
// fontSize:
// SizeConfig.textMultiplier *
// 2.1,
// color: Colors
// .grey[
// 500],
// ),
// ],
// );
// }).toList();
// },
// onChanged:
// (newValue) =>
// {},
// items: model
// .getClinicNameList()
// .map((item) {
// return DropdownMenuItem(
// value: item
// .toString(),
// child: Text(
// item,
// textAlign:
// TextAlign
// .end,
// ),
// );
// }).toList(),
// ))),
// ),
// ],
// )
// ],
// ),
// )),
// Container(
// margin: EdgeInsets.all(8),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.all(Radius.circular(6.0)),
// border: Border.all(
// width: 1.0,
// color: HexColor("#CCCCCC"))),
// padding: EdgeInsets.all(5),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// new IgnorePointer(
// ignoring: true,
// child: AppTextFormField(
// readOnly: true,
// hintText: profile != null
// ? profile['DoctorName']
// : "",
// borderColor: Colors.white,
// onSaved: (value) {},
// inputFormatter: ONLY_NUMBERS))
// ],
// ),
// ),
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
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(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -264,22 +155,35 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.allOffTime.length > 0 model2.allOffTime.length > 0
? 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: DropdownButton( DropdownButtonHideUnderline(
child:
DropdownButton(
// focusColor: Colors.grey, // focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: offTime == null ? model2.allOffTime[0]['code'] : offTime, value: offTime == null
? model2.allOffTime[0]
['code']
: offTime,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: (BuildContext context) { selectedItemBuilder:
return model2.allOffTime.map((item) { (BuildContext
context) {
return model2.allOffTime
.map((item) {
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize:
MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
item['description'], item[
'description'],
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig
.textMultiplier *
2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -293,21 +197,29 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
}); });
if (offTime == '1') { if (offTime == '1') {
model2.getReasons(18); model2.getReasons(18);
} else if (offTime == '2') { } else if (offTime ==
'2') {
model2.getReasons(19); model2.getReasons(19);
} else if (offTime == '3' || offTime == '5') { } else if (offTime ==
model2.getReasons(102); '3' ||
offTime == '5') {
model2
.getReasons(102);
setState(() { setState(() {
offTime = newValue; offTime = newValue;
}); });
} }
}, },
items: model2.allOffTime.map((item) { items: model2.allOffTime
return DropdownMenuItem<String>( .map((item) {
value: item['code'].toString(), return DropdownMenuItem<
String>(
value: item['code']
.toString(),
child: Text( child: Text(
item['description'], item['description'],
textAlign: TextAlign.end, textAlign:
TextAlign.end,
), ),
); );
}).toList(), }).toList(),
@ -325,24 +237,39 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
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(
hintText: TranslationBase.of(context).fromDate, hintText: TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)), prefix: IconButton(
textInputType: TextInputType.number, icon: Icon(
Icons.calendar_today),
onPressed: () {},
),
textInputType:
TextInputType.number,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
_presentDatePicker('fromDate'); _presentDatePicker(
'fromDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (val) => fromDate = val, onChanged: (val) =>
onSaved: (val) => fromDate = val, fromDate = val,
onSaved: (val) =>
fromDate = val,
) )
], ],
)), )),
@ -352,24 +279,37 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Container( child: Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius:
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), BorderRadius.all(
Radius.circular(
6.0)),
border: Border.all(
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: [
DateTimePicker( DateTimePicker(
timeHintText: TranslationBase.of(context).fromTime, timeHintText:
type: DateTimePickerType.time, TranslationBase.of(
context)
.fromTime,
type: DateTimePickerType
.time,
controller: _controller4, controller: _controller4,
onChanged: (val) => fromTime = val, onChanged: (val) =>
fromTime = val,
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
// () => _valueToValidate4 = val); // () => _valueToValidate4 = val);
return null; return null;
}, },
onSaved: (val) => fromTime = val, onSaved: (val) =>
fromTime = val!,
) )
], ],
), ),
@ -379,24 +319,37 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Container( child: Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius:
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), BorderRadius.all(
Radius.circular(
6.0)),
border: Border.all(
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: [
DateTimePicker( DateTimePicker(
timeHintText: TranslationBase.of(context).toTime, timeHintText:
type: DateTimePickerType.time, TranslationBase.of(
context)
.toTime,
type: DateTimePickerType
.time,
controller: _controller5, controller: _controller5,
onChanged: (val) => toTime = val, onChanged: (val) =>
toTime = val,
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
// () => _valueToValidate4 = val); // () => _valueToValidate4 = val);
return null; return null;
}, },
onSaved: (val) => toTime = val, onSaved: (val) =>
toTime = val!,
) )
], ],
), ),
@ -411,21 +364,36 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
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(
hintText: TranslationBase.of(context).fromDate, hintText:
TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)), prefix: IconButton(
textInputType: TextInputType.number, icon: Icon(
Icons.calendar_today),
onPressed: () {},
),
textInputType:
TextInputType.number,
readOnly: true, readOnly: true,
controller: _toDateController, controller:
_toDateController,
onTap: () { onTap: () {
_presentDatePicker('fromDate'); _presentDatePicker(
'fromDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
@ -438,21 +406,36 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
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(
hintText: TranslationBase.of(context).toDate, hintText:
TranslationBase.of(
context)
.toDate,
readOnly: true, readOnly: true,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton(icon: Icon(Icons.calendar_today)), prefix: IconButton(
textInputType: TextInputType.number, icon: Icon(
controller: _toDateController2, Icons.calendar_today),
onPressed: () {},
),
textInputType:
TextInputType.number,
controller:
_toDateController2,
onTap: () { onTap: () {
_presentDatePicker('toDate'); _presentDatePicker(
'toDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
@ -467,17 +450,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
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(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -485,23 +473,39 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.allReasons.length > 0 model2.allReasons.length > 0
? 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: DropdownButton( DropdownButtonHideUnderline(
child:
DropdownButton(
focusColor: Colors.grey, focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: model2.allReasons[0]['id'].toString() ?? "", value: model2
.allReasons[0]
['id']
.toString() ??
"",
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: (BuildContext context) { selectedItemBuilder:
return model2.allReasons.map((item) { (BuildContext
context) {
return model2.allReasons
.map((item) {
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize:
MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
projectsProvider.isArabic projectsProvider
? item['nameAr'] .isArabic
: item['nameEn'], ? item[
fontSize: SizeConfig.textMultiplier * 2.1, 'nameAr']
: item[
'nameEn'],
fontSize: SizeConfig
.textMultiplier *
2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -514,12 +518,20 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
reason = newValue; reason = newValue;
}) })
}, },
items: model2.allReasons.map((item) { items: model2.allReasons
return DropdownMenuItem<String>( .map((item) {
value: item['id'].toString(), return DropdownMenuItem<
String>(
value: item['id']
.toString(),
child: Text( child: Text(
projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], projectsProvider
textAlign: TextAlign.end, .isArabic
? item['nameAr']
: item[
'nameEn'],
textAlign:
TextAlign.end,
), ),
); );
}).toList(), }).toList(),
@ -535,56 +547,81 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
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(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
model2.coveringDoctors.length > 0 if (model2.coveringDoctors.length >
? Expanded( 0)
Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownSearch( child: DropdownSearch(
mode: Mode.BOTTOM_SHEET, mode: Mode.BOTTOM_SHEET,
dropdownSearchDecoration: InputDecoration( dropdownSearchDecoration:
contentPadding: EdgeInsets.all(0), border: InputBorder.none), InputDecoration(
contentPadding:
EdgeInsets.all(0),
border:
InputBorder.none),
//maxHeight: 300, //maxHeight: 300,
items: model2.coveringDoctors.map((item) { items: model2.coveringDoctors
return projectsProvider.isArabic .map((item) {
return projectsProvider
.isArabic
? item['doctorNameN'] ? item['doctorNameN']
: item['doctorName']; : item['doctorName'];
}).toList(), }).toList(),
// label: "Doctor List", // label: "Doctor List",
onChanged: (item) { onChanged: (item) {
model2.coveringDoctors.forEach((newVal) => { model2.coveringDoctors
if (newVal['doctorName'] == item) .forEach((newVal) => {
doctorID = newVal['DoctorID'] if (newVal[
'doctorName'] ==
item)
doctorID = newVal[
'DoctorID']
}); });
}, },
selectedItem: getSelectedDoctor(model2), selectedItem:
getSelectedDoctor(model2),
showSearchBox: true, showSearchBox: true,
searchBoxDecoration: InputDecoration( searchBoxDecoration:
border: OutlineInputBorder(), InputDecoration(
contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), border:
OutlineInputBorder(),
contentPadding:
EdgeInsets.fromLTRB(
12, 12, 8, 0),
labelText: "Search Doctor", labelText: "Search Doctor",
), ),
popupTitle: Container( popupTitle: Container(
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColorDark, color: Theme.of(context)
borderRadius: BorderRadius.only( .primaryColorDark,
topLeft: Radius.circular(20), borderRadius:
topRight: Radius.circular(20), BorderRadius.only(
topLeft:
Radius.circular(20),
topRight:
Radius.circular(20),
), ),
), ),
child: Center( child: Center(
@ -592,82 +629,27 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
'', '',
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
), ),
popupShape: RoundedRectangleBorder( popupShape:
borderRadius: BorderRadius.only( RoundedRectangleBorder(
topLeft: Radius.circular(24), borderRadius:
topRight: Radius.circular(24), BorderRadius.only(
topLeft:
Radius.circular(24),
topRight:
Radius.circular(24),
), ),
), ),
), ),
// DropdownButtonHideUnderline(
// child: DropdownButton(
// focusColor: Colors.grey,
// isExpanded: true,
// value: doctorID == null
// ? model2
// .coveringDoctors[0]
// ['doctorID']
// .toString()
// : doctorID,
// iconSize: 40,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext context) {
// return model2
// .coveringDoctors
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize.max,
// children: <Widget>[
// AppText(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// fontSize: SizeConfig
// .textMultiplier *
// 2.1,
// ),
// ],
// );
// }).toList();
// },
// onChanged: (newValue) => {
// setState(() {
// doctorID = newValue;
// })
// },
// items: model2
// .coveringDoctors
// .map((item) {
// return DropdownMenuItem<
// String>(
// value: item['doctorID']
// .toString(),
// child: Text(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// textAlign:
// TextAlign.start,
// ),
// );
// }).toList(),
// )),
) )
: SizedBox(), else
SizedBox(),
], ],
) )
], ],
@ -675,14 +657,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
)), )),
SizedBox(height: SizeConfig.screenHeight * .3), SizedBox(height: SizeConfig.screenHeight * .3),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.isUpdate == true title: widget.isUpdate == true
? TranslationBase.of(context).updateReschedule ? TranslationBase.of(context)
: TranslationBase.of(context).addReschedule, .updateReschedule
: TranslationBase.of(context)
.addReschedule,
color: HexColor('#359846'), color: HexColor('#359846'),
onPressed: () { onPressed: () {
if (offTime == '1' || offTime == '2') { if (offTime == '1' || offTime == '2') {
@ -692,7 +677,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
addRecheduleLeave(model2); addRecheduleLeave(model2);
} }
} else { } else {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.onlyOfftimeHoliday);
} }
}, },
), ),
@ -725,13 +712,16 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
final df = new DateFormat('HH:mm:ss'); final df = new DateFormat('HH:mm:ss');
final dateFormat = new DateFormat('yyyy-MM-dd'); final dateFormat = new DateFormat('yyyy-MM-dd');
this.offTime = widget.updateData.requisitionType.toString(); this.offTime = widget.updateData.requisitionType.toString();
_toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); _toDateController.text =
dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
//df.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime =
df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3);
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
this.toTime = this.toTime.substring(0, this.toTime.length - 3); this.toTime = this.toTime.substring(0, this.toTime.length - 3);
_toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _toDateController2.text =
dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
_controller5.text = toTime; _controller5.text = toTime;
_controller4.text = fromTime; _controller4.text = fromTime;
toDate = _toDateController2.text; toDate = _toDateController2.text;
@ -744,7 +734,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
getClinicName(model) { getClinicName(model) {
var clinicID = this.profile['ClinicID'] ?? 1; var clinicID = this.profile['ClinicID'] ?? 1;
var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); var clinicInfo =
model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
} }
@ -754,10 +745,16 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var fromDates = fromDate; var fromDates = fromDate;
var toDates = toDate; var toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format( fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); 'T' +
toDate = df fromTime +
.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); ':' +
DateTime.now().second.toString()));
toDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
'T' +
toTime +
':' +
DateTime.now().second.toString()));
} else { } else {
fromDate = df.format(fromDates); fromDate = df.format(fromDates);
toDate = df.format(toDates); toDate = df.format(toDates);
@ -772,7 +769,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": offTime == '1' ? fromDate : df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "coveringDoctorId":
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2, "status": 2,
"schedule": [ "schedule": [
{ {
@ -795,7 +793,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') builder: (context) => AddRescheduleLeavScreen(),
settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
// MyReferredPatient(), // MyReferredPatient(),
), ),
); );
@ -810,13 +809,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDates = fromDate; dynamic fromDates = fromDate;
dynamic toDates = toDate; dynamic toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = fromDate = df.format(DateTime.parse(_toDateController.text)) +
df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); 'T' +
toDate = fromTime +
df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); ':' +
DateTime.now().second.toString();
toDate = df.format(DateTime.parse(_toDateController2.text)) +
'T' +
toTime +
':' +
DateTime.now().second.toString();
} else { } else {
fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); fromDate = df.format(
toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
toDate =
df.format(toDates is DateTime ? toDates : DateTime.parse(toDates));
} }
Map<String, dynamic> request = { Map<String, dynamic> request = {
@ -829,7 +836,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": offTime == '1' ? fromDate : df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "coveringDoctorId":
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2, "status": 2,
"schedule": [ "schedule": [
{ {
@ -867,7 +875,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
: model2.coveringDoctors[0]['doctorName']; : model2.coveringDoctors[0]['doctorName'];
else { else {
model2.coveringDoctors.forEach((newVal) => { model2.coveringDoctors.forEach((newVal) => {
if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} if (newVal['doctorID'].toString() == doctorID)
{doctorName = newVal['doctorName']}
}); });
return doctorName; return doctorName;
} }

@ -8,8 +8,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProfileMedicalInfoWidgetSearch extends StatefulWidget { class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
final String from; final String? from;
final String to; final String? to;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String? arrivalType; final String? arrivalType;
@ -21,8 +21,8 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
required this.patient, required this.patient,
required this.patientType, required this.patientType,
this.arrivalType, this.arrivalType,
required this.from, this.from,
required this.to, this.to,
this.isInpatient = false, this.isInpatient = false,
this.isDischargedPatient}); this.isDischargedPatient});

@ -315,7 +315,7 @@ packages:
name: dropdown_search name: dropdown_search
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3" version: "2.0.1"
equatable: equatable:
dependency: transitive dependency: transitive
description: description:

@ -45,7 +45,7 @@ dependencies:
#Icons #Icons
eva_icons_flutter: ^3.0.0 eva_icons_flutter: ^3.0.0
font_awesome_flutter: ^9.0.0 font_awesome_flutter: ^9.0.0
dropdown_search: ^0.6.1 dropdown_search: ^2.0.1
flutter_staggered_grid_view: ^0.4.0 flutter_staggered_grid_view: ^0.4.0
expandable: ^5.0.1 expandable: ^5.0.1

Loading…
Cancel
Save