|
|
|
|
@ -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(
|
|
|
|
|
|