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,34 +106,85 @@ 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(
widthFactor: 0.95,
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.patientProgressNoteList[index]
.status ==
1 &&
authProvider.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy
? Color(0xFFCC9B14):model
.patientProgressNoteList[
index]
.status ==
4?Colors.red.shade700
: model
.patientProgressNoteList[
index]
.status ==
2?Colors.green[600]:Color(0xFFCC9B14),
widget: Column(
children: [ children: [
Container( Column(
margin: EdgeInsets.only(
left: 10,
right: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.all(15),
child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
if (model
if(model.patientProgressNoteList[index].status == 1 && authProvider.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) .patientProgressNoteList[
index]
.status ==
1 &&
authProvider
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy)
AppText( AppText(
'In Progress',fontWeight: FontWeight.bold, color: Color(0xFFCC9B14),fontSize: 16,), 'Pending',
if(model.patientProgressNoteList[index].status == 4) fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
4)
AppText( AppText(
'Canceled',fontWeight: FontWeight.bold, color: Colors.red.shade700,fontSize: 16,), 'Canceled',
if(model.patientProgressNoteList[index].status == 2) fontWeight: FontWeight.bold,
color: Colors.red.shade700,
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
2)
AppText( AppText(
'Verified',fontWeight: FontWeight.bold, color: Colors.grey.shade700,fontSize: 16,), 'Verified',
fontWeight: FontWeight.bold,
color: Colors.green[600],
fontSize: 12,
),
if (model.patientProgressNoteList[index].status != 2 && if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 && authProvider.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) model
.patientProgressNoteList[
index]
.status !=
4 &&
authProvider
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row( Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
@ -144,11 +196,13 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
UpdateNoteOrder( UpdateNoteOrder(
note: model.patientProgressNoteList[ note: model
.patientProgressNoteList[
index], index],
patientModel: patientModel:
model, model,
patient: patient, patient:
patient,
visitType: widget visitType: widget
.visitType, .visitType,
isUpdate: true, isUpdate: true,
@ -157,7 +211,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.green[600], color: Colors.grey[600],
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(
10), 10),
@ -191,30 +245,34 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onTap: () async { onTap: () async {
showMyDialog( showMyDialog(
context: context, context: context,
actionName: "cancel", actionName: "verify",
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils GifLoaderDialogUtils
.showMyDialog( .showMyDialog(
context, context);
);
UpdateNoteReqModel UpdateNoteReqModel
reqModel = reqModel =
UpdateNoteReqModel( UpdateNoteReqModel(
admissionNo: admissionNo: int
int.parse(patient .parse(patient
.admissionNo), .admissionNo),
cancelledNote: true, cancelledNote:
lineItemNo: false,
model.patientProgressNoteList[index] lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo, .lineItemNo,
createdBy: createdBy: model
model.patientProgressNoteList[index] .patientProgressNoteList[
index]
.createdBy, .createdBy,
notes: notes: model
model.patientProgressNoteList[index] .patientProgressNoteList[
index]
.notes, .notes,
verifiedNote: false, verifiedNote: true,
patientTypeID: patient patientTypeID:
patient
.patientType, .patientType,
patientOutSA: false, patientOutSA: false,
); );
@ -222,7 +280,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.updatePatientProgressNote( .updatePatientProgressNote(
reqModel); reqModel);
await getProgressNoteList( await getProgressNoteList(
context, model, isLocalBusy: true); context, model,
isLocalBusy:
true);
GifLoaderDialogUtils GifLoaderDialogUtils
.hideDialog( .hideDialog(
context); context);
@ -230,7 +290,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[600], color: Colors.green[600],
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(
10), 10),
@ -240,7 +300,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons.trash, FontAwesomeIcons
.check,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -248,7 +309,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
'Cancel', 'Verify',
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -262,37 +323,54 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
InkWell( InkWell(
onTap: () async { onTap: () async {
showMyDialog(context: context, actionName: "verify",confirmFun: () async{ showMyDialog(
context: context,
actionName: "cancel",
confirmFun: () async {
GifLoaderDialogUtils GifLoaderDialogUtils
.showMyDialog(context); .showMyDialog(
UpdateNoteReqModel reqModel = context,
);
UpdateNoteReqModel
reqModel =
UpdateNoteReqModel( UpdateNoteReqModel(
admissionNo: int.parse( admissionNo: int
patient.admissionNo), .parse(patient
cancelledNote: false, .admissionNo),
lineItemNo: model.patientProgressNoteList[index] cancelledNote: true,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo, .lineItemNo,
createdBy: model.patientProgressNoteList[index] createdBy: model
.patientProgressNoteList[
index]
.createdBy, .createdBy,
notes: notes: model
model.patientProgressNoteList[index].notes, .patientProgressNoteList[
verifiedNote: true, index]
.notes,
verifiedNote: false,
patientTypeID: patientTypeID:
patient.patientType, patient
.patientType,
patientOutSA: false, patientOutSA: false,
); );
await model await model
.updatePatientProgressNote( .updatePatientProgressNote(
reqModel); reqModel);
await getProgressNoteList( await getProgressNoteList(
context, model, isLocalBusy: true); context, model,
isLocalBusy:
true);
GifLoaderDialogUtils GifLoaderDialogUtils
.hideDialog(context); .hideDialog(
context);
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[600], color: Colors.red[600],
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(
10), 10),
@ -302,7 +380,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons.check, FontAwesomeIcons
.trash,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -310,7 +389,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
'Verify', 'Cancel',
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -319,6 +398,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
), ),
), ),
SizedBox( SizedBox(
width: 10, width: 10,
) )
@ -337,7 +417,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
0.65, 0.60,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
@ -353,23 +433,35 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.patientProgressNoteList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,), model
.patientProgressNoteList[
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12,
),
), ),
], ],
), ),
], ],
), ),
), ),
Column( Column(
children: [ children: [
AppText( AppText(
model.patientProgressNoteList[index] model
.patientProgressNoteList[
index]
.createdOn != .createdOn !=
null null
? DateUtils ? DateUtils.getDayMonthYearDateFormatted(
.getDayMonthYearDateFormatted( DateUtils.getDateTimeFromServerFormat(
DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) model
.patientProgressNoteList[
index]
.createdOn))
: DateUtils : DateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
@ -377,14 +469,18 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model.patientProgressNoteList[index] model
.patientProgressNoteList[
index]
.createdOn != .createdOn !=
null null
? DateUtils ? DateUtils.getHour(DateUtils
.getHour( .getDateTimeFromServerFormat(
DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn )) model
: DateUtils .patientProgressNoteList[
.getHour( index]
.createdOn))
: DateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
@ -404,19 +500,22 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.patientProgressNoteList[index].notes, model
.patientProgressNoteList[
index]
.notes,
fontSize: 10, fontSize: 10,
), ),
), ),
]) ])
], ],
), ),
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
], ],
),
),
); );
}), }),
), ),

Loading…
Cancel
Save