Merge branch 'development' into soap-objective-feature-re-design

merge-requests/454/head
mosazaid 5 years ago
commit f0f4613960

@ -62,7 +62,7 @@ class ProcedureViewModel extends BaseViewModel {
await _procedureService.getProcedure(mrn: mrn); await _procedureService.getProcedure(mrn: mrn);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -2301,5 +2301,4 @@
] ]
} }
] ]
} }
}

@ -1,4 +1,4 @@
class GetPatientProgressNoteResModel { class GetPatientProgressNoteResModel {
int appointmentNo; int appointmentNo;
int createdBy; int createdBy;
String createdByName; String createdByName;

@ -5,6 +5,7 @@ class MySelectedAllergy {
MasterKeyModel selectedAllergy; MasterKeyModel selectedAllergy;
String remark; String remark;
bool isChecked; bool isChecked;
bool isExpanded;
int createdBy; int createdBy;
MySelectedAllergy( MySelectedAllergy(
@ -12,6 +13,7 @@ class MySelectedAllergy {
this.selectedAllergy, this.selectedAllergy,
this.remark, this.remark,
this.isChecked, this.isChecked,
this.isExpanded = true,
this.createdBy}); this.createdBy});
MySelectedAllergy.fromJson(Map<String, dynamic> json) { MySelectedAllergy.fromJson(Map<String, dynamic> json) {
@ -22,7 +24,8 @@ class MySelectedAllergy {
? new MasterKeyModel.fromJson(json['selectedAllergy']) ? new MasterKeyModel.fromJson(json['selectedAllergy'])
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isChecked']; isChecked = json['isChecked'];
isExpanded = json['isExpanded'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
} }
@ -35,7 +38,8 @@ class MySelectedAllergy {
data['selectedAllergy'] = this.selectedAllergy.toJson(); data['selectedAllergy'] = this.selectedAllergy.toJson();
} }
data['remark'] = this.remark; data['remark'] = this.remark;
data['isChecked'] = this.remark; data['isChecked'] = this.isChecked;
data['isExpanded'] = this.isExpanded;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
return data; return data;
} }

@ -468,10 +468,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
'ICD', 'ICD: ',
fontWeight: fontSize: 13.0,
FontWeight
.w700,
), ),
AppText( AppText(
model model
@ -488,14 +486,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
index] index]
.iCD10 .iCD10
.trim(), .trim(),
fontSize: 13.5,
fontWeight:
FontWeight
.w700,
), ),
SizedBox( SizedBox(
width: 35.0), width: 15.0),
],
),
Row(
children: [
AppText( AppText(
'Condition: ', 'Condition: ',
fontWeight: fontSize: 12.5,
FontWeight
.w700,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
@ -514,6 +518,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
index] index]
.condition .condition
.trim(), .trim(),
fontSize: 13.0,
fontWeight:
FontWeight
.w700,
), ),
), ),
], ],
@ -539,6 +547,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
fontWeight: fontWeight:
FontWeight FontWeight
.w700, .w700,
fontSize: 15.0,
), ),
) )
], ],
@ -547,24 +556,29 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Type: ', 'Type: ',
fontWeight: fontSize: 15.5,
FontWeight
.w700,
), ),
Expanded( Expanded(
child: AppText(model child: AppText(
.medicalFileList[ model
0] .medicalFileList[
.entityList[0] 0]
.timelines[ .entityList[
encounterNumber] 0]
.timeLineEvents[ .timelines[
0] encounterNumber]
.consulations[ .timeLineEvents[
0] 0]
.lstAssessments[ .consulations[
index] 0]
.type), .lstAssessments[
index]
.type,
fontSize: 16.0,
fontWeight:
FontWeight
.w700,
),
), ),
], ],
), ),
@ -700,9 +714,6 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Procedure ID: ', 'Procedure ID: ',
fontWeight:
FontWeight
.w700,
), ),
AppText( AppText(
model model
@ -720,6 +731,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
index] index]
.procedureId .procedureId
.trim(), .trim(),
fontSize:
13.5,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
@ -729,9 +745,6 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Order Date: ', 'Order Date: ',
fontWeight:
FontWeight
.w700,
), ),
AppText( AppText(
Helpers.getDateFormatted( Helpers.getDateFormatted(
@ -755,6 +768,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
)), )),
fontSize: fontSize:
13.5, 13.5,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
@ -792,23 +808,26 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'CPT Code : ', 'CPT Code : ',
),
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.patientID
.toString(),
fontWeight: fontWeight:
FontWeight FontWeight
.w700, .w700,
), ),
AppText(model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[0]
.lstProcedure[
index]
.patientID
.toString()),
], ],
), ),
SizedBox( SizedBox(
@ -924,22 +943,25 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Exam Type: ', 'Exam Type: ',
),
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.examDesc,
fontWeight: fontWeight:
FontWeight FontWeight
.w700, .w700,
), ),
AppText(model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[0]
.lstPhysicalExam[
index]
.examDesc),
], ],
), ),
Row( Row(
@ -968,22 +990,25 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Abnormal: ', 'Abnormal: ',
),
AppText(
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.abnormal,
fontWeight: fontWeight:
FontWeight FontWeight
.w700, .w700,
), ),
AppText(model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[0]
.lstPhysicalExam[
index]
.abnormal),
], ],
), ),
SizedBox( SizedBox(

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_head
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -80,27 +81,27 @@ class RadiologyDetailsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 100, height: 100,
), ),
], ],
), ),
), ),
], ],
), ),
), ),
bottomSheet: model.radImageURL.isNotEmpty ?Container( bottomSheet: model.radImageURL.isNotEmpty
width: double.maxFinite, ? Container(
height: 100, width: double.maxFinite,
child: Container( child: Container(
margin: EdgeInsets.only(left: 35,right: 35,top: 12,bottom: 12), margin:
child: Button( EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
color: Colors.red, child: AppButton(
onTap: () { onPressed: () {
launch(model.radImageURL); launch(model.radImageURL);
}, },
title: TranslationBase.of(context).openRad, title: TranslationBase.of(context).openRad,
), ),
), ),
):null, )
: null,
), ),
); );
} }

@ -162,12 +162,15 @@ class ProcedureCard extends StatelessWidget {
), ),
if (entityList.categoryID == 2 || if (entityList.categoryID == 2 ||
entityList.categoryID == 4) entityList.categoryID == 4)
Icon(Icons.edit) InkWell(
child: Icon(Icons.edit),
onTap: onTap,
)
], ],
) )
], ],
), ),
onTap: onTap, //onTap: onTap,
), ),
), ),
), ),

