Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into app_translation
Conflicts: lib/core/viewModel/PatientSearchViewModel.dart lib/screens/patients/PatientsInPatientScreen.dart lib/screens/patients/out_patient/out_patient_screen.dart lib/screens/patients/patient_search/patient_search_result_screen.dart lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart lib/screens/sick-leave/add-sickleave.dartapp_translation
commit
9457e04825
@ -1,112 +0,0 @@
|
|||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart';
|
|
||||||
import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class SearchMedicinePatientScreen extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
_SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SearchMedicinePatientScreen extends State<SearchMedicinePatientScreen>
|
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
TabController _tabController;
|
|
||||||
var activeIndex = 0;
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_tabController = TabController(length: 2, vsync: this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
_tabController.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AppScaffold(
|
|
||||||
isShowAppBar: true,
|
|
||||||
appBarTitle: TranslationBase.of(context).searchmedicinepatient,
|
|
||||||
body: Scaffold(
|
|
||||||
extendBodyBehindAppBar: true,
|
|
||||||
appBar: PreferredSize(
|
|
||||||
preferredSize: Size.fromHeight(65.0),
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
height: 60.0,
|
|
||||||
margin: EdgeInsets.only(top: 10.0),
|
|
||||||
width: MediaQuery.of(context).size.width * 0.92, // 0.9,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border(
|
|
||||||
bottom: BorderSide(
|
|
||||||
color: Theme.of(context).dividerColor,
|
|
||||||
width: 0.9), //width: 0.7
|
|
||||||
),
|
|
||||||
color: Colors.white),
|
|
||||||
child: TabBar(
|
|
||||||
isScrollable: true,
|
|
||||||
onTap: (index) {
|
|
||||||
setState(() {
|
|
||||||
activeIndex = index;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
controller: _tabController,
|
|
||||||
indicatorWeight: 5.0,
|
|
||||||
indicatorSize: TabBarIndicatorSize.tab,
|
|
||||||
indicatorColor: Colors.red[800],
|
|
||||||
labelColor: Theme.of(context).primaryColor,
|
|
||||||
labelPadding:
|
|
||||||
EdgeInsets.only(top: 4.0, left: 30.0, right: 30.0),
|
|
||||||
unselectedLabelColor: Colors.grey[800],
|
|
||||||
tabs: [
|
|
||||||
Container(
|
|
||||||
width: MediaQuery.of(context).size.width * 0.35,
|
|
||||||
child: Center(
|
|
||||||
child: AppText(
|
|
||||||
TranslationBase.of(context).searchPatient,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: MediaQuery.of(context).size.width * 0.35,
|
|
||||||
child: Center(
|
|
||||||
child: AppText(
|
|
||||||
TranslationBase.of(context).searchMedicine,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.black),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: TabBarView(
|
|
||||||
physics: BouncingScrollPhysics(),
|
|
||||||
controller: _tabController,
|
|
||||||
children: <Widget>[
|
|
||||||
PatientSearchScreen(),
|
|
||||||
MedicineSearchScreen()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,164 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../routes.dart';
|
||||||
|
|
||||||
|
class InPatientPage extends StatefulWidget {
|
||||||
|
final bool isMyInPatient;
|
||||||
|
|
||||||
|
InPatientPage(this.isMyInPatient);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_InPatientPageState createState() => _InPatientPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _InPatientPageState extends State<InPatientPage> {
|
||||||
|
TextEditingController _searchController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_searchController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<PatientSearchViewModel>(
|
||||||
|
onModelReady: (model) async {
|
||||||
|
await model.setDefaultInPatientList();
|
||||||
|
},
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: false,
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.070,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(16.0),
|
||||||
|
child: AppTextFieldCustom(
|
||||||
|
hintText: TranslationBase.of(context).searchPatientName,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.search,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
controller: _searchController,
|
||||||
|
onChanged: (value) {
|
||||||
|
model.filterSearchResults(value);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
model.filteredInPatientItems.length > 0
|
||||||
|
? Expanded(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
...List.generate(
|
||||||
|
model.filteredInPatientItems.length, (index) {
|
||||||
|
if (!widget.isMyInPatient)
|
||||||
|
return PatientCard(
|
||||||
|
patientInfo:
|
||||||
|
model.filteredInPatientItems[index],
|
||||||
|
patientType: "1",
|
||||||
|
arrivalType: "1",
|
||||||
|
isInpatient: true,
|
||||||
|
isMyPatient: model
|
||||||
|
.filteredInPatientItems[index]
|
||||||
|
.doctorId ==
|
||||||
|
model.doctorProfile.doctorID,
|
||||||
|
onTap: () {
|
||||||
|
FocusScopeNode currentFocus =
|
||||||
|
FocusScope.of(context);
|
||||||
|
if (!currentFocus.hasPrimaryFocus) {
|
||||||
|
currentFocus.unfocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
PATIENTS_PROFILE,
|
||||||
|
arguments: {
|
||||||
|
"patient": model
|
||||||
|
.filteredInPatientItems[index],
|
||||||
|
"patientType": "1",
|
||||||
|
"from": "0",
|
||||||
|
"to": "0",
|
||||||
|
"isSearch": false,
|
||||||
|
"isInpatient": true,
|
||||||
|
"arrivalType": "1",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
else if (model.filteredInPatientItems[index]
|
||||||
|
.doctorId ==
|
||||||
|
model.doctorProfile.doctorID &&
|
||||||
|
widget.isMyInPatient)
|
||||||
|
return PatientCard(
|
||||||
|
patientInfo:
|
||||||
|
model.filteredInPatientItems[index],
|
||||||
|
patientType: "1",
|
||||||
|
arrivalType: "1",
|
||||||
|
isInpatient: true,
|
||||||
|
isMyPatient: model
|
||||||
|
.filteredInPatientItems[index]
|
||||||
|
.doctorId ==
|
||||||
|
model.doctorProfile.doctorID,
|
||||||
|
onTap: () {
|
||||||
|
FocusScopeNode currentFocus =
|
||||||
|
FocusScope.of(context);
|
||||||
|
if (!currentFocus.hasPrimaryFocus) {
|
||||||
|
currentFocus.unfocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
PATIENTS_PROFILE,
|
||||||
|
arguments: {
|
||||||
|
"patient": model
|
||||||
|
.filteredInPatientItems[index],
|
||||||
|
"patientType": "1",
|
||||||
|
"from": "0",
|
||||||
|
"to": "0",
|
||||||
|
"isSearch": false,
|
||||||
|
"isInpatient": true,
|
||||||
|
"arrivalType": "1",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
else
|
||||||
|
return SizedBox();
|
||||||
|
}),
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
child: ErrorMessage(
|
||||||
|
error:
|
||||||
|
TranslationBase.of(context).noDataAvailable)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,184 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
|
||||||
|
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/routes.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class PatientsSearchResultScreen extends StatefulWidget {
|
||||||
|
final PatientType selectedPatientType;
|
||||||
|
final PatientSearchRequestModel patientSearchRequestModel;
|
||||||
|
final bool isSearchWithKeyInfo;
|
||||||
|
final bool isSearch;
|
||||||
|
final bool isInpatient;
|
||||||
|
final bool isSearchAndOut;
|
||||||
|
final String searchKey;
|
||||||
|
|
||||||
|
|
||||||
|
PatientsSearchResultScreen(
|
||||||
|
{
|
||||||
|
this.selectedPatientType,
|
||||||
|
this.patientSearchRequestModel,
|
||||||
|
this.isSearchWithKeyInfo = true,
|
||||||
|
this.isSearch = false,
|
||||||
|
this.isInpatient = false,
|
||||||
|
this.searchKey,
|
||||||
|
this.isSearchAndOut = false});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_PatientsSearchResultScreenState createState() =>
|
||||||
|
_PatientsSearchResultScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PatientsSearchResultScreenState
|
||||||
|
extends State<PatientsSearchResultScreen> {
|
||||||
|
int clinicId;
|
||||||
|
AuthViewModel authProvider;
|
||||||
|
|
||||||
|
|
||||||
|
String patientType;
|
||||||
|
String patientTypeTitle;
|
||||||
|
var selectedFilter = 1;
|
||||||
|
String arrivalType;
|
||||||
|
ProjectViewModel projectsProvider;
|
||||||
|
var isView;
|
||||||
|
final _controller = TextEditingController();
|
||||||
|
|
||||||
|
PatientModel patient;
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
authProvider = Provider.of(context);
|
||||||
|
return BaseView<PatientSearchViewModel>(
|
||||||
|
onModelReady: (model) async {
|
||||||
|
if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) {
|
||||||
|
await model.getOutPatient(widget.patientSearchRequestModel);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
await model.getPatientFileInformation(widget.patientSearchRequestModel);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
appBarTitle: "Search Patient",
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBar: PatientSearchHeader(
|
||||||
|
title: "Search for ${widget.searchKey}",
|
||||||
|
),
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 18.5),
|
||||||
|
Container(
|
||||||
|
width: SizeConfig.screenWidth * 0.9,
|
||||||
|
height: 75,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(6.0)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.0,
|
||||||
|
color: HexColor("#CCCCCC"),
|
||||||
|
),
|
||||||
|
color: Colors.white),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 10, top: 10),
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.searchPatientName,
|
||||||
|
fontSize: 13,
|
||||||
|
)),
|
||||||
|
AppTextFormField(
|
||||||
|
// focusNode: focusProject,
|
||||||
|
controller: _controller,
|
||||||
|
borderColor: Colors.white,
|
||||||
|
prefix: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
DoctorApp.filter_1,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
iconSize: 20,
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(
|
||||||
|
bottom: 30),
|
||||||
|
),
|
||||||
|
onChanged: (String str) {
|
||||||
|
model.searchData(str);
|
||||||
|
}),
|
||||||
|
])),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.0,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: model.filterData.isEmpty
|
||||||
|
? Center(
|
||||||
|
child: ErrorMessage(
|
||||||
|
error: TranslationBase.of(context)
|
||||||
|
.youDontHaveAnyPatient,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: model.filterData.length,
|
||||||
|
itemBuilder: (BuildContext ctxt, int index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: PatientCard(
|
||||||
|
patientInfo: model.filterData[index],
|
||||||
|
patientType: patientType,
|
||||||
|
arrivalType: arrivalType,
|
||||||
|
isFromSearch:widget.isSearchAndOut,
|
||||||
|
isInpatient: widget.isInpatient,
|
||||||
|
onTap: () {
|
||||||
|
// TODO change the parameter to daynamic
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
PATIENTS_PROFILE,
|
||||||
|
arguments: {
|
||||||
|
"patient": model.filterData[index],
|
||||||
|
"patientType": "1",
|
||||||
|
"from": widget
|
||||||
|
.patientSearchRequestModel.from,
|
||||||
|
"to": widget
|
||||||
|
.patientSearchRequestModel.from,
|
||||||
|
"isSearch": widget.isSearch,
|
||||||
|
"isInpatient": widget.isInpatient,
|
||||||
|
"arrivalType": "7",
|
||||||
|
"isSearchAndOut": widget.isSearchAndOut,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// isFromSearch: widget.isSearch,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,255 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
|
|
||||||
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
||||||
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/routes.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart';
|
|
||||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hexcolor/hexcolor.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
|
||||||
class PatientsScreenNew extends StatefulWidget {
|
|
||||||
final patientSearchForm;
|
|
||||||
final selectedType;
|
|
||||||
final isAppbar;
|
|
||||||
final arrivalType;
|
|
||||||
final isView;
|
|
||||||
final PatientType selectedPatientType;
|
|
||||||
final PatientSearchRequestModel patientSearchRequestModel;
|
|
||||||
final bool isSearchWithKeyInfo;
|
|
||||||
final bool isSearch;
|
|
||||||
final bool isInpatient;
|
|
||||||
final bool isSearchAndOut;
|
|
||||||
final String searchKey;
|
|
||||||
|
|
||||||
PatientsScreenNew(
|
|
||||||
{this.patientSearchForm,
|
|
||||||
this.selectedType,
|
|
||||||
this.isAppbar = true,
|
|
||||||
this.arrivalType,
|
|
||||||
this.isView,
|
|
||||||
this.selectedPatientType,
|
|
||||||
this.patientSearchRequestModel,
|
|
||||||
this.isSearchWithKeyInfo = true,
|
|
||||||
this.isSearch = false,
|
|
||||||
this.isInpatient = false,
|
|
||||||
this.searchKey,
|
|
||||||
this.isSearchAndOut = false});
|
|
||||||
|
|
||||||
@override
|
|
||||||
_PatientsScreenNewState createState() => _PatientsScreenNewState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PatientsScreenNewState extends State<PatientsScreenNew> {
|
|
||||||
int clinicId;
|
|
||||||
AuthViewModel authProvider;
|
|
||||||
|
|
||||||
List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
|
|
||||||
|
|
||||||
int _activeLocation = 0;
|
|
||||||
String patientType;
|
|
||||||
String patientTypeTitle;
|
|
||||||
var selectedFilter = 1;
|
|
||||||
String arrivalType;
|
|
||||||
ProjectViewModel projectsProvider;
|
|
||||||
var isView;
|
|
||||||
final _controller = TextEditingController();
|
|
||||||
|
|
||||||
PatientModel patient;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
authProvider = Provider.of(context);
|
|
||||||
_locations = [
|
|
||||||
TranslationBase.of(context).today,
|
|
||||||
TranslationBase.of(context).tomorrow,
|
|
||||||
TranslationBase.of(context).nextWeek,
|
|
||||||
];
|
|
||||||
final screenSize = MediaQuery.of(context).size;
|
|
||||||
|
|
||||||
return BaseView<PatientSearchViewModel>(
|
|
||||||
onModelReady: (model) async {
|
|
||||||
if (!widget.isSearchWithKeyInfo &&
|
|
||||||
widget.selectedPatientType == PatientType.OutPatient) {
|
|
||||||
await model.getOutPatient(widget.patientSearchRequestModel);
|
|
||||||
} else {
|
|
||||||
await model
|
|
||||||
.getPatientFileInformation(widget.patientSearchRequestModel);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
builder: (_, model, w) => AppScaffold(
|
|
||||||
appBarTitle: "Search Patient",
|
|
||||||
isShowAppBar: true,
|
|
||||||
appBar: !widget.isSearch && !widget.isInpatient
|
|
||||||
? HeaderInSearch(
|
|
||||||
title: "My Out patient",
|
|
||||||
)
|
|
||||||
: HeaderInSearch(
|
|
||||||
title: "Search for ${widget.searchKey}",
|
|
||||||
),
|
|
||||||
baseViewModel: model,
|
|
||||||
body: Column(
|
|
||||||
children: [
|
|
||||||
if (!widget.isInpatient && !widget.isSearch)
|
|
||||||
Container(
|
|
||||||
// color: Colors.red,
|
|
||||||
height: screenSize.height * 0.070,
|
|
||||||
decoration: TextFieldsUtils.containerBorderDecoration(
|
|
||||||
Color(0Xffffffff), Color(0xFFCCCCCC),
|
|
||||||
borderRadius: 4, borderWidth: 0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: _locations.map((item) {
|
|
||||||
bool _isActive =
|
|
||||||
_locations[_activeLocation] == item ? true : false;
|
|
||||||
|
|
||||||
return Expanded(
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
setState(() {
|
|
||||||
_activeLocation = _locations.indexOf(item);
|
|
||||||
});
|
|
||||||
GifLoaderDialogUtils.showMyDialog(context);
|
|
||||||
await model.getPatientBasedOnDate(
|
|
||||||
item: item,
|
|
||||||
selectedPatientType: widget.selectedPatientType,
|
|
||||||
patientSearchRequestModel:
|
|
||||||
widget.patientSearchRequestModel,
|
|
||||||
isSearchWithKeyInfo:
|
|
||||||
widget.isSearchWithKeyInfo);
|
|
||||||
GifLoaderDialogUtils.hideDialog(context);
|
|
||||||
},
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
height: screenSize.height * 0.070,
|
|
||||||
decoration:
|
|
||||||
TextFieldsUtils.containerBorderDecoration(
|
|
||||||
_isActive
|
|
||||||
? Color(0xFFD02127 /*B8382B*/)
|
|
||||||
: Color(0xFFEAEAEA),
|
|
||||||
_isActive
|
|
||||||
? Color(0xFFD02127)
|
|
||||||
: Color(0xFFEAEAEA),
|
|
||||||
borderRadius: 4,
|
|
||||||
borderWidth: 0),
|
|
||||||
child: Center(
|
|
||||||
child: AppText(
|
|
||||||
item,
|
|
||||||
fontSize: SizeConfig.textMultiplier * 1.8,
|
|
||||||
color: _isActive
|
|
||||||
? Colors.white
|
|
||||||
: Color(0xFF2B353E),
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 18.5),
|
|
||||||
Container(
|
|
||||||
width: SizeConfig.screenWidth * 0.9,
|
|
||||||
height: 75,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"),
|
|
||||||
),
|
|
||||||
color: Colors.white),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(left: 10, top: 10),
|
|
||||||
child: AppText(
|
|
||||||
TranslationBase.of(context).searchPatientName,
|
|
||||||
fontSize: 13,
|
|
||||||
)),
|
|
||||||
AppTextFormField(
|
|
||||||
// focusNode: focusProject,
|
|
||||||
controller: _controller,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
prefix: IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
DoctorApp.filter_1,
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
iconSize: 20,
|
|
||||||
padding: EdgeInsets.only(bottom: 30),
|
|
||||||
),
|
|
||||||
onChanged: (String str) {
|
|
||||||
model.searchData(str);
|
|
||||||
}),
|
|
||||||
])),
|
|
||||||
SizedBox(
|
|
||||||
height: 10.0,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
child: model.filterData.isEmpty
|
|
||||||
? Center(
|
|
||||||
child: ErrorMessage(
|
|
||||||
error: TranslationBase.of(context)
|
|
||||||
.youDontHaveAnyPatient,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: ListView.builder(
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemCount: model.filterData.length,
|
|
||||||
itemBuilder: (BuildContext ctxt, int index) {
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: PatientCard(
|
|
||||||
patientInfo: model.filterData[index],
|
|
||||||
patientType: patientType,
|
|
||||||
arrivalType: arrivalType,
|
|
||||||
isFromSearch: widget.isSearchAndOut,
|
|
||||||
isInpatient: widget.isInpatient,
|
|
||||||
onTap: () {
|
|
||||||
// TODO change the parameter to daynamic
|
|
||||||
Navigator.of(context).pushNamed(
|
|
||||||
PATIENTS_PROFILE,
|
|
||||||
arguments: {
|
|
||||||
"patient": model.filterData[index],
|
|
||||||
"patientType": "1",
|
|
||||||
"from": widget
|
|
||||||
.patientSearchRequestModel.from,
|
|
||||||
"to": widget
|
|
||||||
.patientSearchRequestModel.from,
|
|
||||||
"isSearch": widget.isSearch,
|
|
||||||
"isInpatient": widget.isInpatient,
|
|
||||||
"arrivalType": "7",
|
|
||||||
"isSearchAndOut":
|
|
||||||
widget.isSearchAndOut,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// isFromSearch: widget.isSearch,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
})),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,641 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/routes.dart';
|
|
||||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
||||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
||||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/rendering.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:hexcolor/hexcolor.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
import '../../config/config.dart';
|
|
||||||
import '../../config/size_config.dart';
|
|
||||||
import '../../lookups/patient_lookup.dart';
|
|
||||||
import '../../widgets/patients/dynamic_elements.dart';
|
|
||||||
import '../../widgets/shared/app_scaffold_widget.dart';
|
|
||||||
import '../../widgets/shared/app_texts_widget.dart';
|
|
||||||
import '../../widgets/shared/buttons/app_buttons_widget.dart';
|
|
||||||
import '../../widgets/shared/rounded_container_widget.dart';
|
|
||||||
import '../../widgets/shared/text_fields/app_text_form_field.dart';
|
|
||||||
|
|
||||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
||||||
Helpers helpers = Helpers();
|
|
||||||
|
|
||||||
// OWNER : Ibrahim albitar
|
|
||||||
// DATE : 19-04-2020
|
|
||||||
// DESCRIPTION : Patient Search Screen.
|
|
||||||
|
|
||||||
class PatientSearchScreen extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
_PatientSearchScreenState createState() => _PatientSearchScreenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
||||||
String _selectedType = '1';
|
|
||||||
String _selectedLocation = '1';
|
|
||||||
String error = '';
|
|
||||||
ProjectViewModel projectsProvider;
|
|
||||||
String itemText = '';
|
|
||||||
String itemText2 = '';
|
|
||||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
bool _autoValidate = false;
|
|
||||||
bool onlyArrived = true;
|
|
||||||
bool isView = false;
|
|
||||||
bool isFormSubmitted = false;
|
|
||||||
|
|
||||||
FocusNode _nodeText1 = FocusNode();
|
|
||||||
FocusNode _nodeText2 = FocusNode();
|
|
||||||
FocusNode _nodeText3 = FocusNode();
|
|
||||||
|
|
||||||
var _patientSearchFormValues = PatientModel(
|
|
||||||
FirstName: "0",
|
|
||||||
MiddleName: "0",
|
|
||||||
LastName: "0",
|
|
||||||
PatientMobileNumber: "0",
|
|
||||||
PatientIdentificationID: "0",
|
|
||||||
MobileNo: '0',
|
|
||||||
PatientID: 0,
|
|
||||||
From: "0",
|
|
||||||
To: "0",
|
|
||||||
LanguageID: 2,
|
|
||||||
stamp: "2020-03-02T13:56:39.170Z",
|
|
||||||
IPAdress: "11.11.11.11",
|
|
||||||
VersionID: 5.8,
|
|
||||||
Channel: 9,
|
|
||||||
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
|
|
||||||
SessionID: "5G0yXn0Jnq",
|
|
||||||
IsLoginForDoctorApp: true,
|
|
||||||
IdentificationNo: '0',
|
|
||||||
PatientOutSA: false);
|
|
||||||
|
|
||||||
void _validateInputs() async {
|
|
||||||
setState(() {
|
|
||||||
isFormSubmitted = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (_formKey.currentState.validate()) {
|
|
||||||
_formKey.currentState.save();
|
|
||||||
|
|
||||||
if ((_patientSearchFormValues.From == "0" ||
|
|
||||||
_patientSearchFormValues.To == "0") &&
|
|
||||||
_selectedType == "7" ||
|
|
||||||
((_patientSearchFormValues.From == "0" ||
|
|
||||||
_patientSearchFormValues.To == "0") &&
|
|
||||||
_selectedType == "6")) {
|
|
||||||
// Helpers.showErrorToast("Please Choose The Dates");
|
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
isFormSubmitted = false;
|
|
||||||
});
|
|
||||||
Navigator.of(context).pushNamed(PATIENTS, arguments: {
|
|
||||||
"patientSearchForm": _patientSearchFormValues,
|
|
||||||
"selectedType": _selectedType,
|
|
||||||
"isSearch": true,
|
|
||||||
"isView": isView
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
_autoValidate = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
error = err.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handelCatchErrorCase(err) {
|
|
||||||
//isLoading = false;
|
|
||||||
//isError = true;
|
|
||||||
error = Helpers.generateContactAdminMsg(err);
|
|
||||||
//notifyListeners();
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
projectsProvider = Provider.of(context);
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
FocusScope.of(context).requestFocus(new FocusNode());
|
|
||||||
},
|
|
||||||
child: AppScaffold(
|
|
||||||
appBarTitle: TranslationBase.of(context).searchPatient,
|
|
||||||
isShowAppBar: true,
|
|
||||||
body: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
RoundedContainer(
|
|
||||||
showBorder: false,
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Column(
|
|
||||||
children: <Widget>[
|
|
||||||
// Container(
|
|
||||||
// child: Icon(
|
|
||||||
// DoctorApp.search_patient_1,
|
|
||||||
// size: 100,
|
|
||||||
// color: Colors.black,
|
|
||||||
// ),
|
|
||||||
// margin: EdgeInsets.only(top: 10),
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.only(top: 12.0),
|
|
||||||
// child: AppText(
|
|
||||||
// TranslationBase.of(context)
|
|
||||||
// .searchPatientImageCaptionTitle
|
|
||||||
// .toUpperCase(),
|
|
||||||
// fontWeight: FontWeight.bold,
|
|
||||||
// fontSize: SizeConfig.heightMultiplier * 2.5,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.only(top: 5.0),
|
|
||||||
// child: AppText(
|
|
||||||
// TranslationBase.of(context)
|
|
||||||
// .searchPatientImageCaptionBody,
|
|
||||||
// fontSize: SizeConfig.heightMultiplier * 2,
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.all(15),
|
|
||||||
width: SizeConfig.screenWidth * 1,
|
|
||||||
child: Form(
|
|
||||||
key: _formKey,
|
|
||||||
autovalidate: _autoValidate,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(
|
|
||||||
height: 15,
|
|
||||||
),
|
|
||||||
if (_selectedType != '7')
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"))),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: AppTextFormField(
|
|
||||||
labelText: TranslationBase.of(context)
|
|
||||||
.patpatientIDMobilenationalientID,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
textInputType: TextInputType.number,
|
|
||||||
textInputAction: TextInputAction.done,
|
|
||||||
inputFormatter: ONLY_NUMBERS,
|
|
||||||
focusNode: _nodeText1,
|
|
||||||
onSaved: (value) {
|
|
||||||
if (value != null && value != '') {
|
|
||||||
if (value.length == 10 &&
|
|
||||||
(value[0] == '2' ||
|
|
||||||
value[0] == '1')) {
|
|
||||||
_patientSearchFormValues
|
|
||||||
.IdentificationNo = value;
|
|
||||||
_patientSearchFormValues.Searchtype = 2;
|
|
||||||
_patientSearchFormValues.setPatientID =
|
|
||||||
0;
|
|
||||||
} else if ((value.length == 10 ||
|
|
||||||
value.length == 9) &&
|
|
||||||
((value[0] == '0' &&
|
|
||||||
value[1] == '5') ||
|
|
||||||
value[0] == '5')) {
|
|
||||||
_patientSearchFormValues.MobileNo =
|
|
||||||
value;
|
|
||||||
_patientSearchFormValues.Searchtype = 0;
|
|
||||||
} else {
|
|
||||||
_patientSearchFormValues.setPatientID =
|
|
||||||
int.parse(value);
|
|
||||||
_patientSearchFormValues.Searchtype = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// else{
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// value == null || value == ''
|
|
||||||
// ? _patientSearchFormValues.setPatientID =
|
|
||||||
// 0
|
|
||||||
// : _patientSearchFormValues.setPatientID =
|
|
||||||
// int.parse(value);
|
|
||||||
|
|
||||||
// if (value != null &&
|
|
||||||
// value.toString().trim().isEmpty) {
|
|
||||||
// _patientSearchFormValues.setPatientID = 0;
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
// children: [
|
|
||||||
// InkWell(
|
|
||||||
// child: this.isView == false
|
|
||||||
// ? AppText(
|
|
||||||
// TranslationBase.of(context)
|
|
||||||
// .searchWithOther,
|
|
||||||
// color: Colors.red,
|
|
||||||
// fontWeight: FontWeight.bold,
|
|
||||||
// )
|
|
||||||
// : AppText(
|
|
||||||
// TranslationBase.of(context)
|
|
||||||
// .hideOtherCriteria,
|
|
||||||
// color: Colors.red,
|
|
||||||
// fontWeight: FontWeight.bold),
|
|
||||||
// onTap: () {
|
|
||||||
// setState(() {
|
|
||||||
// this.isView = !this.isView;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
isView == true
|
|
||||||
? Column(children: [
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 65.0,
|
|
||||||
decoration: ShapeDecoration(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
side: BorderSide(
|
|
||||||
width: 1.0,
|
|
||||||
style: BorderStyle.solid,
|
|
||||||
color: HexColor("#CCCCCC")),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
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: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
// add Expanded to have your dropdown button fill remaining space
|
|
||||||
child:
|
|
||||||
DropdownButtonHideUnderline(
|
|
||||||
child: DropdownButton(
|
|
||||||
isExpanded: true,
|
|
||||||
value: _selectedType,
|
|
||||||
iconSize: 25,
|
|
||||||
elevation: 16,
|
|
||||||
selectedItemBuilder:
|
|
||||||
(BuildContext context) {
|
|
||||||
return PATIENT_TYPE_Des.map(
|
|
||||||
(item) {
|
|
||||||
return Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
children: <Widget>[
|
|
||||||
!projectsProvider
|
|
||||||
.isArabic
|
|
||||||
? AppText(
|
|
||||||
item['text'],
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.textMultiplier *
|
|
||||||
2.1,
|
|
||||||
)
|
|
||||||
: AppText(
|
|
||||||
item['text_ar'],
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.textMultiplier *
|
|
||||||
2.1,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}).toList();
|
|
||||||
},
|
|
||||||
onChanged: (String newValue) =>
|
|
||||||
{
|
|
||||||
setState(() {
|
|
||||||
_selectedType = newValue;
|
|
||||||
selectedPatientType =
|
|
||||||
int.parse(
|
|
||||||
_selectedType);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
items: PATIENT_TYPE_Des.map(
|
|
||||||
(item) {
|
|
||||||
!projectsProvider.isArabic
|
|
||||||
? itemText = item['text']
|
|
||||||
: itemText =
|
|
||||||
item['text_ar'];
|
|
||||||
return DropdownMenuItem(
|
|
||||||
child: Text(
|
|
||||||
itemText,
|
|
||||||
textAlign: TextAlign.end,
|
|
||||||
),
|
|
||||||
value: item['val'],
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"))),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: AppTextFormField(
|
|
||||||
labelText: TranslationBase.of(context)
|
|
||||||
.firstName,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
onSaved: (value) {
|
|
||||||
value == null || value == ''
|
|
||||||
? _patientSearchFormValues
|
|
||||||
.setFirstName = "0"
|
|
||||||
: _patientSearchFormValues
|
|
||||||
.setFirstName = value;
|
|
||||||
|
|
||||||
if (value != null &&
|
|
||||||
value
|
|
||||||
.toString()
|
|
||||||
.trim()
|
|
||||||
.isEmpty) {
|
|
||||||
_patientSearchFormValues
|
|
||||||
.setFirstName = "0";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// validator: (value) {
|
|
||||||
// return TextValidator().validateName(value);
|
|
||||||
// },
|
|
||||||
inputFormatter: ONLY_LETTERS),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
if (_selectedType != '7')
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"))),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: AppTextFormField(
|
|
||||||
labelText: TranslationBase.of(context)
|
|
||||||
.phoneNumber,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
textInputType: TextInputType.number,
|
|
||||||
textInputAction: TextInputAction.done,
|
|
||||||
inputFormatter: ONLY_NUMBERS,
|
|
||||||
focusNode: _nodeText1,
|
|
||||||
onSaved: (value) {
|
|
||||||
value == null || value == ''
|
|
||||||
? _patientSearchFormValues
|
|
||||||
.setPatientMobileNumber =
|
|
||||||
"0"
|
|
||||||
: _patientSearchFormValues
|
|
||||||
.setPatientMobileNumber =
|
|
||||||
value;
|
|
||||||
|
|
||||||
if (value != null &&
|
|
||||||
value
|
|
||||||
.toString()
|
|
||||||
.trim()
|
|
||||||
.isEmpty) {
|
|
||||||
_patientSearchFormValues
|
|
||||||
.setPatientMobileNumber = "0";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"))),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: AppTextFormField(
|
|
||||||
labelText: TranslationBase.of(context)
|
|
||||||
.middleName,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
onSaved: (value) {
|
|
||||||
value == null || value == ''
|
|
||||||
? _patientSearchFormValues
|
|
||||||
.setMiddleName = "0"
|
|
||||||
: _patientSearchFormValues
|
|
||||||
.setMiddleName = value;
|
|
||||||
if (value != null &&
|
|
||||||
value
|
|
||||||
.toString()
|
|
||||||
.trim()
|
|
||||||
.isEmpty) {
|
|
||||||
_patientSearchFormValues
|
|
||||||
.setMiddleName = "0";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// validator: (value) {
|
|
||||||
// return TextValidator().validateName(value);
|
|
||||||
// },
|
|
||||||
inputFormatter: ONLY_LETTERS),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"))),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: AppTextFormField(
|
|
||||||
labelText: TranslationBase.of(context)
|
|
||||||
.lastName,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
onSaved: (value) {
|
|
||||||
value == null || value == ''
|
|
||||||
? _patientSearchFormValues
|
|
||||||
.setLastName = "0"
|
|
||||||
: _patientSearchFormValues
|
|
||||||
.setLastName = value;
|
|
||||||
if (value != null &&
|
|
||||||
value
|
|
||||||
.toString()
|
|
||||||
.trim()
|
|
||||||
.isEmpty) {
|
|
||||||
_patientSearchFormValues
|
|
||||||
.setLastName = "0";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
inputFormatter: ONLY_LETTERS),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"))),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: AppTextFormField(
|
|
||||||
labelText: TranslationBase.of(context)
|
|
||||||
.patientID,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
textInputType: TextInputType.number,
|
|
||||||
inputFormatter: ONLY_NUMBERS,
|
|
||||||
focusNode: _nodeText2,
|
|
||||||
onSaved: (value) {
|
|
||||||
value == null || value == ''
|
|
||||||
? _patientSearchFormValues
|
|
||||||
.setPatientID = 0
|
|
||||||
: _patientSearchFormValues
|
|
||||||
.setPatientID =
|
|
||||||
int.parse(value);
|
|
||||||
if (value != null &&
|
|
||||||
value
|
|
||||||
.trim()
|
|
||||||
.toString()
|
|
||||||
.isEmpty) {
|
|
||||||
_patientSearchFormValues
|
|
||||||
.setPatientID = 0;
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color: HexColor("#CCCCCC"))),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: AppTextFormField(
|
|
||||||
labelText: TranslationBase.of(context)
|
|
||||||
.patientFile,
|
|
||||||
borderColor: Colors.white,
|
|
||||||
textInputType: TextInputType.number,
|
|
||||||
focusNode: _nodeText3,
|
|
||||||
inputFormatter: ONLY_NUMBERS,
|
|
||||||
onSaved: (value) {},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(!(_selectedType == '2' ||
|
|
||||||
_selectedType == '4'))
|
|
||||||
? DynamicElements(
|
|
||||||
_patientSearchFormValues,
|
|
||||||
isFormSubmitted)
|
|
||||||
: SizedBox(
|
|
||||||
height: 0,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(6.0)),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.0,
|
|
||||||
color:
|
|
||||||
HexColor("#CCCCCC"))),
|
|
||||||
height: 25,
|
|
||||||
width: 25,
|
|
||||||
child: Checkbox(
|
|
||||||
value: onlyArrived,
|
|
||||||
checkColor: HexColor("#2A930A"),
|
|
||||||
activeColor: Colors.white,
|
|
||||||
onChanged: (bool newValue) {
|
|
||||||
setState(() {
|
|
||||||
onlyArrived = newValue;
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 12,
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
TranslationBase.of(context)
|
|
||||||
.onlyArrivedPatient,
|
|
||||||
fontSize:
|
|
||||||
SizeConfig.textMultiplier *
|
|
||||||
2),
|
|
||||||
])),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
])
|
|
||||||
: SizedBox(
|
|
||||||
height: 0,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
||||||
child: Wrap(
|
|
||||||
alignment: WrapAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
AppButton(
|
|
||||||
title: TranslationBase.of(context).search,
|
|
||||||
color: Colors.red[800],
|
|
||||||
onPressed: () {
|
|
||||||
_validateInputs();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
class MedicalReportPage extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
class PatientProfileCardModel {
|
||||||
|
final String nameLine1;
|
||||||
|
final String nameLine2;
|
||||||
|
final dynamic route;
|
||||||
|
final String icon;
|
||||||
|
final bool isInPatient;
|
||||||
|
final bool isDisable;
|
||||||
|
final bool isLoading;
|
||||||
|
final Function onTap;
|
||||||
|
final bool isDischargedPatient;
|
||||||
|
final bool isSelectInpatient;
|
||||||
|
|
||||||
|
PatientProfileCardModel(
|
||||||
|
this.nameLine1,
|
||||||
|
this.nameLine2,
|
||||||
|
this.route,
|
||||||
|
this.icon, {
|
||||||
|
this.isInPatient = false,
|
||||||
|
this.isDisable = false,
|
||||||
|
this.isLoading = false,
|
||||||
|
this.onTap,
|
||||||
|
this.isDischargedPatient = false,
|
||||||
|
this.isSelectInpatient = false,
|
||||||
|
});
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue