Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into referral_in_patient

merge-requests/566/head
Mohammad Aljammal 5 years ago
commit 018f216658

@ -141,12 +141,21 @@ class PatientViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientProgressNote(patient) async { Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async {
setState(ViewState.Busy); if(isLocalBusy) {
setState(ViewState.BusyLocal);
}else{
setState(ViewState.Busy);
}
await _patientService.getPatientProgressNote(patient); await _patientService.getPatientProgressNote(patient);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;
setState(ViewState.Error); if(isLocalBusy) {
setState(ViewState.ErrorLocal);
}else{
setState(ViewState.Error);
}
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -63,22 +63,24 @@ class DoctorReplayChat extends StatelessWidget {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
RichText( Expanded(
text: TextSpan( child: RichText(
style: TextStyle( text: TextSpan(
fontSize: 1.6 * style: TextStyle(
SizeConfig.textMultiplier, fontSize: 1.6 *
color: Colors.black), SizeConfig.textMultiplier,
children: <TextSpan>[ color: Colors.black),
new TextSpan( children: <TextSpan>[
text: reply.patientName new TextSpan(
.toString(), text: reply.patientName
style: TextStyle( .toString(),
color: Color(0xFF2B353E), style: TextStyle(
fontWeight: FontWeight.bold, color: Color(0xFF2B353E),
fontFamily: 'Poppins', fontWeight: FontWeight.bold,
fontSize: 20)), fontFamily: 'Poppins',
], fontSize: 20)),
],
),
), ),
), ),
InkWell( InkWell(

@ -9,15 +9,12 @@ 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/patients/profile/patient_profile_header_with_appointment_card_app_bar.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';
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 '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart'; import '../../../../models/patient/patiant_info_model.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart';
@ -40,7 +37,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
final _controller = TextEditingController(); final _controller = TextEditingController();
var _isInit = true; var _isInit = true;
getProgressNoteList(BuildContext context, PatientViewModel model) async { getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -55,7 +52,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
model.getPatientProgressNote(progressNoteRequest.toJson()).then((c) { model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) {
notesList = model.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
@ -114,22 +111,223 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
if (notesList[index].status != 2 &&
notesList[index].status != 4)
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
UpdateNoteOrder(
note: notesList[
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],
child: Row(
children: [
Icon(
DoctorApp.edit_1,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
'Update',
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
confirmFun: () 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, isLocalBusy: true);
GifLoaderDialogUtils
.hideDialog(
context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.red[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons.trash,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
'Cancel',
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(context: context, confirmFun: () 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, isLocalBusy: true);
GifLoaderDialogUtils
.hideDialog(context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons.check,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
'Verify',
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
),
),
SizedBox(
width: 10,
)
],
),
SizedBox(
height: 10,
),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.65, width: MediaQuery.of(context)
.size
.width *
0.65,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
AppText('Created By: ', AppText(
'Created By: ',
fontSize: 10, fontSize: 10,
), ),
Expanded( Expanded(
@ -138,8 +336,12 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
], ],
), ),
if(notesList[index].status == 4)
AppText( AppText(
notesList[index].status == 4?'Canceled':'',fontWeight: FontWeight.w600, color: Colors.red.shade700,fontSize: 12,), 'Canceled',fontWeight: FontWeight.w600, color: Colors.red.shade700,fontSize: 12,),
if(notesList[index].status == 2)
AppText(
'verified',fontWeight: FontWeight.w600, color: Colors.grey.shade700,fontSize: 12,),
], ],
), ),
), ),
@ -179,18 +381,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
notesList[index].notes,
fontSize: 10,
),
),
],
),
], ],
), ),
), ),
@ -204,63 +394,84 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
), ),
], ],
), ),
), ),
), ),
); );
} }
InputDecoration buildInputDecoration(BuildContext context, hint) { showMyDialog({BuildContext context, Function confirmFun, isCancel = true}) {
return InputDecoration( showDialog(
prefixIcon: Icon(Icons.search, color: Colors.black), context: context,
filled: true, child: Center(
fillColor: Colors.white, child: Container(
hintText: hint, width: MediaQuery
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), .of(context)
enabledBorder: OutlineInputBorder( .size
borderRadius: BorderRadius.all(Radius.circular(10)), .width * 0.8,
borderSide: BorderSide(color: HexColor('#CCCCCC')), height: MediaQuery
), .of(context)
focusedBorder: OutlineInputBorder( .size
borderRadius: BorderRadius.all(Radius.circular(10.0)), .height * 0.5,
borderSide: BorderSide(color: Colors.grey), //), child: AppScaffold(
isShowAppBar: false,
body: Container(
color: Colors.white,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(height: 20,),
Container(
padding: EdgeInsets.all(20),
color: Colors.white,
child: Expanded(
child: AppText(
'Are you sure you want to do this action?',
fontSize: 15,
textAlign: TextAlign.center,
),
),
),
SizedBox(height: MediaQuery
.of(context)
.size
.height * 0.2,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton(
child: AppText(
"Cancel", fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,),//Text("Cancel"),
onPressed: () {
Navigator.of(context).pop();
}),
FlatButton(
child: AppText(
"Confirm", fontWeight: FontWeight.w600,
color: Colors.red.shade700,
fontSize: 16,), //Text("Confirm", ),
onPressed: () async {
await confirmFun();
Navigator.of(context).pop();
})
],
)
],
),
),
),
),
),
)); ));
} }
// 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();
}
} }

