Merge branch 'add_out_patient_filter' into 'development'

Add out patient filter

See merge request Cloud_Solution/doctor_app_flutter!620
merge-requests/621/merge
Mohammad Aljammal 5 years ago
commit 04be0a7fc6

@ -1,2 +1,6 @@
enum FilterType { Clinic, Hospital }
enum OutPatientFilterType { Previous, Today, NextWeek }

@ -2,14 +2,9 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import '../../locator.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/patientInPatientService.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -61,7 +56,6 @@ class PatientSearchViewModel extends BaseViewModel{
} else {
setState(ViewState.Error);
}
setState(ViewState.Error);
} else {
filterData = _outPatientService.patientList;
setState(ViewState.Idle);
@ -88,14 +82,14 @@ class PatientSearchViewModel extends BaseViewModel{
bool isSearchWithKeyInfo })async {
String dateTo;
String dateFrom;
if (item == 'Tomorrow') {
if (item == 'Previous') {
dateTo = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
DateTime.now().day-1),
'yyyy-MM-dd');
dateFrom = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
DateTime(DateTime.now().year, DateTime.now().month-3,
DateTime.now().day),
'yyyy-MM-dd');
} else if (item == 'Next Week') {
@ -127,13 +121,7 @@ class PatientSearchViewModel extends BaseViewModel{
currentModel.doctorID = patientSearchRequestModel.doctorID;
currentModel.from = dateFrom;
currentModel.to = dateTo;
if(isSearchWithKeyInfo) {
await getPatientFileInformation(currentModel);
} else {
await getOutPatient(currentModel, isLocalBusy: true);
}
await getOutPatient(currentModel, isLocalBusy: true);
filterData = _outPatientService.patientList;
}

@ -18,7 +18,7 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart';
import './screens/auth/login_screen.dart';
import './screens/auth/verification_methods_screen.dart';
import './screens/patients/patients_screen.dart';
import './screens/patients/profile/patient_profile_screen.dart';
import 'screens/patients/profile/profile_screen/patient_profile_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart';
import 'landing_page.dart';
import 'screens/patients/profile/admission-request/admission-request-first-screen.dart';

@ -0,0 +1,317 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/date-utils.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/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class FilterDatePage extends StatefulWidget {
final OutPatientFilterType outPatientFilterType;
final PatientSearchViewModel patientSearchViewModel;
const FilterDatePage(
{Key key, this.outPatientFilterType, this.patientSearchViewModel})
: super(key: key);
@override
_FilterDatePageState createState() => _FilterDatePageState();
}
class _FilterDatePageState extends State<FilterDatePage> {
DateTime selectedFromDate;
DateTime selectedToDate;
@override
Widget build(BuildContext context) {
var screenSize;
return AppScaffold(
isShowAppBar: false,
backgroundColor: Theme
.of(context)
.scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Container(
height: MediaQuery
.of(context)
.size
.height * 1.0,
child: Padding(
padding: EdgeInsets.all(0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(
title: (OutPatientFilterType.Previous ==
widget.outPatientFilterType)
? " Filter Previous Out Patient"
: "Filter Nextweek Out Patient",
),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
Container(
color: Colors.white,
child: InkWell(
onTap: () =>
selectDate(
context, firstDate: getFirstDate(
widget.outPatientFilterType),
lastDate: getLastDate(
widget.outPatientFilterType)),
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase
.of(
context)
.fromDate,
selectedFromDate != null
? "${DateUtils
.convertStringToDateFormat(
selectedFromDate.toString(),
"yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(height: 10,),
Container(
color: Colors.white,
child: InkWell(
onTap: () =>
selectDate(
context, isFromDate: false,
firstDate: getFirstDate(
widget.outPatientFilterType),
lastDate: getLastDate(
widget.outPatientFilterType)),
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase
.of(
context)
.toDate,
selectedToDate != null
? "${DateUtils
.convertStringToDateFormat(
selectedToDate.toString(),
"yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
],
),
),
),
],
),
),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery
.of(context)
.size
.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
TranslationBase
.of(context)
.search,
padding: 10,
color: Color(0xFF359846),
onPressed: () async {
if (selectedFromDate == null ||
selectedToDate == null) {
Helpers.showErrorToast(
"Please Select All The date Fields ");
} else {
String dateTo = DateUtils.convertDateToFormat(
selectedToDate,
'yyyy-MM-dd');
String dateFrom = DateUtils.convertDateToFormat(
selectedFromDate,
'yyyy-MM-dd');
PatientSearchRequestModel currentModel = PatientSearchRequestModel();
currentModel.to = dateTo;
currentModel.from= dateFrom;
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientSearchViewModel.getOutPatient(
currentModel, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
if(widget.patientSearchViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.patientSearchViewModel.error);
}else {
Navigator.of(context).pop();
}
}
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
)
);
}
selectDate(BuildContext context,
{bool isFromDate = true, DateTime firstDate, lastDate}) async {
Helpers.hideKeyboard(context);
DateTime selectedDate = isFromDate
? this.selectedFromDate ?? firstDate
: this.selectedToDate ?? lastDate;
final DateTime picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: firstDate,
lastDate: lastDate,
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null) {
if (isFromDate) {
setState(() {
this.selectedFromDate = picked;
});
} else {
setState(() {
this.selectedToDate = picked;
});
}
}
}
getFirstDate(OutPatientFilterType outPatientFilterType) {
if (outPatientFilterType == OutPatientFilterType.Previous) {
return DateTime(
DateTime
.now()
.year, DateTime
.now()
.month - 3, DateTime
.now()
.day);
} else {
return DateTime(
DateTime
.now()
.year, DateTime
.now()
.month, DateTime
.now()
.day + 1);
}
}
getLastDate(OutPatientFilterType outPatientFilterType) {
if (outPatientFilterType == OutPatientFilterType.Previous) {
return DateTime(
DateTime
.now()
.year, DateTime
.now()
.month, (DateTime
.now()
.day - 1));
} else {
return DateTime(
DateTime
.now()
.year, DateTime
.now()
.month, DateTime
.now()
.day + 7);
}
}
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(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
: null,
hintStyle: TextStyle(
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
labelText: selectedText != null ? '$hintText\n$selectedText' : null,
labelStyle: TextStyle(
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
);
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
@ -18,9 +19,12 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
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:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'filter_date_page.dart';
// ignore: must_be_immutable
class OutPatientsScreen extends StatefulWidget {
final patientSearchForm;
@ -57,9 +61,9 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
int clinicId;
AuthViewModel authProvider;
List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
List<String> _times = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0;
int _activeLocation = 1;
String patientType;
String patientTypeTitle;
var selectedFilter = 1;
@ -70,21 +74,30 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
PatientModel patient;
OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today;
@override
Widget build(BuildContext context) {
authProvider = Provider.of(context);
_locations = [
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
_times = [
TranslationBase
.of(context)
.previous,
TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.nextWeek,
];
final screenSize = MediaQuery.of(context).size;
final screenSize = MediaQuery
.of(context)
.size;
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
await model.getOutPatient(widget.patientSearchRequestModel);
await model.getOutPatient(widget.patientSearchRequestModel);
},
builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient",
@ -108,8 +121,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item
children: _times.map((item) {
bool _isActive = _times[_activeLocation] == item
? true
: false;
@ -117,7 +130,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: InkWell(
onTap: () async {
setState(() {
_activeLocation = _locations.indexOf(item);
_activeLocation = _times.indexOf(item);
outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek;
});
GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(item: item,
@ -181,17 +195,26 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
borderColor: Colors.white
,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
_activeLocation == 1
? DoctorApp.filter_1
: FontAwesomeIcons.slidersH,
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
onPressed: _activeLocation == 1 ? null : () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) =>
FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,)));
},
),
onChanged: (String str) {
model.searchData(str);
}),

File diff suppressed because it is too large Load Diff

@ -0,0 +1,319 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/profile_screen/profile_gird_for_InPatient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-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';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
class PatientProfileScreen extends StatefulWidget {
@override
_PatientProfileScreenState createState() => _PatientProfileScreenState();
}
class _PatientProfileScreenState extends State<PatientProfileScreen>
with SingleTickerProviderStateMixin {
PatiantInformtion patient;
bool isFromSearch = false;
bool isInpatient = false;
bool isDischargedPatient = false;
bool isSearchAndOut = false;
String patientType;
String arrivalType;
String from;
String to;
TabController _tabController;
int index = 0;
int _activeTab = 0;
@override
void initState() {
_tabController = TabController(length: 2, vsync: this);
super.initState();
}
@override
void dispose() {
_tabController.dispose();
super.dispose();
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
from = routeArgs['from'];
to = routeArgs['to'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
if (routeArgs.containsKey("isInpatient")) {
isInpatient = routeArgs['isInpatient'];
}
if (routeArgs.containsKey("isDischargedPatient")) {
isDischargedPatient = routeArgs['isDischargedPatient'];
}
if (routeArgs.containsKey("isSearchAndOut")) {
isSearchAndOut = routeArgs['isSearchAndOut'];
}
if (isInpatient)
_activeTab = 0;
else
_activeTab = 1;
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientViewModel>(
builder: (_, patientViewModel, w) => AppScaffold(
baseViewModel: patientViewModel,
appBarTitle: TranslationBase.of(context).patientProfile,
isShowAppBar: false,
body: Column(
children: [
Stack(
children: [
Column(
children: [
PatientProfileHeaderNewDesignAppBar(
patient,
arrivalType ?? '0',
patientType,
isInpatient: isInpatient,
height: (patient.patientStatusType != null &&
patient.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
: 0,
),
Container(
height: !isSearchAndOut
? isDischargedPatient
? MediaQuery.of(context).size.height * 0.64
: MediaQuery.of(context).size.height * 0.65
: MediaQuery.of(context).size.height * 0.69,
child: ListView(
children: [
Container(
child: isSearchAndOut
? ProfileGridForSearch(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInpatient: isInpatient,
from: from,
to: to,
)
: isInpatient
? ProfileGridForInPatient(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInpatient: isInpatient,
from: from,
to: to,
isDischargedPatient:
isDischargedPatient,
isFromSearch: isFromSearch,
)
: ProfileGridForOther(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInpatient: isInpatient,
from: from,
to: to,
),
),
],
),
),
],
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => Positioned(
top: 180,
left: 20,
right: 20,
child: Row(
children: [
Expanded(child: Container()),
if (patient.episodeNo == 0)
AppButton(
title:
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
hPadding: 20,
fontWeight: FontWeight.normal,
fontSize: 1.6,
icon: Image.asset(
"assets/images/create-episod.png",
color: Colors.white,
height: 30,
),
onPressed: () async {
if (patient.patientStatusType ==
43) {
PostEpisodeReqModel
postEpisodeReqModel =
PostEpisodeReqModel(
appointmentNo:
patient.appointmentNo,
patientMRN:
patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(
context);
await model.postEpisode(
postEpisodeReqModel);
GifLoaderDialogUtils.hideDialog(
context);
patient.episodeNo =
model.episodeID;
Navigator.of(context).pushNamed(
CREATE_EPISODE,
arguments: {
'patient': patient
});
}
},
),
if (patient.episodeNo != 0)
AppButton(
title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color:
patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
hPadding: 20,
fontWeight: FontWeight.normal,
fontSize: 1.6,
icon: Image.asset(
"assets/images/modilfy-episode.png",
color: Colors.white,
height: 30,
),
onPressed: () {
if (patient.patientStatusType ==
43) {
Navigator.of(context).pushNamed(
UPDATE_EPISODE,
arguments: {
'patient': patient
});
}
}),
],
),
)),
],
),
],
),
));
}
Widget tabsBar(BuildContext context, Size screenSize) {
List<String> _tabs = [
"Inpatient Info".toUpperCase(),
"Outpatient Info".toUpperCase(),
];
return Container(
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: _tabs.map((item) {
bool _isActive = _tabs[_activeTab] == item ? true : false;
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeTab = _tabs.indexOf(item);
});
},
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(),
),
);
}
}
class AvatarWidget extends StatelessWidget {
final Widget avatarIcon;
AvatarWidget(this.avatarIcon);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
borderRadius: BorderRadius.all(Radius.circular(35.0)),
color: Color(0xffCCCCCC),
),
child: avatarIcon,
);
}
}

@ -0,0 +1,275 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
// ignore: must_be_immutable
class ProfileGridForInPatient extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final bool isInpatient;
final bool isDischargedPatient;
final bool isFromSearch;
String from;
String to;
ProfileGridForInPatient(
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch})
: super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding:
const EdgeInsets.symmetric(
vertical: 15.0,
horizontal: 15),
child: GridView.count(
shrinkWrap: true,
physics:
NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
children: [
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1:
TranslationBase
.of(
context)
.vital,
nameLine2:
TranslationBase
.of(
context)
.signs,
route: VITAL_SIGN_DETAILS,
isInPatient: true,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
isInPatient: true,
nameLine1:
TranslationBase
.of(
context)
.lab,
nameLine2:
TranslationBase
.of(
context)
.result,
icon:
'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1:
TranslationBase
.of(
context)
.radiology,
nameLine2:
TranslationBase
.of(
context)
.result,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
isInPatient: isInpatient,
patientType: patientType,
arrivalType: arrivalType,
route:
ORDER_PRESCRIPTION_NEW,
isSelectInpatient: true,
nameLine1:
TranslationBase
.of(
context)
.patient,
nameLine2:
TranslationBase
.of(
context)
.prescription,
icon:
'patient/order_prescription.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
isInPatient: isInpatient,
isDischargedPatient:
isDischargedPatient,
nameLine1:
TranslationBase
.of(
context)
.progress,
nameLine2:
TranslationBase
.of(
context)
.note,
icon:
'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
isInPatient: isInpatient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
isDischargedPatient:
isDischargedPatient,
nameLine1:
"Order",
//"Text",
nameLine2:
"Sheet",
//TranslationBase.of(context).orders,
icon:
'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
isInPatient: isInpatient,
nameLine1:
TranslationBase
.of(
context)
.orders,
nameLine2:
TranslationBase
.of(
context)
.procedures,
icon:
'patient/Order_Procedures.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
isInPatient: isInpatient,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: MEDICAL_FILE,
nameLine1:
"Medical",
//Health
isInPatient: isInpatient,
nameLine2:
"Report",
//Report
//TranslationBase.of(context).summaryReport,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route:
REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true,
isDisable:
isDischargedPatient ||
isFromSearch,
nameLine1:
TranslationBase
.of(
context)
.referral,
nameLine2:
TranslationBase
.of(
context)
.patient,
icon:
'patient/refer_patient.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route:
PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1:
TranslationBase
.of(
context)
.insurance,
nameLine2:
TranslationBase
.of(
context)
.approvals,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",
icon:
'patient/patient_sick_leave.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1:
TranslationBase
.of(
context)
.patientSick,
nameLine2:
TranslationBase
.of(
context)
.leave,
icon:
'patient/patient_sick_leave.png'),
],
),
);
}
}

