|
|
|
|
@ -1,17 +1,14 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.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/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_loader_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/dialogs/dailog-list-select.dart';
|
|
|
|
|
@ -20,8 +17,6 @@ import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../QR_reader_screen.dart';
|
|
|
|
|
|
|
|
|
|
class PatientMakeReferralScreen extends StatefulWidget {
|
|
|
|
|
// previous design page is: ReferPatientScreen
|
|
|
|
|
@override
|
|
|
|
|
@ -96,6 +91,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
model.patientReferral.length == 0
|
|
|
|
|
? ReferralForm(model, screenSize)
|
|
|
|
|
: PatientReferralItemWidget(
|
|
|
|
|
"${model.patientReferral[0].patientID}",
|
|
|
|
|
patientName: model.patientReferral[0].patientName,
|
|
|
|
|
referralStatus:
|
|
|
|
|
"${model.patientReferral[0].referralStatus}",
|
|
|
|
|
@ -105,7 +101,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
referralDoctorName:
|
|
|
|
|
model.patientReferral[0].referredByDoctorInfo,
|
|
|
|
|
clinicDescription: null,
|
|
|
|
|
remark: model.patientReferral[0].remarksFromSource),
|
|
|
|
|
remark: model.patientReferral[0].remarksFromSource,
|
|
|
|
|
referredOn: model.patientReferral[0].referredOn,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (model.patientReferral.length == 0)
|
|
|
|
|
@ -201,7 +199,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).referTo,
|
|
|
|
|
_referTo != null ? _referTo['name'] : null,
|
|
|
|
|
true),
|
|
|
|
|
@ -248,7 +246,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).branch,
|
|
|
|
|
_selectedBranch != null
|
|
|
|
|
? _selectedBranch['facilityName']
|
|
|
|
|
@ -272,6 +270,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
list: model.clinicsList,
|
|
|
|
|
attributeName: 'ClinicDescription',
|
|
|
|
|
attributeValueId: 'ClinicID',
|
|
|
|
|
usingSearch: true,
|
|
|
|
|
hintSearchText: TranslationBase.of(context).clinicSearch,
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
@ -296,7 +296,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).clinic,
|
|
|
|
|
_selectedClinic != null
|
|
|
|
|
? _selectedClinic['ClinicDescription']
|
|
|
|
|
@ -320,6 +320,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
list: model.doctorsList,
|
|
|
|
|
attributeName: 'DoctorName',
|
|
|
|
|
attributeValueId: 'DoctorID',
|
|
|
|
|
usingSearch: true,
|
|
|
|
|
hintSearchText: TranslationBase.of(context).doctorSearch,
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
@ -337,7 +339,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).doctor,
|
|
|
|
|
_selectedDoctor != null
|
|
|
|
|
? _selectedDoctor['DoctorName']
|
|
|
|
|
@ -355,7 +357,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => _selectDate(context, model),
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).chooseAppointment,
|
|
|
|
|
appointmentDate != null
|
|
|
|
|
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
|
|
|
|
|
@ -374,7 +376,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).remarks, null, false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller: _remarksController,
|
|
|
|
|
@ -453,49 +455,4 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
});*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
|
{Icon suffixIcon}) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
hintText: selectedText != null ? selectedText : hintText,
|
|
|
|
|
suffixIcon: isDropDown
|
|
|
|
|
? suffixIcon != null
|
|
|
|
|
? suffixIcon
|
|
|
|
|
: Icon(
|
|
|
|
|
Icons.arrow_drop_down,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.grey.shade600,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BoxDecoration containerBorderDecoration(
|
|
|
|
|
Color containerColor, Color borderColor) {
|
|
|
|
|
return BoxDecoration(
|
|
|
|
|
color: containerColor,
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6)),
|
|
|
|
|
border: Border.fromBorderSide(BorderSide(
|
|
|
|
|
color: borderColor,
|
|
|
|
|
width: 2.0,
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|