diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index fedbfc56..c80b0566 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -126,6 +126,27 @@ class _ProgressNoteState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('Update', + fontSize: 10, + ), + SizedBox(width: 10,), + Container( + color:Colors.red[600], + child: AppText('Canceled', + fontSize: 10, + ), + ), + SizedBox(width: 10,), + AppText('Verify', + fontSize: 10, + ), + SizedBox(width: 10,) + ], + ), + SizedBox(height: 15,), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -189,6 +210,72 @@ class _ProgressNoteState extends State { fontSize: 10, ), ), + + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + note: notesList[index], + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: true, + + )), + ); + }, + child: Icon( + DoctorApp.edit, + size: 18, + )), + SizedBox(width: 10,), + InkWell( + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo), + cancelledNote: true, + lineItemNo: notesList[index].lineItemNo, + createdBy: notesList[index].createdBy, + notes: notesList[index].notes, + verifiedNote: false, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context,model); + GifLoaderDialogUtils.hideDialog(context); + + }, + child: Icon( + FontAwesomeIcons.trash, + size: 18, + )), + SizedBox(width: 10,), + InkWell( + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo), + cancelledNote: false, + lineItemNo: notesList[index].lineItemNo, + createdBy: notesList[index].createdBy, + notes: notesList[index].notes, + verifiedNote: true, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context,model); + GifLoaderDialogUtils.hideDialog(context); + + }, + child: Icon( + FontAwesomeIcons.check, + size: 18, + )) ], ), ], @@ -227,40 +314,5 @@ class _ProgressNoteState extends State { )); } - // searchData(String str, PatientViewModel model) { - // var strExist = str.length > 0 ? true : false; - // - // if (strExist) { - // filteredNotesList = null; - // filteredNotesList = model.patientProgressNoteList - // .where((note) => - // note["DoctorName"].toString().contains(str.toUpperCase())) - // .toList(); - // setState(() { - // notesList = filteredNotesList; - // }); - // } else { - // setState(() { - // notesList = model.patientProgressNoteList; - // }); - // } - // } - convertDateFormat(String str) { - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } } diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 5f3ef251..a5289dd3 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -69,8 +69,8 @@ class _UpdateNoteOrderState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle(title: widget.visitType == 3 - ? 'Add Order Sheet' - : 'Add Progress Note',), + ? (widget.isUpdate?'Update':'Add')+' Order Sheet' + : (widget.isUpdate?'Update':'Add')+' Progress Note',), SizedBox( height: 10.0, ), @@ -82,12 +82,12 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? 'Add Order Sheet' - : 'Add Progress Note', + ? (widget.isUpdate?'Update':'Add')+' Order Sheet' + : (widget.isUpdate?'Update':'Add')+' Progress Note', //TranslationBase.of(context).addProgressNote, controller: progressNoteController, - maxLines: 25, - minLines: 10, + maxLines: 35, + minLines: 25, hasBorder: true, validationError:progressNoteController.text.isEmpty&&isSubmitted?TranslationBase.of(context).emptyMessage:null , @@ -109,8 +109,8 @@ class _UpdateNoteOrderState extends State { children: [ AppButton( title: widget.visitType == 3 - ? 'Add Order Sheet' - : 'Add Progress Note', + ? (widget.isUpdate?'Update':'Add')+' Order Sheet' + : (widget.isUpdate?'Update':'Add')+' Progress Note', color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -131,11 +131,10 @@ class _UpdateNoteOrderState extends State { admissionNo: int.parse(widget.patient .admissionNo), cancelledNote: false, - lineItemNo: 30, + lineItemNo: widget.note.lineItemNo, createdBy: widget.note.createdBy, - notes: progressNoteController.text + notes: progressNoteController.text, - , verifiedNote: false, patientTypeID: widget.patient.patientType,