make search patient profile have preview services

merge-requests/348/head
mosazaid 5 years ago
parent 572e48efc7
commit fdc893c3d6

@ -41,7 +41,7 @@ class VitalSignsService extends BaseService {
patientVitalSigns = null; patientVitalSigns = null;
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientId; // patient.patientMRN
body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
// body['EpisodeID'] = patient.episodeNo; // body['EpisodeID'] = patient.episodeNo;
body['PatientTypeID'] = 1; body['PatientTypeID'] = 1;

@ -918,7 +918,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.of(context) Navigator.of(context)
.pushNamed(PATIENTS, arguments: { .pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": "7" "selectedType": "7",
"isSearch": false,
}); });
}, },
) )

@ -90,7 +90,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
}); });
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType "selectedType": _selectedType,
"isSearch": true,
}); });
} }
} else { } else {

@ -48,6 +48,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
bool _isInit = true; bool _isInit = true;
String patientType; String patientType;
bool isSearch = false;
String patientTypeTitle; String patientTypeTitle;
var _isLoading = true; var _isLoading = true;
@ -201,6 +202,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
patientType = routeArgs['selectedType']; patientType = routeArgs['selectedType'];
if(routeArgs.containsKey("isSearch")){
isSearch = routeArgs['isSearch'];
}
if (!projectsProvider.isArabic) if (!projectsProvider.isArabic)
patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
else else
@ -362,6 +367,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
"patientType":patientType, "patientType":patientType,
"from" : patient.getFrom, "from" : patient.getFrom,
"to" : patient.getTo, "to" : patient.getTo,
"isSearch" : isSearch,
}); });
},); },);
}).toList(), }).toList(),