@ -115,31 +115,28 @@ class ProcedureScreen extends StatelessWidget {
model.procedureList[0].entityList[index].categoryID, model.procedureList[0].entityList[index].categoryID,
entityList: model.procedureList[0].entityList[index], entityList: model.procedureList[0].entityList[index],
onTap: () { onTap: () {
// if (model.procedureList[0].entityList[index] if (model.procedureList[0].entityList[index].categoryID ==
// .categoryID == 2 ||
// 2 || model.procedureList[0].entityList[index].categoryID == 4)
// model.procedureList[0].entityList[index] updateProcedureForm(context,
// .categoryID == model: model,
// 4) { patient: patient,
updateProcedureForm(context, remarks: model
model: model, .procedureList[0].entityList[index].remarks,
patient: patient, orderType: model.procedureList[0]
remarks: model .entityList[index].orderType
.procedureList[0].entityList[index].remarks, .toString(),
orderType: model orderNo: model
.procedureList[0].entityList[index].orderType .procedureList[0].entityList[index].orderNo,
.toString(), procedureName: model.procedureList[0]
orderNo: model .entityList[index].procedureName,
.procedureList[0].entityList[index].orderNo, categoreId: model.procedureList[0]
procedureName: model.procedureList[0] .entityList[index].categoryID
.entityList[index].procedureName, .toString(),
categoreId: model procedureId: model.procedureList[0]
.procedureList[0].entityList[index].categoryID .entityList[index].procedureId,
.toString(), limetNo: model.procedureList[0]
procedureId: model.procedureList[0] .entityList[index].lineItemNo);
.entityList[index].procedureId,
limetNo: model.procedureList[0].entityList[index]
.lineItemNo);
// } else // } else
// helpers.showErrorToast( // helpers.showErrorToast(
// 'You Cant Update This Procedure'); // 'You Cant Update This Procedure');

@ -22,18 +22,21 @@ class StepsWidget extends StatelessWidget {
children: [ children: [
Container( Container(
height: height == 0 ? 150 : height, height: height == 0 ? 150 : height,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Divider( child: Container(
color: Colors.grey, width: MediaQuery.of(context).size.width * 0.87,
height: 0.75, child: Divider(
thickness: 0.75, color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
), ),
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
left: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
@ -47,24 +50,24 @@ class StepsWidget extends StatelessWidget {
border: index == 0 border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0 : index > 0
? null ? null
: Border.all( : Border.all(
color: Colors.black, width: 0.75), color: Colors.black, width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 0 color: index == 0
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 0 : index > 0
? Color(0xFF359846) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
), color: Colors.white,
SizedBox( )),
height:5
), ),
SizedBox(height: 5),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@ -73,8 +76,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 0,), StatusLabel(
selectedStepId: index,
stepId: 0,
),
], ],
), ),
], ],
@ -82,11 +87,11 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
left: MediaQuery left: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.28, .width * 0.25,
child: InkWell( child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null, onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -99,23 +104,25 @@ class StepsWidget extends StatelessWidget {
border: index == 1 border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2 : index > 2
? null ? null
: Border.all( : Border.all(
color: Color(0xFFCCCCCC), width: 0.75), color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 1 color: index == 1
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 1 : index > 1
? Color(0xFF359846) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -125,9 +132,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(
StatusLabel(selectedStepId: index, stepId: 1,), selectedStepId: index,
stepId: 1,
),
], ],
), ),
], ],
@ -135,15 +143,14 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
left: MediaQuery left: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.52, .width * 0.50,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (index >= 3) if (index >= 3) changeCurrentTab(2);
changeCurrentTab(2);
}, },
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -155,23 +162,25 @@ class StepsWidget extends StatelessWidget {
border: index == 2 border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2 : index > 2
? null ? null
: Border.all( : Border.all(
color: Color(0xFFCCCCCC), width: 0.75), color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 2 color: index == 2
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 2 : index > 2
? Color(0xFFCC9B14) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -181,7 +190,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 2,), StatusLabel(
selectedStepId: index,
stepId: 2,
),
], ],
), ),
], ],
@ -189,7 +201,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
@ -203,38 +215,41 @@ class StepsWidget extends StatelessWidget {
border: index == 3 border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3 : index > 3
? null ? null
: Border.all( : Border.all(
color: Color(0xFFCCCCCC), width: 0.75), color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 3 color: index == 3
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 3 : index > 3
? Color(0xFF359846) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
"Plan",
fontWeight: FontWeight.bold,
// textAlign: TextAlign.center,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
), ),
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
"Plan",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 12,
),
StatusLabel(selectedStepId: index, stepId: 3,),
],
),
),
], ],
), ),
), ),
@ -245,10 +260,7 @@ class StepsWidget extends StatelessWidget {
children: [ children: [
Container( Container(
height: height == 0 ? 150 : height, height: height == 0 ? 150 : height,
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Divider( child: Divider(
@ -259,7 +271,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
@ -273,35 +285,43 @@ class StepsWidget extends StatelessWidget {
border: index == 0 border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0 : index > 0
? null ? null
: Border.all( : Border.all(
color: Colors.black, width: 0.75), color: Colors.black, width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 0 color: index == 0
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 0 : index > 0
? Color(0xFF359846) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
), color: Colors.white,
SizedBox( )),
height:5
), ),
AppText( SizedBox(height: 5),
"شخصي", Column(
fontWeight: FontWeight.bold, children: [
fontSize: 16, AppText(
"شخصي",
fontWeight: FontWeight.bold,
fontSize: 16,
),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
],
), ),
], ],
), ),
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: MediaQuery right: MediaQuery
.of(context) .of(context)
.size .size
@ -318,35 +338,43 @@ class StepsWidget extends StatelessWidget {
border: index == 1 border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2 : index > 2
? null ? null
: Border.all( : Border.all(
color: Color(0xFFCCCCCC), width: 0.75), color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 1 color: index == 1
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 1 : index > 1
? Color(0xFF359846) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(height: 5),
height:5 Column(
), children: [
AppText( AppText(
"هدف", "هدف",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:14, fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
],
), ),
], ],
), ),
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: MediaQuery right: MediaQuery
.of(context) .of(context)
.size .size
@ -363,44 +391,53 @@ class StepsWidget extends StatelessWidget {
border: index == 2 border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2 : index > 2
? null ? null
: Border.all( : Border.all(
color: Color(0xFFCCCCCC), width: 0.75), color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 2 color: index == 2
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 2 : index > 2
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Padding( Padding(
padding: const EdgeInsets.only(right: 2), padding: const EdgeInsets.only(right: 2),
child: AppText( child: Column(
"تقدير", children: [
fontWeight: FontWeight.bold, AppText(
fontSize:14, "تقدير",
), fontWeight: FontWeight.bold,
fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
), ),
], ],
), ),
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
left: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Container( Container(
width: 38, width: 38,
@ -409,44 +446,56 @@ class StepsWidget extends StatelessWidget {
border: index == 3 border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3 : index > 3
? null ? null
: Border.all( : Border.all(
color: Color(0xFFCCCCCC), width: 0.75), color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle, shape: BoxShape.circle,
color: index == 3 color: index == 3
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 3 : index > 3
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
),
Container(
margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: Column(
children: [
AppText(
"خطة",
fontWeight: FontWeight.bold,
fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
), ),
Container(
margin: EdgeInsets.only(right:index == 3? 15:0),
child: AppText(
"خطة",
fontWeight: FontWeight.bold,
fontSize:14,
),
),
], ],
), ),
), ),
), ),
], ],
); );
} }
} }
class StatusLabel extends StatelessWidget { class StatusLabel extends StatelessWidget {
const StatusLabel({ const StatusLabel({
Key key, this.stepId, this.selectedStepId, Key key,
this.stepId,
this.selectedStepId,
}) : super(key: key); }) : super(key: key);
final int stepId; final int stepId;
@ -458,24 +507,30 @@ class StatusLabel extends StatelessWidget {
width: 65, width: 65,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration( decoration: BoxDecoration(
color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < color: stepId == selectedStepId
selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), ? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5.0), Radius.circular(5.0),
), ),
border: Border.all( border: Border.all(color: HexColor('#707070'), width: 0.30),
color: HexColor('#707070'),
width: 0.30),
), ),
child: AppText( child: AppText(
stepId == selectedStepId ? "inProgress" : stepId < selectedStepId stepId == selectedStepId
? "Completed" ? "inProgress"
: " Locked ", : stepId < selectedStepId
? "Completed"
: " Locked ",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 10, fontSize: 10,
color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < color: stepId == selectedStepId
selectedStepId ? Color(0xFF359846) : Color(0xFF969696), ? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
), ),
); );
} }