@ -0,0 +1,309 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
// ignore: must_be_immutable
class ProfileGridForOther extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final bool isInpatient;
String from;
String to;
ProfileGridForOther(
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient, this.from,this.to})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: const EdgeInsets
.symmetric(
vertical: 15.0,
horizontal: 15),
child: GridView.count(
shrinkWrap: true,
physics:
NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
children: [
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
from: from,
to: to,
nameLine1:
TranslationBase.of(
context)
.vital,
nameLine2:
TranslationBase.of(
context)
.signs,
route:
VITAL_SIGN_DETAILS,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: LAB_RESULT,
nameLine1:
TranslationBase.of(
context)
.lab,
nameLine2:
TranslationBase.of(
context)
.result,
icon:
'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
isInPatient:
isInpatient,
route:
RADIOLOGY_PATIENT,
nameLine1:
TranslationBase.of(
context)
.radiology,
nameLine2:
TranslationBase.of(
context)
.service,
icon:
'patient/health_summary.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
ORDER_PRESCRIPTION_NEW,
nameLine1:
TranslationBase.of(
context)
.orders,
nameLine2:
TranslationBase.of(
context)
.prescription,
icon:
'patient/order_prescription.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon:
'patient/health_summary.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: PATIENT_ECG,
nameLine1:
TranslationBase.of(
context)
.patient,
nameLine2: "ECG",
icon:
'patient/patient_sick_leave.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
ORDER_PROCEDURE,
nameLine1:
TranslationBase.of(
context)
.orders,
nameLine2:
TranslationBase.of(
context)
.procedures,
icon:
'patient/Order_Procedures.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1:
TranslationBase.of(
context)
.insurance,
nameLine2:
TranslationBase.of(
context)
.service,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: ADD_SICKLEAVE,
nameLine1:
TranslationBase.of(
context)
.patientSick,
nameLine2:
TranslationBase.of(
context)
.leave,
icon:
'patient/patient_sick_leave.png'),
if (patient.appointmentNo !=
null &&
patient.appointmentNo !=
0)
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
PATIENT_UCAF_REQUEST,
isDisable:
patient.patientStatusType !=
43
? true
: false,
nameLine1:
TranslationBase.of(
context)
.patient,
nameLine2:
TranslationBase.of(
context)
.ucaf,
icon:
'patient/ucaf.png'),
if (patient.appointmentNo !=
null &&
patient.appointmentNo !=
0)
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
REFER_PATIENT_TO_DOCTOR,
isDisable: patient
.patientStatusType !=
43
? true
: false,
nameLine1:
TranslationBase.of(
context)
.referral,
nameLine2:
TranslationBase.of(
context)
.patient,
icon:
'patient/refer_patient.png'),
if (patient.appointmentNo !=
null &&
patient.appointmentNo !=
0)
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
PATIENT_ADMISSION_REQUEST,
isDisable:
patient.patientStatusType !=
43
? true
: false,
nameLine1:
TranslationBase.of(
context)
.admission,
nameLine2:
TranslationBase.of(
context)
.request,
icon:
'patient/admission_req.png'),
],
),
),
],
);
}
}

@ -0,0 +1,164 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
class ProfileGridForSearch extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final bool isInpatient;
String from;
String to;
ProfileGridForSearch(
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient, this.from,this.to})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: GridView.count(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
children: [
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
icon: 'patient/Order_Procedures.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
],
),
),
],
);
}
}

@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.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/patient_profile_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';

@ -49,7 +49,7 @@ class _AppButtonState extends State<AppButton> {
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height * 0.075,
// height: 60,//MediaQuery.of(context).size.height * 0.075,
child: IgnorePointer(
ignoring: widget.loading ||widget.disabled,
child: RawMaterialButton(

@ -48,6 +48,7 @@ class AppTextFormField extends FormField<String> {
},
textInputAction: textInputAction,
onFieldSubmitted: onFieldSubmitted,
decoration: InputDecoration(
hintText: hintText,
suffixIcon: prefix,

Loading…
Cancel
Save