@ -9,12 +9,12 @@ 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/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:22/4/2020 *@Date:22/4/2020
@ -25,8 +25,7 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class PatientProfileScreen extends StatelessWidget { class PatientProfileScreen extends StatelessWidget {
PatiantInformtion patient; PatiantInformtion patient;
bool isFromSearch = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,11 +36,14 @@ class PatientProfileScreen extends StatelessWidget {
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String from = routeArgs['from']; String from = routeArgs['from'];
String to = routeArgs['to']; String to = routeArgs['to'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patient.patientMRN??patient.patientId, patientMRN: patient.patientMRN ?? patient.patientId,
doctorID: '', doctorID: '',
editedBy: ''); editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP); await model.getPatientAllergy(generalGetReqForSOAP);
@ -51,13 +53,10 @@ class PatientProfileScreen extends StatelessWidget {
if (model.allergySeverityList.length == 0) { if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity); await model.getMasterLookup(MasterKeysService.AllergySeverity);
} }
}, },
builder: (_, model, w) =>AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).patientProfile, appBarTitle: TranslationBase.of(context).patientProfile,
body: Container( body: Container(
color: Color(0XFFF2F2F2), color: Color(0XFFF2F2F2),
child: CustomScrollView(primary: false, slivers: <Widget>[ child: CustomScrollView(primary: false, slivers: <Widget>[
@ -93,17 +92,21 @@ class PatientProfileScreen extends StatelessWidget {
width: 20, width: 20,
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
patient.firstName + ' ' + patient.lastName, patient.firstName +
' ' +
patient.lastName,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNo, TranslationBase.of(context)
.fileNo,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -115,21 +118,37 @@ class PatientProfileScreen extends StatelessWidget {
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
], ],
), ),
model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?Container( model.patientAllergiesList
width: MediaQuery.of(context).size.width *0.65, .isNotEmpty &&
model.getAllergicNames(
projectViewModel
.isArabic) !=
''
? Container(
width: MediaQuery.of(context)
.size
.width *
0.65,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets
.symmetric(vertical: 8),
child: AppText( child: AppText(
TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), TranslationBase.of(
context)
.allergicTO +
" : " +
model.getAllergicNames(
projectViewModel
.isArabic),
color: Color(0xFFB9382C), color: Color(0xFFB9382C),
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
), ),
), ),
) : AppText(''), )
: AppText(''),
], ],
) )
], ],
@ -149,20 +168,23 @@ class PatientProfileScreen extends StatelessWidget {
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0), 16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).age, TranslationBase.of(context).age,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier, fontSize: 2 *
SizeConfig.textMultiplier,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppText( AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}", "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context) /*patient.age*/}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 *
SizeConfig.textMultiplier,
), ),
], ],
), ),
@ -177,20 +199,25 @@ class PatientProfileScreen extends StatelessWidget {
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0), 16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).nationality, TranslationBase.of(context)
.nationality,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier, fontSize: 2 *
SizeConfig.textMultiplier,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppText( AppText(
patient.nationalityName ??patient.nationality , patient.nationalityName ??
patient.nationality,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 *
SizeConfig.textMultiplier,
), ),
], ],
), ),
@ -205,20 +232,26 @@ class PatientProfileScreen extends StatelessWidget {
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0), 16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).gender, TranslationBase.of(context)
.gender,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier, fontSize: 2 *
SizeConfig.textMultiplier,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppText( AppText(
patient.gender.toString() == '1' ? 'Male' : 'Female', patient.gender.toString() == '1'
? 'Male'
: 'Female',
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 *
SizeConfig.textMultiplier,
), ),
], ],
), ),
@ -241,7 +274,8 @@ class PatientProfileScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).admissionDetail, TranslationBase.of(context)
.admissionDetail,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -254,7 +288,8 @@ class PatientProfileScreen extends StatelessWidget {
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide( border:
Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB), color: Color(0xffBBBBBB),
width: 1, width: 1,
)), )),
@ -268,26 +303,33 @@ class PatientProfileScreen extends StatelessWidget {
Row( Row(
children: [ children: [
Container( Container(
width: width: 14 *
14 * SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(
context)
.dateTime, .dateTime,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
), ),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
patient.createdOn != null patient.createdOn !=
null
? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}"
: "", : "",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight:
fontSize: FontWeight.normal,
1.6 * SizeConfig.textMultiplier, fontSize: 1.6 *
SizeConfig
.textMultiplier,
), ),
), ),
], ],
@ -298,25 +340,32 @@ class PatientProfileScreen extends StatelessWidget {
Row( Row(
children: [ children: [
Container( Container(
width: width: 14 *
14 * SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(
context)
.admissionNo, .admissionNo,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
), ),
), ),
AppText( AppText(
patient.admissionNo != null patient.admissionNo !=
null
? patient.admissionNo ? patient.admissionNo
: '', : '',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight:
fontSize: FontWeight.normal,
1.6 * SizeConfig.textMultiplier, fontSize: 1.6 *
SizeConfig
.textMultiplier,
), ),
], ],
), ),
@ -326,26 +375,35 @@ class PatientProfileScreen extends StatelessWidget {
Row( Row(
children: [ children: [
Container( Container(
width: width: 14 *
14 * SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
child: AppText( child: AppText(
TranslationBase.of(context).losNo, TranslationBase.of(
context)
.losNo,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
), ),
), ),
AppText( AppText(
patient.createdOn != null patient.createdOn != null
? DateUtils ? DateUtils
.differenceBetweenServerDateAndCurrent( .differenceBetweenServerDateAndCurrent(
patient.createdOn, context) patient
.createdOn,
context)
: "", : "",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight:
fontSize: FontWeight.normal,
1.6 * SizeConfig.textMultiplier, fontSize: 1.6 *
SizeConfig
.textMultiplier,
), ),
], ],
), ),
@ -360,32 +418,41 @@ class PatientProfileScreen extends StatelessWidget {
endIndent: 0, endIndent: 0,
), ),
Container( Container(
height: 10 * SizeConfig.textMultiplier, height:
10 * SizeConfig.textMultiplier,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets
.fromLTRB(
16.0, 8.0, 8.0, 8.0), 16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(
context)
.area, .area,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppText( AppText(
patient.clinicDescription, patient
fontWeight: FontWeight.normal, .clinicDescription,
fontWeight:
FontWeight.normal,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
), ),
], ],
), ),
@ -397,25 +464,30 @@ class PatientProfileScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets
.fromLTRB(
16.0, 8.0, 8.0, 8.0), 16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment
.spaceEvenly,
children: [ children: [
Expanded( Expanded(
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(
context) context)
.room, .room,
fontWeight: fontWeight:
FontWeight.bold, FontWeight
.bold,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -427,7 +499,8 @@ class PatientProfileScreen extends StatelessWidget {
child: AppText( child: AppText(
"${patient.nursingStationName}\n${patient.roomId}", "${patient.nursingStationName}\n${patient.roomId}",
fontWeight: fontWeight:
FontWeight.normal, FontWeight
.normal,
fontSize: 1.4 * fontSize: 1.4 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -442,14 +515,16 @@ class PatientProfileScreen extends StatelessWidget {
Expanded( Expanded(
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(
context) context)
.bed, .bed,
fontWeight: fontWeight:
FontWeight.bold, FontWeight
.bold,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -460,7 +535,8 @@ class PatientProfileScreen extends StatelessWidget {
AppText( AppText(
"${patient.bedId}", "${patient.bedId}",
fontWeight: fontWeight:
FontWeight.normal, FontWeight
.normal,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -488,9 +564,20 @@ class PatientProfileScreen extends StatelessWidget {
), ),
SliverPadding( SliverPadding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
sliver: ProfileMedicalInfoWidget( sliver: isFromSearch
patient: patient, patientType:patientType, from: from, to: to, ? ProfileMedicalInfoWidgetSearch(
)) patient: patient,
patientType: patientType,
from: from,
to: to,
)
: ProfileMedicalInfoWidget(
patient: patient,
patientType: patientType,
from: from,
to: to,
),
)
]), ]),
), ),
)); ));

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PatientProfileButton extends StatelessWidget { class PatientProfileButton extends StatelessWidget {
@ -9,24 +11,44 @@ class PatientProfileButton extends StatelessWidget {
final String icon; final String icon;
final dynamic route; final dynamic route;
final PatiantInformtion patient; final PatiantInformtion patient;
String from;
String to;
final String url = "assets/images/"; final String url = "assets/images/";
final bool isDisable;
final bool isLoading;
final Function onTap;
PatientProfileButton( PatientProfileButton(
{Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) {Key key,
this.patient,
this.nameLine1,
this.nameLine2,
this.icon,
this.route,
this.isDisable = false,
this.onTap,
this.isLoading = false,
this.from,
this.to})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0), margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell( child: InkWell(
onTap: () { onTap: isDisable
? null
: onTap != null
? onTap
: () {
navigator(context, this.route); navigator(context, this.route);
}, },
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: child: Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
@ -43,6 +65,7 @@ class PatientProfileButton extends StatelessWidget {
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
), ),
if (isLoading) DrAppCircularProgressIndeicator()
], ],
), ),
), ),
@ -61,7 +84,7 @@ class PatientProfileButton extends StatelessWidget {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
// border: Border.all(), // border: Border.all(),
color: Colors.white, color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB), color: Color(0xffBBBBBB),
@ -81,6 +104,13 @@ class PatientProfileButton extends StatelessWidget {
} }
void navigator(BuildContext context, route) { void navigator(BuildContext context, route) {
Navigator.of(context).pushNamed(route, arguments: {'patient': patient}); if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null) {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
Navigator.of(context).pushNamed(route,
arguments: {'patient': patient, 'from': from, 'to': to});
} }
} }

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,22 +16,16 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';
import '../../shared/app_texts_widget.dart'; import '../../shared/app_texts_widget.dart';
/*
*@author: Elham Rababah
*@Date:22/4/2020
*@param:
*@return:ProfileMedicalInfoWidget
*@desc: Profile Medical Info Widget
*/
class ProfileMedicalInfoWidget extends StatelessWidget { class ProfileMedicalInfoWidget extends StatelessWidget {
ProfileMedicalInfoWidget(
{Key key, this.patient, this.patientType, this.from, this.to});
String from; String from;
String to; String to;
PatiantInformtion patient; PatiantInformtion patient;
String patientType; String patientType;
ProfileMedicalInfoWidget(
{Key key, this.patient, this.patientType, this.from, this.to});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
@ -185,162 +180,3 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
); );
} }
} }
class CircleAvatarWidget extends StatelessWidget {
const CircleAvatarWidget(
{Key key,
@required this.url,
@required this.des,
this.height,
this.width})
: super(key: key);
final String url;
final String des;
final double height;
final double width;
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Container(
height: height,
width: width,
// width: 50,
// height: 50,
decoration: new BoxDecoration(
// color: Colors.green, // border color
shape: BoxShape.circle,
border: Border.all(color: HexColor('#B7831A'), width: 1.5)),
child: CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
child: Image.asset(url),
backgroundColor: Colors.transparent,
),
),
SizedBox(
height: 10,
),
AppText(
des,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
)
],
),
);
}
}
class PatientProfileButton extends StatelessWidget {
final String nameLine1;
final String nameLine2;
final String icon;
final dynamic route;
final PatiantInformtion patient;
String from;
String to;
final String url = "assets/images/";
final bool isDisable;
final bool isLoading;
final Function onTap;
PatientProfileButton(
{Key key,
this.patient,
this.nameLine1,
this.nameLine2,
this.icon,
this.route,
this.isDisable = false,
this.onTap,
this.isLoading = false,
this.from,
this.to})
: super(key: key);
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell(
onTap: isDisable
? null
: onTap != null
? onTap
: () {
navigator(context, this.route);
},
child: Column(children: <Widget>[
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
this.nameLine1,
color: Color(0xFFB9382C),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
AppText(
this.nameLine2,
color: Colors.black,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
if (isLoading) DrAppCircularProgressIndeicator()
],
),
),
Expanded(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
child: new Image.asset(url + icon))
],
)),
)
]),
),
decoration: BoxDecoration(
// border: Border.all(),
color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.fromLTRB(5, 10, 5, 5),
);
}
void navigator(BuildContext context, route) {
if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null) {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
Navigator.of(context).pushNamed(route,
arguments: {'patient': patient, 'from': from, 'to': to});
}
}

@ -0,0 +1,94 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_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/routes.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../config/size_config.dart';
import '../../shared/app_texts_widget.dart';
class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
String from;
String to;
PatiantInformtion patient;
String patientType;
ProfileMedicalInfoWidgetSearch(
{Key key, this.patient, this.patientType, this.from, this.to});
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => SliverGrid.count(
crossAxisSpacing: 10,
mainAxisSpacing: 20,
crossAxisCount: 2,
childAspectRatio: 1.5,
children: [
PatientProfileButton(
key: key,
patient: patient,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'heartbeat.png'),
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_INSURANCE_APPROVALS,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'lab.png'),
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_ADMISSION_REQUEST,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'heartbeat.png'),
(int.parse(patientType) == 7 || int.parse(patientType) == 6)
? PatientProfileButton(
key: key,
patient: patient,
route: ORDER_PRESCRIPTION,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'lab.png')
: PatientProfileButton(
key: key,
patient: patient,
route: ORDER_PRESCRIPTION_HISTORY,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'lab.png'),
PatientProfileButton(
key: key,
patient: patient,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'sick_leaves_icons.png'),
PatientProfileButton(
key: key,
patient: patient,
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'),
],
),
);
}
}
Loading…
Cancel
Save