@ -46,40 +46,9 @@ class UpdateChiefComplaints extends StatelessWidget {
child: CustomValidationError( child: CustomValidationError(
error: complaintsControllerError, error: complaintsControllerError,
)), )),
SizedBox(
// Container( height: 20,
// margin: ),
// EdgeInsets.only(left: 10, right: 10, top: 15),
// child: TextFields(
// hasLabelText: complaintsController.text != ''
// ? true
// : false,
// hintText: TranslationBase
// .of(context)
// .addChiefComplaints,
// fontSize: 13.5,
// // hintColor: Colors.black,
// showLabelText: true,
// fontWeight: FontWeight.w600,
// maxLines: 25,
// minLines: 13,
// controller: complaintsController,
// validator: (value) {
// if (value == null || value == "")
// return TranslationBase.of(context)
// .emptyMessage;
// else if (value.length < 25)
// return TranslationBase
// .of(context)
// .chiefComplaintLength;
// //"";
// else
// return null;
// }),
// ),
SizedBox(
height: 20,
),
NewTextFields( NewTextFields(
hintText: TranslationBase hintText: TranslationBase

@ -1,4 +1,5 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -8,21 +9,19 @@ import 'package:doctor_app_flutter/screens/base/base_view.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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.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/master_key_checkbox_search_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.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 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../custom_validation_error.dart';
class UpdateAllergiesWidget extends StatefulWidget { class UpdateAllergiesWidget extends StatefulWidget {
final List<MySelectedAllergy> myAllergiesList; List<MySelectedAllergy> myAllergiesList;
UpdateAllergiesWidget({Key key, this.myAllergiesList}); UpdateAllergiesWidget({Key key, this.myAllergiesList});
@ -34,31 +33,68 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
changeAllState() {
setState(() {
});
}
return Column( return Column(
children: [ children: [
Container( InkWell(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), onTap: () {
child: TextFields( openAllergiesList(context, changeAllState);
hintText: TranslationBase.of(context).addAllergies, },
borderColor: HexColor('#707070'), child: Container(
borderWidth: 0.30, padding: EdgeInsets.symmetric(
fontSize: 13.5, vertical: 8, horizontal: 8.0),
borderRadius: 12, margin:
onTapTextFields: () { EdgeInsets.symmetric(vertical: 8),
openAllergiesList(context); decoration: BoxDecoration(
}, border: Border.all(
readOnly: true, color: Colors.grey.shade400,
suffixIcon: EvaIcons.plusCircleOutline, width: 0.5),
suffixIconColor: Color(0xFF2B353E), borderRadius: BorderRadius.all(
fontWeight: FontWeight.w600, Radius.circular(8),
// controller: messageController, ),
validator: (value) { color: Colors.white,
if (value == null) ),
return TranslationBase.of(context).emptyMessage; child: Row(
else mainAxisAlignment:
return null; MainAxisAlignment.spaceBetween,
}), crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).addAllergies}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
AppText(
"${TranslationBase.of(context).searchHere}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -186,49 +222,36 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
print(allergy); print(allergy);
} }
openAllergiesList(BuildContext context) { openAllergiesList(BuildContext context, Function changeParentState) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
isDismissible: false,
context: context, context: context,
builder: (context) { builder: (context) {
return AddAllergies( return AddAllergies(
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { myAllergiesList: widget.myAllergiesList,
if (mySelectedAllergy.selectedAllergySeverity == null || addAllergiesFun: (List<MySelectedAllergy> mySelectedAllergy) {
mySelectedAllergy.selectedAllergy == null) { bool isAllDataFilled = true;
helpers.showErrorToast(TranslationBase mySelectedAllergy.forEach((element) {
.of(context) if (element.selectedAllergySeverity == null) {
.requiredMsg); isAllDataFilled = false;
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
widget.myAllergiesList
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) {
widget.myAllergiesList.add(mySelectedAllergy);
Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy =
mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
} }
}); });
} if (isAllDataFilled) {
},); mySelectedAllergy.forEach((element) {
if (!widget.myAllergiesList.contains(element)) {
widget.myAllergiesList.add(element);
}
});
changeParentState();
Navigator.of(context).pop();
} else {
helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
}
});
}); });
} }
@ -236,8 +259,9 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
class AddAllergies extends StatefulWidget { class AddAllergies extends StatefulWidget {
final Function addAllergiesFun; final Function addAllergiesFun;
final List<MySelectedAllergy> myAllergiesList;
const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key);
@override @override
_AddAllergiesState createState() => _AddAllergiesState(); _AddAllergiesState createState() => _AddAllergiesState();
@ -251,7 +275,13 @@ class _AddAllergiesState extends State<AddAllergies> {
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController severityController = TextEditingController(); TextEditingController severityController = TextEditingController();
TextEditingController allergyController = TextEditingController(); TextEditingController allergyController = TextEditingController();
List<MySelectedAllergy> myAllergiesListLocal;
@override
initState(){
super.initState();
myAllergiesListLocal = [...widget.myAllergiesList];
}
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@ -291,7 +321,7 @@ class _AddAllergiesState extends State<AddAllergies> {
.of(context) .of(context)
.size; .size;
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.7, heightFactor: 1,
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.allergiesList.length == 0) { if (model.allergiesList.length == 0) {
@ -305,220 +335,170 @@ class _AddAllergiesState extends State<AddAllergies> {
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: Center(
child: Center( child: Container(
child: FractionallySizedBox( child: Column(
widthFactor: 0.9, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase
.of(context)
.addAllergies,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allergiesList != null
? () {
setState(() {
_selectedAllergy = null;
allergyController.text = null;
});
}
: null,
child: _selectedAllergy==null? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration(
TranslationBase
.of(context)
.selectAllergy,
_selectedAllergy != null
? _selectedAllergy.nameEn
: null, true, icon: EvaIcons.search),
itemSubmitted: (item) =>
setState(() {
_selectedAllergy = item;
allergyController.text =
projectViewModel.isArabic
? _selectedAllergy
.nameAr
: _selectedAllergy
.nameEn;
}),
key: key,
suggestions: model.allergiesList,
itemBuilder: (context, suggestion) =>
new Padding(
child: Texts(
projectViewModel.isArabic ? suggestion
.nameAr : suggestion.nameEn),
padding: EdgeInsets.all(2.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.nameAr.toLowerCase().startsWith(
input.toLowerCase()) ||
suggestion.nameEn.toLowerCase()
.startsWith(input.toLowerCase()),
) :
TextFields(
onTapTextFields: model.allergiesList != null
? () {
setState(() {
_selectedAllergy = null;
allergyController.text = null;
});
}
: null,
hasLabelText: allergyController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.selectAllergy,
fontSize: 13.5,
readOnly: true,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: allergyController,
suffixIcon: EvaIcons.search,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
})
),
),
if(isFormSubmitted && _selectedAllergy == null)
CustomValidationError(),
SizedBox(
height: 10,
),
TextFields(
onTapTextFields: model
.allergySeverityList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.allergySeverityList,
okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedAllergySeverity =
selectedValue;
severityController.text =
projectViewModel.isArabic
? _selectedAllergySeverity
.nameAr
: _selectedAllergySeverity
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hasLabelText: severityController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}), SizedBox(
height: 5,
),
if(isFormSubmitted &&
_selectedAllergySeverity == null)
CustomValidationError(),
SizedBox( Container(
height: 10, padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
), ),
Container( height: 115,
margin: EdgeInsets.only( child: Container(
left: 0, right: 0, top: 15), padding: EdgeInsets.only(
child: TextFields( left: 10, right: 10),
hasLabelText: remarkController.text != ''?true:false, margin: EdgeInsets.only(top: 40),
showLabelText: true, child: Column(
hintText: TranslationBase.of(context).remarks, children: [
fontSize: 13.5, Row(
// hintColor: Colors.black, mainAxisAlignment:
fontWeight: FontWeight.w600, MainAxisAlignment.spaceBetween,
maxLines: 25, children: [
minLines: 10, RichText(
controller: remarkController, text: TextSpan(
validator: (value) { style: TextStyle(
if (value == null) fontSize:20,
return TranslationBase color: Colors.black),
.of(context) children: <TextSpan>[
.emptyMessage; new TextSpan(
else text: TranslationBase.of(context).
return null; addAllergies,
}), style: TextStyle(
), SizedBox( color: Color(0xFF2B353E),
height: 10, fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 20)),
],
),
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(FontAwesomeIcons.times,
size: 30,
color: Color(0xFF2B353E)))
],
),
],
),
), ),
AppButton( ),
title: TranslationBase.of(context).add.toUpperCase(), SizedBox(
onPressed: () { height: 10,
setState(() { ),
isFormSubmitted = true; SizedBox(
}); height: 16,
if(_selectedAllergy !=null && _selectedAllergySeverity !=null) { ),
MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( Expanded(
remark: remarkController.text, child: Center(
selectedAllergy: _selectedAllergy, child: FractionallySizedBox(
isChecked: true, widthFactor: 0.9,
selectedAllergySeverity: _selectedAllergySeverity,); child: Center(
widget.addAllergiesFun(mySelectedAllergy); child: NetworkBaseView(
} baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
}, model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy: (MySelectedAllergy mySelectedAllergy){
AddAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: ()=>
widget.addAllergiesFun(myAllergiesListLocal)
,
isServiceSelected: (master) =>isServiceSelected(master),
getServiceSelectedAllergy: (master)=>getSelectedAllergy(master),
),
),
),
),
), ),
] ),
]
),
), ),
), ),
)), )
),
), ),
); );
} }
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return true;
}
return false;
}
removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal.removeWhere((element) =>
element.selectedAllergy.id == masterKey.id);
}
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return allergy.first;
}
return null;
}
AddAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (
mySelectedAllergy.selectedAllergy == null) {
helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy);
// Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy =
mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
// Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
}
});
}}
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
@ -49,28 +50,60 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Column( return Column(
children: [ children: [
Container( InkWell(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), onTap: () {
child: TextFields( openHistoryList(context);
hintText: TranslationBase.of(context).addHistory, },
borderColor: HexColor('#707070'), child: Container(
borderWidth: 0.30, padding: EdgeInsets.symmetric(
fontSize: 13.5, vertical: 8, horizontal: 8.0),
borderRadius: 12, margin:
onTapTextFields: () { EdgeInsets.symmetric(vertical: 8),
openHistoryList(context); decoration: BoxDecoration(
}, border: Border.all(
suffixIcon: EvaIcons.plusCircleOutline, color: Colors.grey.shade400,
suffixIconColor: Color(0xFF2B353E), width: 0.5),
readOnly: true, borderRadius: BorderRadius.all(
fontWeight: FontWeight.w600, Radius.circular(8),
// controller: messageController, ),
validator: (value) { color: Colors.white,
if (value == null) ),
return TranslationBase.of(context).emptyMessage; child: Row(
else mainAxisAlignment:
return null; MainAxisAlignment.spaceBetween,
}), crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).addHistory}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
AppText(
"${TranslationBase.of(context).searchHere}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -143,10 +176,6 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
} }
removeHistory(MasterKeyModel historyKey) { removeHistory(MasterKeyModel historyKey) {
// Iterable<MasterKeyModel> history = widget.myHistoryList.where((element) =>
// masterKey.id == element.id && masterKey.typeId == element.typeId);
//
List<MySelectedHistory> history = List<MySelectedHistory> history =
// ignore: missing_return // ignore: missing_return
widget.myHistoryList.where((element) => widget.myHistoryList.where((element) =>

@ -205,10 +205,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
doctorID: ''); doctorID: '');
await model.getPatientChiefComplaint(getChiefComplaintReqModel); await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) { if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true;
complaintsController.text = helpers.parseHtmlString( complaintsController.text = helpers.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint); model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi; illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text = model.patientChiefComplaintList[0].currentMedication + '\n \n'; medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication;
} }
await getHistory(model); await getHistory(model);
@ -304,7 +305,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
isExpanded: isAllergiesExpand, isExpanded: isAllergiesExpand,
), ),
SizedBox( SizedBox(
height:MediaQuery.of(context).size.height * 0.2, height:MediaQuery.of(context).size.height * 0.16,
), ),
], ],
), ),
@ -324,13 +325,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
height: MediaQuery height: MediaQuery
.of(context) .of(context)
.size .size
.height * 0.15, .height * 0.1,
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 15, height: 10,
), ),
Container(child: FractionallySizedBox( Container(child: FractionallySizedBox(
widthFactor: .80, widthFactor: .80,
@ -351,7 +352,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
), ),
),), ),),
SizedBox( SizedBox(
height: 15, height: 5,
), ),
], ],
),), ),),

