Fixing some design issues in refer-patient-screen-in-patient and refer-patient-screen

roaa_redesign_labs
RoaaGhali98 4 years ago
parent 59d7fc4e76
commit 486594240e

@ -6,8 +6,10 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dar
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -158,24 +160,14 @@ class _PatientMakeInPatientReferralScreenState
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( SizedBox(
margin: EdgeInsets.all(16.0), height: 10,
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, Padding(
children: [ padding: const EdgeInsets.all(8.0),
AppText( child: ServiceTitle(
"${TranslationBase.of(context).refer}", title: TranslationBase.of(context).refer,
fontFamily: 'Poppins', subTitle: TranslationBase.of(context).patient,
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
), ),
), ),
Container( Container(
@ -398,23 +390,32 @@ class _PatientMakeInPatientReferralScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppText( Padding(
"${TranslationBase.of(context).priority}", padding: const EdgeInsets.all(4.0),
fontFamily: 'Poppins', child: AppText(
fontSize: SizeConfig.textMultiplier * 2.0, "${TranslationBase.of(context).priority}",
fontWeight: FontWeight.w600, fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: FontWeight.w600,
),
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
priorityBar(context, screenSize), Padding(
padding: const EdgeInsets.all(3.0),
child: priorityBar(context, screenSize),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppText( Padding(
"${TranslationBase.of(context).replayBefore}: ${getPriority()}", padding: const EdgeInsets.all(4.0),
fontWeight: FontWeight.normal, child: AppText(
fontSize: SizeConfig.textMultiplier * 1.9, "${TranslationBase.of(context).replayBefore}: ${getPriority()}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.9,
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -475,7 +476,6 @@ class _PatientMakeInPatientReferralScreenState
), ),
Positioned( Positioned(
top: 0, top: 0,
//MediaQuery.of(context).size.height * 0,
right: 15, right: 15,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
@ -510,75 +510,73 @@ class _PatientMakeInPatientReferralScreenState
}); });
}, },
)), )),
Container( SizedBox(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), height: 10,
child: AppButton( ),
title: TranslationBase.of(context).refer, BottomSheetDialogButton(
fontWeight: FontWeight.w700, label: "${TranslationBase.of(context).refer}",
color: Color(0XFF359846), onTap: () async {
onPressed: () async { setState(() {
setState(() { if (_referTo == null) {
if (_referTo == null) { branchError =
branchError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired; } else {
} else { branchError = null;
branchError = null;
}
if (_selectedBranch == null) {
hospitalError =
TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if (_selectedFrequency == null) {
frequencyError =
TranslationBase.of(context).fieldRequired;
} else {
frequencyError = null;
}
});
if (_selectedFrequency == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null ||
_extController.text == null) return;
{
await model.makeInPatientReferral(
patient: patient,
projectID: _selectedBranch['facilityId'],
clinicID: _selectedClinic['ClinicID'],
doctorID: _selectedDoctor['DoctorID'],
frequencyCode:
_selectedFrequency['ParameterCode'],
ext: _extController.text,
remarks: _remarksController.text,
priority: _activePriority,
referralDate: appointmentDate);
if (model.state == ViewState.ErrorLocal)
DrAppToastMsg.showErrorToast(model.error);
else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsg);
Navigator.pop(context);
}
} }
}, if (_selectedBranch == null) {
), hospitalError =
) TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if (_selectedFrequency == null) {
frequencyError =
TranslationBase.of(context).fieldRequired;
} else {
frequencyError = null;
}
});
if (_selectedFrequency == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null ||
_extController.text == null) return;
{
await model.makeInPatientReferral(
patient: patient,
projectID: _selectedBranch['facilityId'],
clinicID: _selectedClinic['ClinicID'],
doctorID: _selectedDoctor['DoctorID'],
frequencyCode:
_selectedFrequency['ParameterCode'],
ext: _extController.text,
remarks: _remarksController.text,
priority: _activePriority,
referralDate: appointmentDate);
if (model.state == ViewState.ErrorLocal)
DrAppToastMsg.showErrorToast(model.error);
else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsg);
Navigator.pop(context);
}
}
},
),
], ],
) )
], ],
@ -597,6 +595,7 @@ class _PatientMakeInPatientReferralScreenState
]; ];
return Container( return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
width: screenSize.width * 0.95,
decoration: decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row( child: Row(

@ -5,10 +5,12 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dar
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -85,26 +87,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
/*PatientProfileHeaderNewDesign( Padding(
patient, patientType, arrivalType),*/ padding: const EdgeInsets.all(8.0),
Container( child: ServiceTitle(
margin: EdgeInsets.all(16.0), title: TranslationBase.of(context).refer,
child: Column( subTitle: TranslationBase.of(context).patient,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refer}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
), ),
), ),
model.patientReferral.length == 0 model.patientReferral.length == 0
@ -165,66 +152,119 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
.referredByDoctorInfo, .referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
), ),
SizedBox(
height: 10,
),
], ],
), ),
if (model.patientReferral.length == 0) if (model.patientReferral.length == 0)
Container( BottomSheetDialogButton(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), label: "${TranslationBase.of(context).refer}",
child: AppButton( onTap: () async {
title: TranslationBase.of(context).refer, await locator<AnalyticsService>().logEvent(
fontWeight: FontWeight.w700,
color: HexColor("#359846"),
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Refer Patient", eventCategory: "Refer Patient",
eventAction: "Submit Refer", eventAction: "Submit Refer",
); );
if (_referTo == null) { if (_referTo == null) {
branchError = branchError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
branchError = null; branchError = null;
} }
if (_selectedBranch == null) { if (_selectedBranch == null) {
hospitalError = hospitalError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
hospitalError = null; hospitalError = null;
} }
if (_selectedClinic == null) { if (_selectedClinic == null) {
clinicError = clinicError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
clinicError = null; clinicError = null;
} }
if (_selectedDoctor == null) { if (_selectedDoctor == null) {
doctorError = doctorError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
doctorError = null; doctorError = null;
} }
if (appointmentDate == null || if (appointmentDate == null ||
_selectedBranch == null || _selectedBranch == null ||
_selectedClinic == null || _selectedClinic == null ||
_selectedDoctor == null || _selectedDoctor == null ||
_remarksController.text == null) return; _remarksController.text == null) return;
model model
.makeReferral( .makeReferral(
patient, patient,
appointmentDate.toIso8601String(), appointmentDate.toIso8601String(),
_selectedBranch['facilityId'], _selectedBranch['facilityId'],
_selectedClinic['ClinicID'], _selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'], _selectedDoctor['DoctorID'],
_remarksController.text) _remarksController.text)
.then((_) { .then((_) {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg); TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context); Navigator.pop(context);
}); });
}, }
), ),
) // child: AppButton(
// title: TranslationBase.of(context).refer,
// fontWeight: FontWeight.w700,
// color: HexColor("#359846"),
// onPressed: () async {
// await locator<AnalyticsService>().logEvent(
// eventCategory: "Refer Patient",
// eventAction: "Submit Refer",
// );
// if (_referTo == null) {
// branchError =
// TranslationBase.of(context).fieldRequired;
// } else {
// branchError = null;
// }
// if (_selectedBranch == null) {
// hospitalError =
// TranslationBase.of(context).fieldRequired;
// } else {
// hospitalError = null;
// }
// if (_selectedClinic == null) {
// clinicError =
// TranslationBase.of(context).fieldRequired;
// } else {
// clinicError = null;
// }
// if (_selectedDoctor == null) {
// doctorError =
// TranslationBase.of(context).fieldRequired;
// } else {
// doctorError = null;
// }
//
// if (appointmentDate == null ||
// _selectedBranch == null ||
// _selectedClinic == null ||
// _selectedDoctor == null ||
// _remarksController.text == null) return;
// model
// .makeReferral(
// patient,
// appointmentDate.toIso8601String(),
// _selectedBranch['facilityId'],
// _selectedClinic['ClinicID'],
// _selectedDoctor['DoctorID'],
// _remarksController.text)
// .then((_) {
// DrAppToastMsg.showSuccesToast(
// TranslationBase.of(context).referralSuccessMsg);
// Navigator.pop(context);
// });
// },
// ),
], ],
), ),
), ),

Loading…
Cancel
Save