Merge branch 'development' into design-changes

merge-requests/586/head
mosazaid 5 years ago
commit b3e8ecaef2

@ -10,6 +10,7 @@ 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/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -105,318 +106,416 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: ListView.builder( child: ListView.builder(
itemCount: model.patientProgressNoteList.length, itemCount: model.patientProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Column( return FractionallySizedBox(
children: [ widthFactor: 0.95,
Container( child: CardWithBgWidget(
margin: EdgeInsets.only( hasBorder: false,
left: 10, bgColor: model.patientProgressNoteList[index]
right: 10, .status ==
), 1 &&
decoration: BoxDecoration( authProvider.doctorProfile.doctorID !=
color: Colors.white, model
borderRadius: BorderRadius.circular(10), .patientProgressNoteList[
), index]
padding: EdgeInsets.all(15), .createdBy
child: Column( ? Color(0xFFCC9B14):model
crossAxisAlignment: .patientProgressNoteList[
CrossAxisAlignment.start, index]
children: [ .status ==
4?Colors.red.shade700
: model
.patientProgressNoteList[
index]
.status ==
2?Colors.green[600]:Color(0xFFCC9B14),
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (model
.patientProgressNoteList[
index]
.status ==
1 &&
authProvider
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy)
AppText(
'Pending',
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
4)
AppText(
'Canceled',
fontWeight: FontWeight.bold,
color: Colors.red.shade700,
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
2)
AppText(
'Verified',
fontWeight: FontWeight.bold,
color: Colors.green[600],
fontSize: 12,
),
if (model.patientProgressNoteList[index].status != 2 &&
model
.patientProgressNoteList[
index]
.status !=
4 &&
authProvider
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
UpdateNoteOrder(
note: model
.patientProgressNoteList[
index],
patientModel:
model,
patient:
patient,
visitType: widget
.visitType,
isUpdate: true,
)),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
if(model.patientProgressNoteList[index].status == 1 && authProvider.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) child: Row(
AppText( children: [
'In Progress',fontWeight: FontWeight.bold, color: Color(0xFFCC9B14),fontSize: 16,), Icon(
if(model.patientProgressNoteList[index].status == 4) DoctorApp.edit_1,
AppText( size: 12,
'Canceled',fontWeight: FontWeight.bold, color: Colors.red.shade700,fontSize: 16,), color: Colors.white,
if(model.patientProgressNoteList[index].status == 2) ),
AppText( SizedBox(
'Verified',fontWeight: FontWeight.bold, color: Colors.grey.shade700,fontSize: 16,), width: 2,
if (model.patientProgressNoteList[index].status != 2 && ),
model.patientProgressNoteList[index].status != 4 && authProvider.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) AppText(
Row( 'Update',
crossAxisAlignment: fontSize: 10,
CrossAxisAlignment.start, color: Colors.white,
children: [ ),
InkWell( ],
onTap: () { ),
Navigator.push( padding: EdgeInsets.all(6),
context,
MaterialPageRoute(
builder: (context) =>
UpdateNoteOrder(
note: model.patientProgressNoteList[
index],
patientModel:
model,
patient: patient,
visitType: widget
.visitType,
isUpdate: true,
)),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.green[600],
borderRadius:
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], ),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: "verify",
confirmFun: () async {
GifLoaderDialogUtils
.showMyDialog(
context);
UpdateNoteReqModel
reqModel =
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
cancelledNote:
false,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: true,
patientTypeID:
patient
.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.green[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
DoctorApp.edit_1, FontAwesomeIcons
size: 12, .check,
color: Colors.white, size: 12,
), color: Colors.white,
SizedBox( ),
width: 2, SizedBox(
), width: 2,
AppText( ),
'Update', AppText(
fontSize: 10, 'Verify',
color: Colors.white, fontSize: 10,
), color: Colors.white,
], ),
],
),
padding: EdgeInsets.all(6),
), ),
padding: EdgeInsets.all(6),
), ),
), SizedBox(
SizedBox( width: 10,
width: 10, ),
), InkWell(
InkWell( onTap: () async {
onTap: () async { showMyDialog(
showMyDialog( context: context,
context: context, actionName: "cancel",
actionName: "cancel", confirmFun: () async {
confirmFun: () async { GifLoaderDialogUtils
GifLoaderDialogUtils .showMyDialog(
.showMyDialog( context,
context, );
); UpdateNoteReqModel
UpdateNoteReqModel reqModel =
reqModel = UpdateNoteReqModel(
UpdateNoteReqModel( admissionNo: int
admissionNo: .parse(patient
int.parse(patient .admissionNo),
.admissionNo), cancelledNote: true,
cancelledNote: true, lineItemNo: model
lineItemNo: .patientProgressNoteList[
model.patientProgressNoteList[index] index]
.lineItemNo, .lineItemNo,
createdBy: createdBy: model
model.patientProgressNoteList[index] .patientProgressNoteList[
.createdBy, index]
notes: .createdBy,
model.patientProgressNoteList[index] notes: model
.notes, .patientProgressNoteList[
verifiedNote: false, index]
patientTypeID: patient .notes,
.patientType, verifiedNote: false,
patientOutSA: false, patientTypeID:
); patient
await model .patientType,
.updatePatientProgressNote( patientOutSA: false,
reqModel); );
await getProgressNoteList( await model
context, model, isLocalBusy: true); .updatePatientProgressNote(
GifLoaderDialogUtils reqModel);
.hideDialog( await getProgressNoteList(
context); context, model,
}); isLocalBusy:
}, true);
child: Container( GifLoaderDialogUtils
decoration: BoxDecoration( .hideDialog(
color: Colors.red[600], context);
borderRadius: });
BorderRadius.circular( },
10), child: Container(
), decoration: BoxDecoration(
// color:Colors.red[600], color: Colors.red[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons.trash, FontAwesomeIcons
size: 12, .trash,
color: Colors.white, size: 12,
), color: Colors.white,
SizedBox( ),
width: 2, SizedBox(
), width: 2,
AppText( ),
'Cancel', AppText(
fontSize: 10, 'Cancel',
color: Colors.white, fontSize: 10,
), color: Colors.white,
], ),
],
),
padding: EdgeInsets.all(6),
), ),
padding: EdgeInsets.all(6),
), ),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(context: context, actionName: "verify",confirmFun: () async{
GifLoaderDialogUtils
.showMyDialog(context);
UpdateNoteReqModel reqModel =
UpdateNoteReqModel(
admissionNo: int.parse(
patient.admissionNo),
cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index]
.lineItemNo,
createdBy: model.patientProgressNoteList[index]
.createdBy,
notes:
model.patientProgressNoteList[index].notes,
verifiedNote: true,
patientTypeID:
patient.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model, isLocalBusy: true);
GifLoaderDialogUtils
.hideDialog(context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row( SizedBox(
children: [ width: 10,
Icon( )
FontAwesomeIcons.check, ],
size: 12, ),
color: Colors.white, SizedBox(
), height: 10,
SizedBox( ),
width: 2, Row(
), mainAxisAlignment:
AppText( MainAxisAlignment.spaceBetween,
'Verify', crossAxisAlignment:
fontSize: 10, CrossAxisAlignment.start,
color: Colors.white, children: [
), Container(
], width: MediaQuery.of(context)
), .size
padding: EdgeInsets.all(6), .width *
0.60,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
'Created By: ',
fontSize: 10,
),
Expanded(
child: AppText(
model
.patientProgressNoteList[
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12,
),
),
],
),
],
), ),
), ),
SizedBox( Column(
width: 10,
)
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.65,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( AppText(
crossAxisAlignment: model
CrossAxisAlignment .patientProgressNoteList[
.start, index]
children: [ .createdOn !=
AppText( null
'Created By: ', ? DateUtils.getDayMonthYearDateFormatted(
fontSize: 10, DateUtils.getDateTimeFromServerFormat(
), model
Expanded( .patientProgressNoteList[
child: AppText( index]
model.patientProgressNoteList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,), .createdOn))
), : DateUtils
], .getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
model
.patientProgressNoteList[
index]
.createdOn !=
null
? DateUtils.getHour(DateUtils
.getDateTimeFromServerFormat(
model
.patientProgressNoteList[
index]
.createdOn))
: DateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
), ),
], ],
), crossAxisAlignment:
), CrossAxisAlignment.end,
Column( )
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( Expanded(
model.patientProgressNoteList[index] child: AppText(
.createdOn != model
null .patientProgressNoteList[
? DateUtils index]
.getDayMonthYearDateFormatted( .notes,
DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) fontSize: 10,
: DateUtils ),
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
model.patientProgressNoteList[index]
.createdOn !=
null
? DateUtils
.getHour(
DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn ))
: DateUtils
.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
),
],
crossAxisAlignment:
CrossAxisAlignment.end,
)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
model.patientProgressNoteList[index].notes,
fontSize: 10,
), ),
), ])
]) ],
], ),
), SizedBox(
), height: 20,
SizedBox( ),
height: 20, ],
), ),
], ),
); );
}), }),
), ),

Loading…
Cancel
Save