@ -54,495 +54,510 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.mySelectedAssessmentList.clear(); widget.mySelectedAssessmentList.clear();
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: '', doctorID: '',
appointmentNo: widget.patientInfo.appointmentNo); appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
if (model.patientAssessmentList.isNotEmpty) { if (model.patientAssessmentList.isNotEmpty) {
if (model.listOfDiagnosisCondition.length == 0) { if (model.listOfDiagnosisCondition.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisCondition); await model.getMasterLookup(MasterKeysService.DiagnosisCondition);
} }
if (model.listOfDiagnosisType.length == 0) { if (model.listOfDiagnosisType.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisType); await model.getMasterLookup(MasterKeysService.DiagnosisType);
}
if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10);
}
model.patientAssessmentList.forEach((element) {
MasterKeyModel diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType,
id: element.diagnosisTypeID,
);
MasterKeyModel selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10,
id: element.icdCode10ID,
);
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID,
);
if (diagnosisCondition != null &&
diagnosisType != null &&
diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment =
MySelectedAssessment(
appointmentId: element.appointmentNo,
remark: element.remarks,
selectedDiagnosisType: diagnosisType,
selectedDiagnosisCondition: diagnosisCondition,
selectedICD: selectedICD,
doctorID: element.doctorID,
doctorName: element.doctorName,
createdBy: element.createdBy,
createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID);
widget.mySelectedAssessmentList.add(temMySelectedAssessment);
}
});
} }
if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10);
}
model.patientAssessmentList.forEach((element) {
MasterKeyModel diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType,
id: element.diagnosisTypeID,
);
MasterKeyModel selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10,
id: element.icdCode10ID,
);
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID,
);
if (diagnosisCondition != null &&
diagnosisType != null &&
diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment =
MySelectedAssessment(
appointmentId: element.appointmentNo,
remark: element.remarks,
selectedDiagnosisType: diagnosisType,
selectedDiagnosisCondition: diagnosisCondition,
selectedICD: selectedICD,
doctorID: element.doctorID,
doctorName: element.doctorName,
createdBy: element.createdBy,
createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID);
widget.changeLoadingState(false); widget.mySelectedAssessmentList.add(temMySelectedAssessment);
}, }
builder: (_, model, w) => AppScaffold( });
isShowAppBar: false, }
// baseViewModel: model,
body: SingleChildScrollView( widget.changeLoadingState(false);
physics: ScrollPhysics(), },
child: Container( builder: (_, model, w) => AppScaffold(
color: Color(0xffF8F8F8), isShowAppBar: false,
child: Center( // baseViewModel: model,
child: FractionallySizedBox( body: SingleChildScrollView(
widthFactor: 0.9, physics: ScrollPhysics(),
child: Column( child: Container(
mainAxisAlignment: MainAxisAlignment.start, color: Color(0xffF8F8F8),
children: [ child: Center(
SizedBox( child: FractionallySizedBox(
height: 30, widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
), ),
Container( border: Border.all(color: Colors.grey[200], width: 0.5),
width: double.infinity, ),
margin: EdgeInsets.only(top: 10, left: 10, right: 10), child: HeaderBodyExpandableNotifier(
padding: EdgeInsets.all(8.0), headerWidget: Row(
decoration: BoxDecoration( mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Colors.white, children: [
borderRadius: BorderRadius.all( Padding(
Radius.circular(10.0), padding: EdgeInsets.all(12.0),
child: Row(
children: [
Texts(TranslationBase.of(context).assessment,
variant:
isAssessmentExpand ? "bodyText" : '',
bold: isAssessmentExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: Colors.black,
size: 10,
)
],
),
), ),
border: InkWell(
Border.all(color: Colors.grey[200], width: 0.5), onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
), ),
child: HeaderBodyExpandableNotifier( Column(
headerWidget: Row( children: [
mainAxisAlignment: MainAxisAlignment.spaceBetween, Container(
children: [ margin:
Padding( EdgeInsets.only(left: 5, right: 5, top: 15),
padding: EdgeInsets.all(12.0), child: TextFields(
child: Row( hintText: TranslationBase.of(context)
children: [ .addAssessment,
Texts( fontSize: 13.5,
TranslationBase.of(context) onTapTextFields: () {
.assessment, openAssessmentDialog(context,
variant: isAssessmentExpand isUpdate: false, model: model);
? "bodyText"
: '',
bold:
isAssessmentExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: Colors.black,
size: 10,
)
],
),
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand =
!isAssessmentExpand;
});
}, },
child: Icon(isAssessmentExpand readOnly: true,
? EvaIcons.arrowUp suffixIcon: EvaIcons.plusSquare,
: EvaIcons.arrowDown)) suffixIconColor: Colors.black,
], fontWeight: FontWeight.w600,
), validator: (value) {
bodyWidget: Column(children: [ if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Column( Column(
children: [ children: widget.mySelectedAssessmentList
Container( .map((assessment) {
return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5, right: 5, top: 15), left: 5, right: 5, top: 15),
child: TextFields( child: Row(
hintText: TranslationBase.of(context) mainAxisAlignment:
.addAssessment, MainAxisAlignment.spaceBetween,
fontSize: 13.5, crossAxisAlignment:
onTapTextFields: () { CrossAxisAlignment.start,
openAssessmentDialog(context, children: [
isUpdate: false, model: model); Column(
},
readOnly: true,
suffixIcon: EvaIcons.plusSquare,
suffixIconColor: Colors.black,
fontWeight: FontWeight.w600,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Column(
children: widget.mySelectedAssessmentList
.map((assessment) {
return Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Column( Row(
children: [
AppText(
"ICD : ".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
Container(
child: AppText(
assessment.selectedICD.code
.trim()
.toUpperCase() ??
"",
fontWeight: FontWeight.w700,
fontSize: 11,
),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Row( AppText(
children: [ TranslationBase.of(context)
AppText( .ICDName +
"ICD : ".toUpperCase(), " : ",
fontSize: 10, fontSize: 13,
color: Colors.grey, color: Colors.grey,
),
Container(
child: AppText(
assessment.selectedICD
.code
.trim()
.toUpperCase() ??
"",
fontWeight:
FontWeight.w700,
fontSize: 11,
),
),
],
), ),
Row( Container(
mainAxisAlignment: width: MediaQuery.of(context)
MainAxisAlignment.start, .size
crossAxisAlignment: .width *
CrossAxisAlignment.start, 0.29,
children: [ child: AppText(
AppText( assessment
TranslationBase.of( .selectedICD.description
context) .toString(),
.ICDName + fontWeight: FontWeight.w700,
" : ", fontSize: 10,
fontSize: 13, ),
color: Colors.grey,
),
Container(
width:
MediaQuery.of(context)
.size
.width *
0.29,
child: AppText(
assessment.selectedICD
.description
.toString(),
fontWeight:
FontWeight.w700,
fontSize: 10,
),
),
],
), ),
Row( ],
mainAxisAlignment: ),
MainAxisAlignment.start, Row(
children: [ mainAxisAlignment:
AppText( MainAxisAlignment.start,
TranslationBase.of( children: [
context) AppText(
.appointmentNo, TranslationBase.of(context)
fontSize: 10, .appointmentNo,
color: Colors.grey, fontSize: 10,
), color: Colors.grey,
AppText(
assessment.appointmentId
.toString(),
fontSize: 11,
fontWeight:
FontWeight.w700,
),
],
), ),
Row( AppText(
mainAxisAlignment: assessment.appointmentId
MainAxisAlignment.start, .toString(),
children: [ fontSize: 11,
AppText( fontWeight: FontWeight.w700,
TranslationBase.of(
context)
.condition +
" : ",
fontSize: 10,
color: Colors.grey,
),
AppText(
projectViewModel.isArabic
? assessment
.selectedDiagnosisCondition
.nameAr
: assessment
.selectedDiagnosisCondition
.nameEn,
fontSize: 11,
fontWeight:
FontWeight.w700,
),
],
), ),
Row( ],
mainAxisAlignment: ),
MainAxisAlignment.start, Row(
children: [ mainAxisAlignment:
AppText( MainAxisAlignment.start,
TranslationBase.of( children: [
context) AppText(
.dType + TranslationBase.of(context)
' : ', .condition +
fontSize: 10, " : ",
color: Colors.grey, fontSize: 10,
), color: Colors.grey,
AppText(
projectViewModel.isArabic
? assessment
.selectedDiagnosisType
.nameAr
: assessment
.selectedDiagnosisType
.nameEn,
fontSize: 11,
fontWeight:
FontWeight.w700,
),
],
), ),
if (assessment.doctorName != AppText(
null) projectViewModel.isArabic
Row( ? assessment
mainAxisAlignment: .selectedDiagnosisCondition
MainAxisAlignment.start, .nameAr
children: [ : assessment
AppText( .selectedDiagnosisCondition
TranslationBase.of( .nameEn,
context) fontSize: 11,
.doc, fontWeight: FontWeight.w700,
fontSize: 10, ),
color: Colors.grey, ],
), ),
AppText( Row(
assessment.doctorName ?? mainAxisAlignment:
'', MainAxisAlignment.start,
fontSize: 11, children: [
fontWeight: AppText(
FontWeight.w700, TranslationBase.of(context)
), .dType +
], ' : ',
fontSize: 10,
color: Colors.grey,
),
AppText(
projectViewModel.isArabic
? assessment
.selectedDiagnosisType
.nameAr
: assessment
.selectedDiagnosisType
.nameEn,
fontSize: 11,
fontWeight: FontWeight.w700,
),
],
),
if (assessment.doctorName != null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.doc,
fontSize: 10,
color: Colors.grey,
),
AppText(
assessment.doctorName ?? '',
fontSize: 11,
fontWeight: FontWeight.w700,
), ),
],
),
SizedBox(
height: 6,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
SizedBox( SizedBox(
height: 6, height: 6,
), ),
Row( AppText(
mainAxisAlignment: assessment.remark != null ||
MainAxisAlignment.start, assessment.remark ==
children: [ ''
SizedBox( ? TranslationBase.of(
height: 6, context)
), .remarks +
AppText( " : "
assessment.remark != : '',
null || fontSize: 10,
assessment color: Colors.grey,
.remark == ),
'' Container(
? TranslationBase.of( width: MediaQuery.of(context)
context) .size
.remarks + .width *
" : " 0.38,
: '', child: AppText(
fontSize: 10, assessment.remark ?? "",
color: Colors.grey, fontSize: 11,
), fontWeight: FontWeight.w700,
Container( ),
width:
MediaQuery.of(context)
.size
.width *
0.38,
child: AppText(
assessment.remark ?? "",
fontSize: 11,
fontWeight:
FontWeight.w700,
),
),
],
), ),
], ],
), ),
Column( ],
crossAxisAlignment: ),
CrossAxisAlignment.start, Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [ children: [
Row( AppText(
children: [ assessment.createdOn != null
AppText( ? DateTime.parse(
assessment.createdOn != assessment
.createdOn)
.day
.toString()
: DateTime.now()
.day
.toString(),
fontWeight: FontWeight.bold,
fontSize: 15,
),
AppText(" "),
AppText(
Helpers.getMonth(assessment
.createdOn !=
null null
? DateTime.parse( ? DateTime.parse(
assessment assessment
.createdOn) .createdOn)
.day .month
.toString()
: DateTime.now() : DateTime.now()
.day .month)
.toString(), .toUpperCase(),
fontWeight: fontSize: 13,
FontWeight.bold, color: Colors.grey,
fontSize: 15,
),
AppText(" "),
AppText(
Helpers.getMonth(assessment
.createdOn !=
null
? DateTime.parse(
assessment
.createdOn)
.month
: DateTime.now()
.month)
.toUpperCase(),
fontSize: 13,
color: Colors.grey,
),
],
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
0.05,
), ),
InkWell(
onTap: () {
openAssessmentDialog(
context,
isUpdate: true,
assessment: assessment,
model: model);
},
child: Icon(EvaIcons.edit2),
)
], ],
), ),
// Column( SizedBox(
// children: [ height: MediaQuery.of(context)
// // SizedBox( .size
// // height: 60, .height *
// // ), 0.05,
// InkWell( ),
// onTap: () { InkWell(
// openAssessmentDialog( onTap: () {
// context, openAssessmentDialog(context,
// isUpdate: true, isUpdate: true,
// assessment: assessment, assessment: assessment,
// model: model); model: model);
// }, },
// child: Icon(EvaIcons.edit2), child: Icon(EvaIcons.edit2),
// ) )
// ],
// ),
], ],
), ),
); // Column(
}).toList(), // children: [
) // // SizedBox(
], // // height: 60,
// // ),
// InkWell(
// onTap: () {
// openAssessmentDialog(
// context,
// isUpdate: true,
// assessment: assessment,
// model: model);
// },
// child: Icon(EvaIcons.edit2),
// )
// ],
// ),
],
),
);
}).toList(),
) )
]), ],
isExpand: isAssessmentExpand, )
), ]),
), isExpand: isAssessmentExpand,
DividerWithSpacesAround( ),
height: 30,
),
Row(
children: [
Container(
width: MediaQuery.of(context).size.width * 0.4,
child: AppButton(
title: 'Previous',
color: Colors.white38,
fontColor: Colors.black,
fontWeight: FontWeight.w700,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
Navigator.pop(context);
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.05,
),
Container(
width: MediaQuery.of(context).size.width * 0.4,
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w700,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) {
helpers.showErrorToast(
TranslationBase.of(context)
.assessmentErrorMsg);
} else {
widget.changePageViewIndex(3);
widget.changeLoadingState(true);
}
},
),
),
],
),
SizedBox(
height: 30,
),
],
), ),
), DividerWithSpacesAround(
height: 30,
),
// Row(
// children: [
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// child: AppButton(
// title: 'Previous',
// color: Colors.white38,
// fontColor: Colors.black,
// fontWeight: FontWeight.w700,
// loading: model.state == ViewState.BusyLocal,
// onPressed: () async {
// Navigator.pop(context);
// },
// ),
// ),
// SizedBox(
// width: MediaQuery.of(context).size.width * 0.05,
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// child: AppButton(
// title: TranslationBase.of(context).next,
// fontWeight: FontWeight.w700,
// loading: model.state == ViewState.BusyLocal,
// onPressed: () async {
// if (widget.mySelectedAssessmentList.isEmpty) {
// helpers.showErrorToast(
// TranslationBase.of(context)
// .assessmentErrorMsg);
// } else {
// widget.changePageViewIndex(3);
// widget.changeLoadingState(true);
// }
// },
// ),
// ),
// ],
// ),
SizedBox(
height: 130,
),
],
),
),
),
),
),
bottomSheet: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: MediaQuery.of(context).size.width * 0.4,
child: AppButton(
title: 'Previous',
color: Colors.white38,
fontColor: Colors.black,
fontWeight: FontWeight.w700,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.changePageViewIndex(1);
},
), ),
), ),
))); SizedBox(
width: MediaQuery.of(context).size.width * 0.05,
),
Container(
width: MediaQuery.of(context).size.width * 0.4,
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w700,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) {
helpers.showErrorToast(
TranslationBase.of(context).assessmentErrorMsg);
} else {
widget.changePageViewIndex(3);
widget.changeLoadingState(true);
}
},
),
),
],
),
),
),
);
} }
openAssessmentDialog(BuildContext context, openAssessmentDialog(BuildContext context,

@ -68,77 +68,77 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
// baseViewModel: model, // baseViewModel: model,
isLoading: _isLoading, isLoading: _isLoading,
isShowAppBar: false, isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).healthRecordInformation, body: SingleChildScrollView(
// TODO mousa removed the singleChildScrollView child: Column(
body: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( boxShadow: <BoxShadow>[],
boxShadow: <BoxShadow>[], color: Theme.of(context).scaffoldBackgroundColor),
color: Theme.of(context).scaffoldBackgroundColor), child: Column(
child: Column( mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
children: <Widget>[ // PatientPageHeaderWidget(patient),
// PatientPageHeaderWidget(patient), PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,),
PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,), Container(
Container( width: double.infinity,
width: double.infinity, height: 1,
height: 1, color: Color(0xffCCCCCC),
color: Color(0xffCCCCCC),
),
Container(
color: Theme.of(context).scaffoldBackgroundColor,
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
height: MediaQuery.of(context).size.height * 0.21,
), ),
), Container(
Container( color: Theme.of(context).scaffoldBackgroundColor,
color: Theme.of(context).scaffoldBackgroundColor, margin: EdgeInsets.only(
height: MediaQuery.of(context).size.height * 0.50, left: MediaQuery.of(context).size.width * 0.05,
child: PageView( right: MediaQuery.of(context).size.width * 0.05),
physics: NeverScrollableScrollPhysics(), child: StepsWidget(
controller: _controller, index: _currentIndex,
onPageChanged: (index) { changeCurrentTab: changePageViewIndex,
setState(() { height: MediaQuery.of(context).size.height * 0.20,
_currentIndex = index; ),
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
mySelectedExamination: mySelectedExamination,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList: mySelectedAssessment,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState)
],
), ),
) Container(
], color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.50,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
mySelectedExamination: mySelectedExamination,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList: mySelectedAssessment,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState)
],
),
)
],
),
), ),
), ],
], ),
), ),
), ),
); );

