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/models/patient/patiant_info_model.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/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/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -158,24 +160,14 @@ class _PatientMakeInPatientReferralScreenState
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.all(16.0),
child: Column(
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,
)
],
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ServiceTitle(
title: TranslationBase.of(context).refer,
subTitle: TranslationBase.of(context).patient,
),
),
Container(
@ -398,23 +390,32 @@ class _PatientMakeInPatientReferralScreenState
SizedBox(
height: 10,
),
AppText(
"${TranslationBase.of(context).priority}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: FontWeight.w600,
Padding(
padding: const EdgeInsets.all(4.0),
child: AppText(
"${TranslationBase.of(context).priority}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: FontWeight.w600,
),
),
SizedBox(
height: 4,
),
priorityBar(context, screenSize),
Padding(
padding: const EdgeInsets.all(3.0),
child: priorityBar(context, screenSize),
),
SizedBox(
height: 10,
),
AppText(
"${TranslationBase.of(context).replayBefore}: ${getPriority()}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.9,
Padding(
padding: const EdgeInsets.all(4.0),
child: AppText(
"${TranslationBase.of(context).replayBefore}: ${getPriority()}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.9,
),
),
SizedBox(
height: 10,
@ -475,7 +476,6 @@ class _PatientMakeInPatientReferralScreenState
),
Positioned(
top: 0,
//MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
@ -510,75 +510,73 @@ class _PatientMakeInPatientReferralScreenState
});
},
)),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).refer,
fontWeight: FontWeight.w700,
color: Color(0XFF359846),
onPressed: () async {
setState(() {
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 (_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);
}
SizedBox(
height: 10,
),
BottomSheetDialogButton(
label: "${TranslationBase.of(context).refer}",
onTap: () async {
setState(() {
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 (_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(
height: screenSize.height * 0.070,
width: screenSize.width * 0.95,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
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/models/patient/patiant_info_model.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/dr_app_toast_msg.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_service_title.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_texts_widget.dart';
@ -85,26 +87,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/*PatientProfileHeaderNewDesign(
patient, patientType, arrivalType),*/
Container(
margin: EdgeInsets.all(16.0),
child: Column(
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,
)
],
Padding(
padding: const EdgeInsets.all(8.0),
child: ServiceTitle(
title: TranslationBase.of(context).refer,
subTitle: TranslationBase.of(context).patient,
),
),
model.patientReferral.length == 0
@ -165,66 +152,119 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
.referredByDoctorInfo,
clinicDescription: null,
),
SizedBox(
height: 10,
),
],
),
if (model.patientReferral.length == 0)
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).refer,
fontWeight: FontWeight.w700,
color: HexColor("#359846"),
onPressed: () async {
await locator<AnalyticsService>().logEvent(
BottomSheetDialogButton(
label: "${TranslationBase.of(context).refer}",
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Refer Patient",
eventAction: "Submit Refer",
);
if (_referTo == null) {
);
if (_referTo == null) {
branchError =
TranslationBase.of(context).fieldRequired;
} else {
TranslationBase.of(context).fieldRequired;
} else {
branchError = null;
}
if (_selectedBranch == null) {
}
if (_selectedBranch == null) {
hospitalError =
TranslationBase.of(context).fieldRequired;
} else {
TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
}
if (_selectedClinic == null) {
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
}
if (_selectedDoctor == null) {
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
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((_) {
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);
TranslationBase.of(context).referralSuccessMsg);
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