@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; 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/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -69,8 +68,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
BottomSheetTitle(title: widget.visitType == 3 BottomSheetTitle(title: widget.visitType == 3
? 'Add Order Sheet' ? (widget.isUpdate?'Update':'Add')+' Order Sheet'
: 'Add Progress Note',), : (widget.isUpdate?'Update':'Add')+' Progress Note',),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
@ -82,12 +81,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: widget.visitType == 3 hintText: widget.visitType == 3
? 'Add Order Sheet' ? (widget.isUpdate?'Update':'Add')+' Order Sheet'
: 'Add Progress Note', : (widget.isUpdate?'Update':'Add')+' Progress Note',
//TranslationBase.of(context).addProgressNote, //TranslationBase.of(context).addProgressNote,
controller: progressNoteController, controller: progressNoteController,
maxLines: 25, maxLines: 35,
minLines: 10, minLines: 25,
hasBorder: true, hasBorder: true,
validationError:progressNoteController.text.isEmpty&&isSubmitted?TranslationBase.of(context).emptyMessage:null , validationError:progressNoteController.text.isEmpty&&isSubmitted?TranslationBase.of(context).emptyMessage:null ,
@ -109,8 +108,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.visitType == 3 title: widget.visitType == 3
? 'Add Order Sheet' ? (widget.isUpdate?'Update':'Add')+' Order Sheet'
: 'Add Progress Note', : (widget.isUpdate?'Update':'Add')+' Progress Note',
color: Color(0xff359846), color: Color(0xff359846),
// disabled: progressNoteController.text.isEmpty, // disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -131,11 +130,10 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
admissionNo: int.parse(widget.patient admissionNo: int.parse(widget.patient
.admissionNo), .admissionNo),
cancelledNote: false, cancelledNote: false,
lineItemNo: 30, lineItemNo: widget.note.lineItemNo,
createdBy: widget.note.createdBy, createdBy: widget.note.createdBy,
notes: progressNoteController.text notes: progressNoteController.text,
,
verifiedNote: false, verifiedNote: false,
patientTypeID: widget.patient.patientType, patientTypeID: widget.patient.patientType,
@ -179,11 +177,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }),
),
], ],
), ),
), ),
); );
} }
} }

@ -57,7 +57,7 @@ class ProcedureCard extends StatelessWidget {
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
), ),
color: color:
entityList.orderType == 1 ? Colors.red[500] : Colors.black, entityList.orderType == 0 ? Colors.black : Colors.red[500],
), ),
), ),
Expanded( Expanded(

Loading…
Cancel
Save