adding google anlyatic to doctor app

medical_report_changes
hussam al-habibeh 5 years ago
parent cac949f402
commit d29d3e2666

@ -29,9 +29,7 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<MedicalFileViewModel>( return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
builder: builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold(
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
isInpatient: isInpatient, isInpatient: isInpatient,
@ -45,8 +43,7 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
child: Container( child: Container(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@ -76,15 +73,13 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
), ),
), ),
), ),
(model.medicalFileList != null && (model.medicalFileList != null && model.medicalFileList.length != 0)
model.medicalFileList.length != 0)
? ListView.builder( ? ListView.builder(
//physics: , //physics: ,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0] itemCount: model.medicalFileList[0].entityList[0].timelines.length,
.timelines.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
@ -120,43 +115,26 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
: "", : "",
episode: model.medicalFileList[0].entityList[0].timelines[index] episode: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty .timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index] ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.timeLineEvents[0].consulations[0].episodeID .consulations[0].episodeID
.toString() .toString()
: "", : "",
vistDate: vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()),
model.medicalFileList[0].entityList[0].timelines[index].date.toString()), settings: RouteSettings(name: 'MedicalFileDetails'),
settings: RouteSettings(name: 'MedicalFileDetails'),), ),
); );
}, },
child: DoctorCard( child: DoctorCard(
doctorName: model doctorName: model.medicalFileList[0].entityList[0].timelines[index].doctorName,
.medicalFileList[0] clinic: model.medicalFileList[0].entityList[0].timelines[index].clinicName,
.entityList[0] branch: model.medicalFileList[0].entityList[0].timelines[index].projectName,
.timelines[index] profileUrl: model.medicalFileList[0].entityList[0].timelines[index].doctorImage,
.doctorName, appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
clinic: model.medicalFileList[0].entityList[0] model.medicalFileList[0].entityList[0].timelines[index].date,
.timelines[index].clinicName,
branch: model.medicalFileList[0].entityList[0]
.timelines[index].projectName,
profileUrl: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorImage,
appointmentDate:
AppDateUtils.getDateTimeFromServerFormat(
model.medicalFileList[0].entityList[0]
.timelines[index].date,
), ),
isPrescriptions: true, isPrescriptions: true,
isShowEye: model isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.medicalFileList[0] .consulations.length !=
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.length !=
0 0
? true ? true
: false), : false),
@ -172,8 +150,7 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context) child: AppText(TranslationBase.of(context).noMedicalFileFound),
.noMedicalFileFound),
) )
], ],
), ),