@ -98,7 +98,7 @@ class _AppDrawerState extends State<AppDrawer> {
// " or " + // " or " +
// TranslationBase.of(context).leaves, // TranslationBase.of(context).leaves,
DoctorApp.leaves, DoctorApp.reschedule__1,
// subTitle: , // subTitle: ,
), ),
onTap: () { onTap: () {
@ -121,15 +121,6 @@ class _AppDrawerState extends State<AppDrawer> {
margin: EdgeInsets.symmetric(horizontal: 20), margin: EdgeInsets.symmetric(horizontal: 20),
child: Column( child: Column(
children: [ children: [
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, Icons.settings),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
projectsProvider.isArabic projectsProvider.isArabic
@ -143,6 +134,16 @@ class _AppDrawerState extends State<AppDrawer> {
projectsProvider.changeLanguage('ar'); projectsProvider.changeLanguage('ar');
}, },
), ),
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, DoctorApp.logout_1),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
], ],
), ),
), ),

@ -37,8 +37,8 @@ class _BottomNavBarState extends State<BottomNavBar> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.home_icon, icon: DoctorApp.home_icon_active,
activeIcon: DoctorApp.home_icon_active, activeIcon: DoctorApp.home_active,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 0, currentIndex: 0,
@ -46,7 +46,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.schedule_icon, icon: DoctorApp.schedule_icon,
activeIcon: DoctorApp.scdedule_icon_active, activeIcon: DoctorApp.scdedule_icon_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 1, currentIndex: 1,
@ -54,7 +54,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.qr_code, icon: DoctorApp.qr_code,
activeIcon: DoctorApp.qr_code, activeIcon: DoctorApp.qr_reader_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 2, currentIndex: 2,
@ -62,7 +62,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.message_icon, icon: DoctorApp.message_icon,
activeIcon: DoctorApp.message_icon_active, activeIcon: DoctorApp.dr_reply_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 3, currentIndex: 3,

