fix patient card appbare bugs

merge-requests/432/head
mosazaid 4 years ago
parent c52866c596
commit 0528323e15

@ -20,9 +20,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return PreferredSize( return Container(
preferredSize: Size(double.infinity, 200),
child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,), left: 0, right: 5, bottom: 5,),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -43,18 +41,20 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
AppText( Expanded(
child: AppText(
patient.firstName != null ? patient.firstName != null ?
(Helpers.capitalize(patient.firstName) + (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier *2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
patient.gender == 1 ),
patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -72,7 +72,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -256,8 +256,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -295,7 +294,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,
@ -311,7 +310,6 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
], ],
), ),
), ),
),
); );
} }

@ -54,7 +54,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -72,7 +72,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -256,8 +256,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -295,7 +294,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -63,17 +63,20 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
AppText( Expanded(
child: AppText(
patient.firstName != null ?
(Helpers.capitalize(patient.firstName) + (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patient.lastName)), patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier *2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
patient.gender == 1 ),
patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -91,7 +94,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -210,7 +213,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate??''), convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 * fontSize: 1.5 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -275,8 +278,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -314,7 +316,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -63,18 +63,20 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
AppText( Expanded(
child: AppText(
patient.firstName != null ? patient.firstName != null ?
(Helpers.capitalize(patient.firstName) + (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier *2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
patient.gender == 1 ),
patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -92,7 +94,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -211,7 +213,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate??''), convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 * fontSize: 1.5 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -276,8 +278,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -315,7 +316,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -13,6 +14,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/screens/base/base_view.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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -25,6 +27,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class UpdateObjectivePage extends StatefulWidget { class UpdateObjectivePage extends StatefulWidget {
@ -33,8 +36,13 @@ class UpdateObjectivePage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage( UpdateObjectivePage(
{Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, this.changeLoadingState}); {Key key,
this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo,
this.changeLoadingState});
@override @override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState(); _UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -55,6 +63,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
)), )),
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
@ -97,30 +106,55 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
// baseViewModel: model, // baseViewModel: model,
body: Column(
body: SingleChildScrollView( mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container(
color: Color.fromRGBO(248, 248, 248, 1),
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.95,
child: Container(
margin: EdgeInsets.all(8.0),
padding: EdgeInsets.all(12.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier( HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
Texts(TranslationBase.of(context).physicalSystemExamination, AppText(
"${TranslationBase.of(context).physicalSystemExamination}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal,
),
/*Texts(
TranslationBase.of(context)
.physicalSystemExamination,
variant: isSysExaminationExpand variant: isSysExaminationExpand
? "bodyText" ? "bodyText"
: '', : '',
bold: isSysExaminationExpand ? true : false, bold: isSysExaminationExpand
color: Colors.black), ? true
: false,
color: Colors.black),*/
Icon( Icon(
FontAwesomeIcons.asterisk, FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor, color: AppGlobal.appPrimaryColor,
@ -136,8 +170,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
}); });
}, },
child: Icon(isSysExaminationExpand child: Icon(isSysExaminationExpand
? EvaIcons.minus ? Icons.keyboard_arrow_up
: EvaIcons.plus)) : Icons.keyboard_arrow_down))
], ],
), ),
bodyWidget: Column(children: [ bodyWidget: Column(children: [
@ -147,18 +181,21 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Column( Column(
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(
EdgeInsets.only(left: 10, right: 10, top: 15), left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).physicalSystemExamination, hintText: TranslationBase.of(context)
.physicalSystemExamination,
fontSize: 13.5, fontSize: 13.5,
onTapTextFields: () { onTapTextFields: () {
openExaminationList(context); openExaminationList(context);
}, },
readOnly: true, readOnly: true,
// hintColor: Colors.black, // hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline, suffixIcon:
suffixIconColor: AppGlobal.appPrimaryColor, EvaIcons.plusCircleOutline,
suffixIconColor:
AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
// controller: messageController, // controller: messageController,
validator: (value) { validator: (value) {
@ -173,9 +210,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
height: 20, height: 20,
), ),
Column( Column(
children: children: widget.mySelectedExamination
widget.mySelectedExamination.map((examination) { .map((examination) {
TextEditingController remarksController= TextEditingController(text :examination.remark); TextEditingController
remarksController =
TextEditingController(
text: examination.remark);
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -183,11 +223,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: Column(children: [ child: Column(children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment
.spaceBetween,
children: [ children: [
Texts( Texts(
( examination (examination
.selectedExamination.nameEn ) .selectedExamination
.nameEn)
.toUpperCase(), .toUpperCase(),
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,
@ -199,44 +241,46 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment
.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
InkWell( InkWell(
child: Center( child: Center(
child: Container( child: Container(
height: height: screenSize
screenSize.height * .height *
0.070, 0.070,
decoration: decoration: containerBorderDecoration(
containerBorderDecoration(
examination examination
.isNormal .isNormal
? Color( ? Color(
0xFF515A5D) 0xFF515A5D)
: Colors : Colors
.white, .white,
Colors.grey), Colors
.grey),
child: Center( child: Center(
child: Padding( child:
Padding(
padding: padding:
const EdgeInsets const EdgeInsets.all(
.all(8.0), 8.0),
child: Text( child: Text(
TranslationBase.of(context).normal, TranslationBase.of(
style: TextStyle( context)
fontSize: 12, .normal,
color: style:
examination TextStyle(
.isNormal fontSize:
12,
color: examination.isNormal
? Colors.white ? Colors.white
: Colors : Colors.black,
.black,
//Colors.black, //Colors.black,
fontWeight: fontWeight:
FontWeight FontWeight.bold,
.bold,
), ),
), ),
), ),
@ -244,11 +288,15 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
onTap: () { onTap: () {
setState(() { setState(() {
examination.isAbnormal = examination
.isAbnormal =
false; false;
examination.isNormal = examination
.isNormal =
true; true;
examination.notExamined = false; examination
.notExamined =
false;
}); });
}), }),
SizedBox( SizedBox(
@ -257,37 +305,38 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
InkWell( InkWell(
child: Center( child: Center(
child: Container( child: Container(
height: height: screenSize
screenSize.height * .height *
0.070, 0.070,
decoration: decoration: containerBorderDecoration(
containerBorderDecoration(
examination examination
.isAbnormal .isAbnormal
? Color( ? Color(
0xFF515A5D) 0xFF515A5D)
: Colors : Colors
.white, .white,
Colors.black), Colors
.black),
child: Center( child: Center(
child: Padding( child:
Padding(
padding: padding:
const EdgeInsets const EdgeInsets.all(
.all(8.0), 8.0),
child: Text( child: Text(
TranslationBase.of(context).abnormal, TranslationBase.of(
style: TextStyle( context)
fontSize: 12, .abnormal,
color: style:
examination TextStyle(
.isAbnormal fontSize:
12,
color: examination.isAbnormal
? Colors.white ? Colors.white
: Colors : Colors.black,
.black,
//Colors.black, //Colors.black,
fontWeight: fontWeight:
FontWeight FontWeight.bold,
.bold,
), ),
), ),
), ),
@ -295,49 +344,53 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
onTap: () { onTap: () {
setState(() { setState(() {
examination.isNormal = examination
.isNormal =
false; false;
examination.isAbnormal = examination
.isAbnormal =
true; true;
examination.notExamined = false; examination
.notExamined =
false;
}); });
}),SizedBox( }),
SizedBox(
width: 12, width: 12,
), ),
InkWell( InkWell(
child: Center( child: Center(
child: Container( child: Container(
height: height: screenSize
screenSize.height * .height *
0.070, 0.070,
decoration: decoration: containerBorderDecoration(
containerBorderDecoration(
examination examination
.notExamined .notExamined
? Color( ? Color(
0xFF515A5D) 0xFF515A5D)
: Colors : Colors
.white, .white,
Colors.black), Colors
.black),
child: Center( child: Center(
child: Padding( child:
Padding(
padding: padding:
const EdgeInsets const EdgeInsets.all(
.all(8.0), 8.0),
child: Text( child: Text(
"Not Examined", "Not Examined",
style: TextStyle( style:
fontSize: 12, TextStyle(
color: fontSize:
examination 12,
.notExamined color: examination.notExamined
? Colors.white ? Colors.white
: Colors : Colors.black,
.black,
//Colors.black, //Colors.black,
fontWeight: fontWeight:
FontWeight FontWeight.bold,
.bold,
), ),
), ),
), ),
@ -345,24 +398,28 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
onTap: () { onTap: () {
setState(() { setState(() {
examination.isAbnormal = examination
.isAbnormal =
false; false;
examination.isNormal = examination
.isNormal =
false; false;
examination.notExamined = true; examination
.notExamined =
true;
}); });
}), }),
], ],
), ),
InkWell( InkWell(
child: Icon( child: Icon(
FontAwesomeIcons.trash, FontAwesomeIcons.trash,
color: Colors.grey, color: Colors.grey,
size: 20, size: 20,
), ),
onTap: () => removeExamination( onTap: () => removeExamination(
examination.selectedExamination), examination
.selectedExamination),
) )
], ],
), ),
@ -373,21 +430,31 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hasLabelText: remarksController.text != ''?true:false, hasLabelText:
remarksController
.text !=
''
? true
: false,
showLabelText: true, showLabelText: true,
hintText: TranslationBase.of(context).remarks, hintText:
TranslationBase.of(
context)
.remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 25, maxLines: 25,
minLines: 4, minLines: 4,
controller: remarksController, controller:
remarksController,
onChanged: (val) { onChanged: (val) {
examination.remark = val; examination.remark = val;
}, },
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase.of(context) return TranslationBase
.of(context)
.emptyMessage; .emptyMessage;
else else
return null; return null;
@ -404,43 +471,70 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
]), ]),
isExpand: isSysExaminationExpand, isExpand: isSysExaminationExpand,
), ),
DividerWithSpacesAround(height: 30,), ],
AppButton( ),
),
),
),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
color: HexColor("#A5A5A5"),
fontColor: HexColor("#5A5A5A"),
fontWeight: FontWeight.bold,
onPressed: () async { onPressed: () async {
await submitUpdateObjectivePage(model); await submitUpdateObjectivePage(model);
}, },
), ),
SizedBox(
height: 30,
), ),
], ],
), ),
), ),
), ],
))); )));
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) {
if(widget.mySelectedExamination.isNotEmpty){
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) { widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null) null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
ListHisProgNotePhysicalExaminationVM( .add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '', remarks: exam.remark ?? '',
createdBy: exam.createdBy??doctorProfile.doctorID, createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
@ -450,15 +544,20 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
isNormal: exam.isNormal, isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination, // masterDescription: exam.selectedExamination,
notExamined: exam.notExamined, notExamined: exam.notExamined,
examinationType: exam.isNormal?1:exam.isAbnormal?2:3, examinationType: exam.isNormal
examinationTypeName: exam.isNormal?"Normal":exam.isAbnormal?'AbNormal':"Not Examined", ? 1
isNew:exam.isNew : exam.isAbnormal
? 2
)); : 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
}); });
if(model.patientPhysicalExamList.isEmpty) { if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel); await model.postPhysicalExam(postPhysicalExamRequestModel);
} else { } else {
await model.patchPhysicalExam(postPhysicalExamRequestModel); await model.patchPhysicalExam(postPhysicalExamRequestModel);
@ -482,8 +581,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where( .where((element) =>
(element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination.typeId);
@ -494,11 +592,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
openExaminationList(BuildContext context) { openExaminationList(BuildContext context) {
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context) InputDecoration textFieldSelectorDecoration(
.size; String hintText, String selectedText, bool isDropDown) {
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -533,7 +629,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
}, },
removeExamination: (masterKey) => removeExamination(masterKey),); removeExamination: (masterKey) => removeExamination(masterKey),
);
}); });
} }
} }
@ -541,10 +638,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
class AddExaminationDailog extends StatefulWidget { class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination; final Function addSelectedExamination;
final Function (MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog( const AddExaminationDailog(
{Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) {Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key); : super(key: key);
@override @override
@ -559,12 +659,11 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup( await model
MasterKeysService.PhysicalExamination); .getMasterLookup(MasterKeysService.PhysicalExamination);
} }
}, },
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Center( body: Center(
@ -587,29 +686,30 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
), ),
MasterKeyCheckboxSearchWidget( MasterKeyCheckboxSearchWidget(
model: model, model: model,
hintSearchText: TranslationBase.of(context).searchExamination, hintSearchText:
buttonName: TranslationBase.of(context).addExamination, TranslationBase.of(context).searchExamination,
buttonName:
TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList, masterList: model.physicalExaminationList,
removeHistory: (history){ removeHistory: (history) {
setState(() { setState(() {
widget.removeExamination(history); widget.removeExamination(history);
}); });
}, },
addHistory: (history){ addHistory: (history) {
setState(() { setState(() {
MySelectedExamination mySelectedExamination = new MySelectedExamination( MySelectedExamination mySelectedExamination =
selectedExamination: history new MySelectedExamination(
); selectedExamination: history);
widget widget.mySelectedExamination
.mySelectedExamination .add(mySelectedExamination);
.add(
mySelectedExamination);
}); });
}, },
addSelectedHistories: (){ addSelectedHistories: () {
widget.addSelectedExamination(); widget.addSelectedExamination();
}, },
isServiceSelected: (master) =>isServiceSelected(master), isServiceSelected: (master) =>
isServiceSelected(master),
), ),
]), ]),
))), ))),
@ -618,10 +718,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
widget (element) =>
.mySelectedExamination
.where((element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) { if (exam.length > 0) {

Loading…
Cancel
Save