@ -98,7 +98,9 @@ class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew>
patient: patient, patient: patient,
indexInsurance: index, indexInsurance: index,
patientType: patientType, patientType: patientType,
),settings: RouteSettings(name: 'InsuranceApprovalsDetails'),), ),
settings: RouteSettings(name: 'InsuranceApprovalsDetails'),
),
); );
}, },
child: DoctorCardInsurance( child: DoctorCardInsurance(
@ -189,7 +191,9 @@ class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew>
patient: patient, patient: patient,
indexInsurance: index, indexInsurance: index,
patientType: patientType, patientType: patientType,
),settings: RouteSettings(name: 'InsuranceApprovalsDetails'),), ),
settings: RouteSettings(name: 'InsuranceApprovalsDetails'),
),
); );
}, },
child: DoctorCardInsurance( child: DoctorCardInsurance(

@ -98,7 +98,6 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
settings: RouteSettings(name: 'AddVerifyMedicalReport'), settings: RouteSettings(name: 'AddVerifyMedicalReport'),
), ),
); );
}, },
label: TranslationBase.of(context).createNewMedicalReport, label: TranslationBase.of(context).createNewMedicalReport,
), ),
@ -119,7 +118,8 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
model: model, model: model,
medicalNote: model.medicalReportList[index].reportDataHtml, medicalNote: model.medicalReportList[index].reportDataHtml,
), ),
settings: RouteSettings(name: 'AddVerifyMedicalReport')),); settings: RouteSettings(name: 'AddVerifyMedicalReport')),
);
} else { } else {
Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: {
'patient': patient, 'patient': patient,

@ -45,8 +45,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
AuthenticationViewModel authenticationViewModel; AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
{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);
@ -61,10 +60,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
model model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) {
.getPatientProgressNote(progressNoteRequest.toJson(),
isLocalBusy: isLocalBusy)
.then((c) {
notesList = model.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
@ -73,14 +69,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context); authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
final routeArgs = ModalRoute final routeArgs = ModalRoute.of(context).settings.arguments as Map;
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model), onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -112,7 +104,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patient: patient, patient: patient,
visitType: widget.visitType, visitType: widget.visitType,
isUpdate: false, isUpdate: false,
),settings: RouteSettings(name: 'UpdateNoteOrder'),), ),
settings: RouteSettings(name: 'UpdateNoteOrder'),
),
); );
}, },
label: widget.visitType == 3 label: widget.visitType == 3
@ -153,58 +147,35 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
if (model.patientProgressNoteList[index].status == 4) if (model.patientProgressNoteList[index].status == 4)
AppText( AppText(
TranslationBase TranslationBase.of(context).noteCanceled,
.of(context)
.noteCanceled,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.red.shade700, color: Colors.red.shade700,
fontSize: 12, fontSize: 12,
), ),
if (model if (model.patientProgressNoteList[index].status == 2)
.patientProgressNoteList[
index]
.status ==
2)
AppText( AppText(
TranslationBase TranslationBase.of(context).noteVerified,
.of(context)
.noteVerified,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.green[600], color: Colors.green[600],
fontSize: 12, fontSize: 12,
), ),
if (model.patientProgressNoteList[index].status != 2 && if (model.patientProgressNoteList[index].status != 2 &&
model model.patientProgressNoteList[index].status != 4 &&
.patientProgressNoteList[ authenticationViewModel.doctorProfile.doctorID ==
index] model.patientProgressNoteList[index].createdBy)
.status !=
4 &&
authenticationViewModel
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => UpdateNoteOrder(
UpdateNoteOrder( note: model.patientProgressNoteList[index],
note: model patientModel: model,
.patientProgressNoteList[ patient: patient,
index], visitType: widget.visitType,
patientModel:
model,
patient:
patient,
visitType: widget
.visitType,
isUpdate: true, isUpdate: true,
)), )),
); );
@ -212,9 +183,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[600], color: Colors.grey[600],
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
@ -229,10 +198,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
TranslationBase TranslationBase.of(context).update,
.of(
context)
.update,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -250,61 +216,33 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context: context, context: context,
actionName: "verify", actionName: "verify",
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils GifLoaderDialogUtils.showMyDialog(context);
.showMyDialog( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
context); admissionNo: int.parse(patient.admissionNo),
UpdateNoteReqModel cancelledNote: false,
reqModel = lineItemNo: model.patientProgressNoteList[index].lineItemNo,
UpdateNoteReqModel( createdBy: model.patientProgressNoteList[index].createdBy,
admissionNo: int notes: model.patientProgressNoteList[index].notes,
.parse(patient
.admissionNo),
cancelledNote:
false,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: true, verifiedNote: true,
patientTypeID: patientTypeID: patient.patientType,
patient
.patientType,
patientOutSA: false, patientOutSA: false,
); );
await model await model.updatePatientProgressNote(reqModel);
.updatePatientProgressNote( await getProgressNoteList(context, model, isLocalBusy: true);
reqModel); GifLoaderDialogUtils.hideDialog(context);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.green[600], color: Colors.green[600],
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons FontAwesomeIcons.check,
.check,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -312,10 +250,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
TranslationBase TranslationBase.of(context).noteVerify,
.of(
context)
.noteVerify,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -331,67 +266,37 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onTap: () async { onTap: () async {
showMyDialog( showMyDialog(
context: context, context: context,
actionName: actionName: TranslationBase.of(context).cancel,
TranslationBase
.of(
context)
.cancel,
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils GifLoaderDialogUtils.showMyDialog(
.showMyDialog(
context, context,
); );
UpdateNoteReqModel UpdateNoteReqModel reqModel = UpdateNoteReqModel(
reqModel = admissionNo: int.parse(patient.admissionNo),
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
cancelledNote: true, cancelledNote: true,
lineItemNo: model lineItemNo: model.patientProgressNoteList[index].lineItemNo,
.patientProgressNoteList[ createdBy: model.patientProgressNoteList[index].createdBy,
index] notes: model.patientProgressNoteList[index].notes,
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: false, verifiedNote: false,
patientTypeID: patientTypeID: patient.patientType,
patient
.patientType,
patientOutSA: false, patientOutSA: false,
); );
await model await model.updatePatientProgressNote(reqModel);
.updatePatientProgressNote( await getProgressNoteList(context, model, isLocalBusy: true);
reqModel); GifLoaderDialogUtils.hideDialog(context);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[600], color: Colors.red[600],
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons FontAwesomeIcons.trash,
.trash,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -417,41 +322,25 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
height: 10, height: 10,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context).size.width * 0.60,
.size
.width *
0.60,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
AppText( AppText(
TranslationBase TranslationBase.of(context).createdBy,
.of(
context)
.createdBy,
fontSize: 10, fontSize: 10,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model model.patientProgressNoteList[index].doctorName ?? '',
.patientProgressNoteList[ fontWeight: FontWeight.w600,
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12, fontSize: 12,
), ),
), ),
@ -463,66 +352,36 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Column( Column(
children: [ children: [
AppText( AppText(
model model.patientProgressNoteList[index].createdOn != null
.patientProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils AppDateUtils.getDateTimeFromServerFormat(
.getDateTimeFromServerFormat( model.patientProgressNoteList[index].createdOn),
model isArabic: projectViewModel.isArabic)
.patientProgressNoteList[ : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(),
index] isArabic: projectViewModel.isArabic),
.createdOn),
isArabic:
projectViewModel
.isArabic)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model model.patientProgressNoteList[index].createdOn != null
.patientProgressNoteList[ ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(
index] model.patientProgressNoteList[index].createdOn))
.createdOn != : AppDateUtils.getHour(DateTime.now()),
null
? AppDateUtils.getHour(AppDateUtils
.getDateTimeFromServerFormat(
model
.patientProgressNoteList[
index]
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
], ],
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.end,
) )
], ],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.start, children: [
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded( Expanded(
child: AppText( child: AppText(
model model.patientProgressNoteList[index].notes,
.patientProgressNoteList[
index]
.notes,
fontSize: 10, fontSize: 10,
), ),
), ),
@ -551,10 +410,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context: context, context: context,
builder: (ctx) => Center( builder: (ctx) => Center(
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 0.8,
.of(context)
.size
.width * 0.8,
height: 200, height: 200,
child: AppScaffold( child: AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -573,9 +429,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AppText( AppText(
TranslationBase TranslationBase.of(context).noteConfirm,
.of(context)
.noteConfirm,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
@ -594,7 +448,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
color: Colors.white, color: Colors.white,
child: AppText( child: AppText(
projectViewModel.isArabic?"هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟":'Are you sure you want $actionName this order?', projectViewModel.isArabic
? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟"
: 'Are you sure you want $actionName this order?',
fontSize: 15, fontSize: 15,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -611,9 +467,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [ children: [
FlatButton( FlatButton(
child: AppText( child: AppText(
TranslationBase TranslationBase.of(context).cancel,
.of(context)
.cancel,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
@ -623,9 +477,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
}), }),
FlatButton( FlatButton(
child: AppText( child: AppText(
TranslationBase TranslationBase.of(context).noteConfirm,
.of(context)
.noteConfirm,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red.shade700, color: Colors.red.shade700,
fontSize: 16, fontSize: 16,
@ -643,7 +495,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
), ),
), ),
) ));
);
} }
} }

Loading…
Cancel
Save