@ -0,0 +1,619 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart';
import 'expandable-widget-header-body.dart';
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final SOAPViewModel model;
final Function () addSelectedAllergy;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final List<MasterKeyModel> masterList;
final String buttonName;
final String hintSearchText;
MasterKeyCheckboxSearchAllergiesWidget(
{Key key,
this.model,
this.addSelectedAllergy,
this.removeAllergy,
this.masterList,
this.addAllergy,
this.isServiceSelected,
this.buttonName,
this.hintSearchText,
this.getServiceSelectedAllergy})
: super(key: key);
@override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
_MasterKeyCheckboxSearchAllergiesWidgetState();
}
class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List();
MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false;
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: Column(
children: [
Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.62,
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
TextFields(
hintText: widget.hintSearchText ??
TranslationBase.of(context).selectAllergy,
borderWidth: 0.0,
padding: EdgeInsets.all(20),
borderRadius: 0,
suffixIcon: EvaIcons.search,
onChanged: (value) {
filterSearchResults(value);
},
),
SizedBox(
height: 10,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
height: MediaQuery.of(context).size.height * 0.60,
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
bool isSelected =
widget.isServiceSelected(items[index]);
MySelectedAllergy mySelectedAllergy;
if (isSelected) {
mySelectedAllergy =
widget.getServiceSelectedAllergy(
items[index]);
}
TextEditingController remarkController =
TextEditingController(
text: isSelected
? mySelectedAllergy.remark
: null);
TextEditingController severityController =
TextEditingController(
text: isSelected
? mySelectedAllergy
.selectedAllergySeverity !=
null
? projectViewModel.isArabic
? mySelectedAllergy
.selectedAllergySeverity
.nameAr
: mySelectedAllergy
.selectedAllergySeverity
.nameEn
: null
: null);
return HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Checkbox(
value:
widget.isServiceSelected(
items[index]),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
// setState(() {
// if (widget
// .isServiceSelected(items[index])) {
// widget.removeHistory(items[index]);
// } else {
// widget.addHistory(items[index]);
// }
// });
}),
InkWell(
onTap: () {
setState(() {
if (widget
.isServiceSelected(
items[index])) {
widget.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Expanded(
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Container(
child: AppText(
projectViewModel.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index].nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
width: MediaQuery.of(context).size.width * 0.55,
),
),
),
),
],
),
InkWell(
onTap: () {
if (mySelectedAllergy != null) {
setState(() {
mySelectedAllergy
.isExpanded =
mySelectedAllergy
.isExpanded
? false
: true;
});
}
},
child: Icon((mySelectedAllergy !=
null
? mySelectedAllergy
.isExpanded
: false)
? EvaIcons
.arrowIosUpwardOutline
: EvaIcons
.arrowIosDownwardOutline))
],
),
bodyWidget: Column(
children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
hasLabelText:
mySelectedAllergy != null &&
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
};
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],),
isExpand: mySelectedAllergy != null
? mySelectedAllergy.isExpanded
: false,
);
Column(
children: [
InkWell(
onTap: () {
setState(() {
if (widget.isServiceSelected(
items[index])) {
widget
.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Column(
children: [
Row(
children: [
Checkbox(
value: widget
.isServiceSelected(
items[index]),
activeColor:
Colors.red[800],
onChanged: (bool newValue) {
// setState(() {
// if (widget
// .isServiceSelected(items[index])) {
// widget.removeHistory(items[index]);
// } else {
// widget.addHistory(items[index]);
// }
// });
}),
Expanded(
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: AppText(
projectViewModel.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index].nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
),
),
],
),
if(widget
.isServiceSelected(
items[index]))
Column(children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
hasLabelText:
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
};
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],)
],
),
),
// DividerWithSpacesAround(),
],
);
},
),
),
),
),
],
)
)),
),
),
SizedBox(
height: 10,
),
if (widget.model.state == ViewState.Idle)
AppButton(
title: "Add Selected Allergy",
padding: 10,
color: Color(0xFF359846),
onPressed: () {
setState(() {
isSubmitted = true;
});
widget.addSelectedAllergy();
},
),
],
),
);
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}
Loading…
Cancel
Save