Merge branch 'episode_fixes' into 'development'

Episode fixes

See merge request Cloud_Solution/doctor_app_flutter!773
merge-requests/774/merge
Mohammad Aljammal 5 years ago
commit 4553570547

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -703,4 +703,5 @@ const Map<String, Map<String, String>> localizedValues = {
"addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"}, "addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"},
"edit": {"en": "Edit", "ar": "تعديل"}, "edit": {"en": "Edit", "ar": "تعديل"},
"summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"}, "summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"},
"finish": {"en": "Finish", "ar": "انهاء"},
}; };

@ -6,15 +6,19 @@ class MySelectedAllergy {
String remark; String remark;
bool isChecked; bool isChecked;
bool isExpanded; bool isExpanded;
bool isLocal;
int createdBy; int createdBy;
bool hasValidationError;
MySelectedAllergy( MySelectedAllergy(
{this.selectedAllergySeverity, {this.selectedAllergySeverity,
this.selectedAllergy, this.selectedAllergy,
this.remark, this.remark,
this.isChecked, this.isChecked,
this.isExpanded = true, this.isExpanded = true,
this.createdBy}); this.isLocal = true,
this.createdBy,
this.hasValidationError = false});
MySelectedAllergy.fromJson(Map<String, dynamic> json) { MySelectedAllergy.fromJson(Map<String, dynamic> json) {
selectedAllergySeverity = json['selectedAllergySeverity'] != null selectedAllergySeverity = json['selectedAllergySeverity'] != null
@ -26,7 +30,9 @@ class MySelectedAllergy {
remark = json['remark']; remark = json['remark'];
isChecked = json['isChecked']; isChecked = json['isChecked'];
isExpanded = json['isExpanded']; isExpanded = json['isExpanded'];
isLocal = json['isLocal'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
hasValidationError = json['hasValidationError'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -41,6 +47,8 @@ class MySelectedAllergy {
data['isChecked'] = this.isChecked; data['isChecked'] = this.isChecked;
data['isExpanded'] = this.isExpanded; data['isExpanded'] = this.isExpanded;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
data['isLocal'] = this.isLocal;
data['hasValidationError'] = this.hasValidationError;
return data; return data;
} }
} }

@ -1,22 +1,29 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination { class MySelectedExamination {
MasterKeyModel selectedExamination; MasterKeyModel selectedExamination;
String remark; String remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined; bool notExamined;
bool isNew; bool isNew;
bool isLocal;
int createdBy; int createdBy;
String createdOn;
String editedOn;
MySelectedExamination( MySelectedExamination({
{this.selectedExamination, this.selectedExamination,
this.remark, this.remark,
this.isNormal = false, this.isNormal = false,
this.isAbnormal = false, this.isAbnormal = false,
this.notExamined = true, this.notExamined = true,
this.isNew = true, this.isNew = true,
this.createdBy}); this.isLocal = true,
this.createdBy,
this.createdOn,
this.editedOn,
});
MySelectedExamination.fromJson(Map<String, dynamic> json) { MySelectedExamination.fromJson(Map<String, dynamic> json) {
selectedExamination = json['selectedExamination'] != null selectedExamination = json['selectedExamination'] != null
@ -28,6 +35,9 @@ class MySelectedExamination {
notExamined = json['notExamined']; notExamined = json['notExamined'];
isNew = json['isNew']; isNew = json['isNew'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedOn = json['editedOn'];
isLocal = json['isLocal'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -42,6 +52,10 @@ class MySelectedExamination {
data['notExamined'] = this.notExamined; data['notExamined'] = this.notExamined;
data['isNew'] = this.isNew; data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['editedOn'] = this.editedOn;
data['isLocal'] = this.isLocal;
return data; return data;
} }
} }

@ -4,9 +4,10 @@ class MySelectedHistory {
MasterKeyModel selectedHistory; MasterKeyModel selectedHistory;
String remark; String remark;
bool isChecked; bool isChecked;
bool isLocal;
MySelectedHistory( MySelectedHistory(
{ this.selectedHistory, this.remark, this.isChecked}); { this.selectedHistory, this.remark, this.isChecked, this.isLocal = true});
MySelectedHistory.fromJson(Map<String, dynamic> json) { MySelectedHistory.fromJson(Map<String, dynamic> json) {
@ -15,6 +16,7 @@ class MySelectedHistory {
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isChecked']; remark = json['isChecked'];
isLocal = json['isLocal'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -25,6 +27,7 @@ class MySelectedHistory {
} }
data['remark'] = this.remark; data['remark'] = this.remark;
data['isChecked'] = this.remark; data['isChecked'] = this.remark;
data['isLocal'] = this.isLocal;
return data; return data;
} }
} }

@ -18,6 +18,7 @@ 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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
@ -32,6 +33,7 @@ class AddAssessmentDetails extends StatefulWidget {
addSelectedAssessment; addSelectedAssessment;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final bool isUpdate; final bool isUpdate;
AddAssessmentDetails( AddAssessmentDetails(
{Key key, {Key key,
this.mySelectedAssessment, this.mySelectedAssessment,
@ -129,14 +131,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
@ -253,6 +255,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition, list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: okFunction:
(MasterKeyModel selectedValue) { (MasterKeyModel selectedValue) {
setState(() { setState(() {
@ -305,6 +309,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType, list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,
okFunction: okFunction:
(MasterKeyModel selectedValue) { (MasterKeyModel selectedValue) {
setState(() { setState(() {
@ -367,7 +372,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: model.state == ViewState.Busy?Container(height: 0,):Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -434,6 +439,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
{SOAPViewModel model, {SOAPViewModel model,
MySelectedAssessment mySelectedAssessment, MySelectedAssessment mySelectedAssessment,
bool isUpdate = false}) async { bool isUpdate = false}) async {
GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) { if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
@ -464,8 +470,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
await model.postAssessment(postAssessmentRequestModel); await model.postAssessment(postAssessmentRequestModel);
} }
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -473,10 +480,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName; mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
if (!isUpdate) {
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
}
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }

@ -26,14 +26,12 @@ import 'add_assessment_details.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class UpdateAssessmentPage extends StatefulWidget { class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
List<MySelectedAssessment> mySelectedAssessmentList;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
UpdateAssessmentPage( UpdateAssessmentPage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.mySelectedAssessmentList,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.currentIndex}); this.changeLoadingState, this.currentIndex});
@ -43,19 +41,20 @@ class UpdateAssessmentPage extends StatefulWidget {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> { class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
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(); 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: int.parse(widget.patientInfo.appointmentNo)); appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()));
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) {
@ -96,7 +95,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
createdOn: element.createdOn, createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID); icdCode10ID: element.icdCode10ID);
widget.mySelectedAssessmentList.add(temMySelectedAssessment); mySelectedAssessmentList.add(temMySelectedAssessment);
} }
}); });
} }
@ -147,7 +146,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
height: 20, height: 20,
), ),
Column( Column(
children: widget.mySelectedAssessmentList children: mySelectedAssessmentList
.map((assessment) { .map((assessment) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -348,7 +347,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
height: 6, height: 6,
), ),
AppText( AppText(
(assessment.remark != null || (assessment.remark != null &&
assessment.remark != assessment.remark !=
'') '')
? TranslationBase.of( ? TranslationBase.of(
@ -501,14 +500,15 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
color: Colors.red[700], color: Colors.red[700],
disabled: model.state == ViewState.BusyLocal, disabled: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) { if (mySelectedAssessmentList.isEmpty) {
Helpers.showErrorToast( Helpers.showErrorToast(
TranslationBase TranslationBase
.of(context) .of(context)
.assessmentErrorMsg); .assessmentErrorMsg);
} else { } else {
widget.changePageViewIndex(3);
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(3);
} }
}, },
), ),
@ -542,11 +542,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
mySelectedAssessment: assessment, mySelectedAssessment: assessment,
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
isUpdate: isUpdate, isUpdate: isUpdate,
mySelectedAssessmentList: widget.mySelectedAssessmentList, mySelectedAssessmentList: mySelectedAssessmentList,
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async { bool isUpdate) async {
setState(() { setState(() {
widget.mySelectedAssessmentList.add(mySelectedAssessment); if(!isUpdate)
mySelectedAssessmentList.add(mySelectedAssessment);
}); });
}); });
}); });

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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';
@ -31,79 +32,55 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
backgroundColor: Color.fromRGBO(248, 248, 248, 1), appBar: BottomSheetTitle(
body: Column( title: "${TranslationBase.of(context).addExamination}",
mainAxisAlignment: MainAxisAlignment.start, ),
children: [ backgroundColor: Color.fromRGBO(248, 248, 248, 1),
Container( body: Column(
padding: mainAxisAlignment: MainAxisAlignment.start,
EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16),
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: AppText( child: SingleChildScrollView(
"${TranslationBase.of(context).addExamination}",
fontSize: SizeConfig.textMultiplier * 3.3,
color: Colors.black,
fontWeight: FontWeight.w700,
),
),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Icon(
Icons.clear,
size: 40,
),
)
],
),
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.all(16.0),
padding: EdgeInsets.all(0.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column( child: Column(
children: [ children: [
ExaminationsListSearchWidget( Container(
masterList: model.physicalExaminationList, margin: EdgeInsets.all(16.0),
isServiceSelected: (master) => padding: EdgeInsets.all(0.0),
isServiceSelected(master), decoration: BoxDecoration(
removeHistory: (history) { shape: BoxShape.rectangle,
setState(() { color: Colors.white,
widget.removeExamination(history); borderRadius: BorderRadius.circular(12),
}); border: Border.fromBorderSide(BorderSide(
}, color: Colors.grey.shade400,
addHistory: (selectedExamination) { width: 0.4,
setState(() { )),
widget.mySelectedExamination ),
.add(selectedExamination); child: Column(
children: [
ExaminationsListSearchWidget(
mySelectedExamination:
widget.mySelectedExamination,
masterList: model.physicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
removeExamination: (history) {
setState(() {
widget.removeExamination(history);
}); });
}, },
addHistory: (selectedExamination) {
widget.mySelectedExamination
.add(selectedExamination);
// setState(() {});
},
), ),
], ],
), ),

@ -14,19 +14,21 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class AddExaminationWidget extends StatefulWidget { class AddExaminationWidget extends StatefulWidget {
MasterKeyModel item; MasterKeyModel item;
final Function(MasterKeyModel) removeHistory; final Function(MasterKeyModel) removeExamination;
final Function(MySelectedExamination) addHistory; final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand; bool isExpand;
final Function expandClick; final Function expandClick;
final List<MySelectedExamination> mySelectedExamination;
AddExaminationWidget({ AddExaminationWidget({
this.item, this.item,
this.removeHistory, this.removeExamination,
this.addHistory, this.addExamination,
this.isServiceSelected, this.isServiceSelected,
this.isExpand, this.isExpand,
this.expandClick, this.expandClick,
this.mySelectedExamination,
}); });
@override @override
@ -40,7 +42,17 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override @override
void initState() { void initState() {
examination.selectedExamination = widget.item; if (getSelectedExam(widget.item) != null) {
examination = getSelectedExam(widget.item);
status = examination.isNormal
? 1
: examination.isAbnormal
? 2
: 3;
remarksController.text = examination.remark;
} else {
examination.selectedExamination = widget.item;
}
super.initState(); super.initState();
} }
@ -70,14 +82,15 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
if (widget.isServiceSelected(widget.item)) { if (widget.isServiceSelected(widget.item)) {
widget.removeHistory(widget.item); if (examination.isLocal)
widget.removeExamination(widget.item);
widget.expandClick(); widget.expandClick();
} else { } else {
examination.isNormal = status == 1; examination.isNormal = status == 1;
examination.isAbnormal = status == 2; examination.isAbnormal = status == 2;
examination.notExamined = status == 3; examination.notExamined = status == 3;
examination.remark = remarksController.text; examination.remark = remarksController.text;
widget.addHistory(examination); widget.addExamination(examination);
widget.expandClick(); widget.expandClick();
} }
}); });
@ -113,18 +126,18 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Row( Row(
children: [ children: [
Expanded( Expanded(
child: Row( child: InkWell(
children: [ onTap: () {
InkWell( setState(() {
onTap: () { status = 1;
setState(() { });
status = 1; examination.isNormal = true;
}); examination.isAbnormal = false;
examination.isNormal = true; examination.notExamined = false;
examination.isAbnormal = false; },
examination.notExamined = false; child: Row(
}, children: [
child: Container( Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6), margin: EdgeInsets.symmetric(horizontal: 6),
width: 20, width: 20,
@ -143,28 +156,28 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
), ),
), ),
), ),
), AppText(
AppText( TranslationBase.of(context).normal,
TranslationBase.of(context).normal, fontWeight: FontWeight.normal,
fontWeight: FontWeight.normal, fontFamily: 'Poppins',
fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier * 1.6, ),
), ],
], ),
)), )),
Expanded( Expanded(
child: Row( child: InkWell(
children: [ onTap: () {
InkWell( setState(() {
onTap: () { status = 2;
setState(() { });
status = 2; examination.isNormal = false;
}); examination.isAbnormal = true;
examination.isNormal = false; examination.notExamined = false;
examination.isAbnormal = true; },
examination.notExamined = false; child: Row(
}, children: [
child: Container( Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6), margin: EdgeInsets.symmetric(horizontal: 6),
width: 20, width: 20,
@ -183,57 +196,58 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
), ),
), ),
), ),
), AppText(
AppText( TranslationBase.of(context).abnormal,
TranslationBase.of(context).abnormal, fontWeight: FontWeight.normal,
fontWeight: FontWeight.normal, fontFamily: 'Poppins',
fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier * 1.6, ),
), ],
], ),
)), )),
Expanded( if (!examination.isLocal)
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 3;
});
examination.isNormal = false;
examination.isAbnormal = false;
examination.notExamined = true;
},
child: Row( child: Row(
children: [ children: [
InkWell( Container(
onTap: () { padding: EdgeInsets.all(2.0),
setState(() { margin: EdgeInsets.symmetric(horizontal: 6),
status = 3; width: 20,
}); height: 20,
examination.isNormal = false;
examination.isAbnormal = false;
examination.notExamined = true;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: status == 3 color: Colors.white,
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle, shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 3
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
), ),
), ),
), Expanded(
), child: AppText(
Expanded( TranslationBase.of(context).notExamined,
child: AppText( fontWeight: FontWeight.normal,
TranslationBase.of(context).notExamined, fontFamily: 'Poppins',
fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 1.6,
fontFamily: 'Poppins', ),
fontSize: SizeConfig.textMultiplier * 1.6, ),
), ],
), ),
], )),
)),
], ],
), ),
Container( Container(
@ -256,4 +270,15 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
), ),
); );
} }
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return exam.first;
}
return null;
}
} }

@ -40,25 +40,6 @@ class ExaminationItemCard extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
), ),
)), )),
Row(
children: [
AppText(
TranslationBase.of(context).remove,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.red.shade800,
fontSize: SizeConfig.textMultiplier * 1.8,
),
InkWell(
onTap: removeExamination,
child: Icon(
Icons.clear,
size: 20,
color: Colors.red.shade800,
),
)
],
),
], ],
), ),
AppText( AppText(
@ -79,6 +60,7 @@ class ExaminationItemCard extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
if(examination.remark.isNotEmpty)
AppText( AppText(
examination.remark, examination.remark,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,

@ -8,16 +8,17 @@ import 'package:flutter/material.dart';
import 'add_examination_widget.dart'; import 'add_examination_widget.dart';
class ExaminationsListSearchWidget extends StatefulWidget { class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MasterKeyModel) removeHistory; final Function(MasterKeyModel) removeExamination;
final Function(MySelectedExamination) addHistory; final Function(MySelectedExamination) addHistory;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList; final List<MasterKeyModel> masterList;
final List<MySelectedExamination> mySelectedExamination;
ExaminationsListSearchWidget( ExaminationsListSearchWidget(
{this.removeHistory, {this.removeExamination,
this.addHistory, this.addHistory,
this.isServiceSelected, this.isServiceSelected,
this.masterList}); this.masterList, this.mySelectedExamination});
@override @override
_ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState createState() =>
@ -61,8 +62,9 @@ class _ExaminationsListSearchWidgetState
...items.mapIndexed((index, item) { ...items.mapIndexed((index, item) {
return AddExaminationWidget( return AddExaminationWidget(
item: item, item: item,
addHistory: widget.addHistory, addExamination: widget.addHistory,
removeHistory: widget.removeHistory, removeExamination: widget.removeExamination,
mySelectedExamination: widget.mySelectedExamination,
isServiceSelected: widget.isServiceSelected, isServiceSelected: widget.isServiceSelected,
isExpand: index == expandedIndex, isExpand: index == expandedIndex,
expandClick: () { expandClick: () {

@ -28,13 +28,11 @@ class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage( UpdateObjectivePage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.currentIndex}); this.currentIndex});
@ -45,8 +43,10 @@ class UpdateObjectivePage extends StatefulWidget {
class _UpdateObjectivePageState extends State<UpdateObjectivePage> { class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
bool isSysExaminationExpand = false; bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List();
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -62,11 +62,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.mySelectedExamination.clear(); mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( GetPhysicalExamReqModel getPhysicalExamReqModel =
patientMRN: widget.patientInfo.patientMRN, GetPhysicalExamReqModel(
episodeID: widget.patientInfo.episodeNo.toString(), patientMRN: widget.patientInfo.patientMRN,
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientPhysicalExam(getPhysicalExamReqModel); await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) { if (model.patientPhysicalExamList.isNotEmpty) {
@ -79,14 +81,18 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
id: element.examId, id: element.examId,
); );
MySelectedExamination tempEam = MySelectedExamination( MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster, selectedExamination: examMaster,
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
createdBy: element.createdBy, createdBy: element.createdBy,
notExamined: element.notExamined, createdOn: element.createdOn,
isNew: element.isNew, editedOn: element.editedOn,
isAbnormal: element.isAbnormal); notExamined: element.notExamined,
widget.mySelectedExamination.add(tempEam); isNew: element.isNew,
isLocal: false,
isAbnormal: element.isAbnormal,
);
mySelectedExamination.add(tempEam);
}); });
} }
@ -102,9 +108,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).physicalSystemExamination, headerTitle:
TranslationBase.of(context).physicalSystemExamination,
onTap: () { onTap: () {
setState(() { setState(() {
isSysExaminationExpand = !isSysExaminationExpand; isSysExaminationExpand = !isSysExaminationExpand;
@ -113,15 +122,17 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: Column( child: Column(
children: [ children: [
SOAPOpenItems( SOAPOpenItems(
label: "${TranslationBase.of(context).addExamination}", label:
"${TranslationBase.of(context).addExamination}",
onTap: () { onTap: () {
openExaminationList(context); openExaminationList(context);
}, },
), ),
Column( Column(
children: widget.mySelectedExamination.map((examination) { children: mySelectedExamination.map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination); removeExamination(
examination.selectedExamination);
}); });
}).toList(), }).toList(),
) )
@ -198,40 +209,45 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel =
widget.mySelectedExamination.forEach((exam) { new PostPhysicalExamRequestModel();
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) mySelectedExamination.forEach((exam) {
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(ListHisProgNotePhysicalExaminationVM( postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
patientMRN: widget.patientInfo.patientMRN, .add(ListHisProgNotePhysicalExaminationVM(
episodeId: widget.patientInfo.episodeNo, patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo, episodeId: widget.patientInfo.episodeNo,
remarks: exam.remark ?? '', appointmentNo: widget.patientInfo.appointmentNo,
createdBy: exam.createdBy ?? doctorProfile.doctorID, remarks: exam.remark ?? '',
createdOn: DateTime.now().toIso8601String(), createdBy: exam.createdBy ?? doctorProfile.doctorID,
editedBy: doctorProfile.doctorID, createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedOn: DateTime.now().toIso8601String(), editedBy: doctorProfile.doctorID,
examId: exam.selectedExamination.id, editedOn: DateTime.now().toIso8601String(),
examType: exam.selectedExamination.typeId, examId: exam.selectedExamination.id,
isAbnormal: exam.isAbnormal, examType: exam.selectedExamination.typeId,
isNormal: exam.isNormal, isAbnormal: exam.isAbnormal,
notExamined: exam.notExamined, isNormal: exam.isNormal,
examinationType: exam.isNormal notExamined: exam.notExamined,
? 1 examinationType: exam.isNormal
: exam.isAbnormal ? 1
? 2 : exam.isAbnormal
: 3, ? 2
examinationTypeName: exam.isNormal : 3,
? "Normal" examinationTypeName: exam.isNormal
: exam.isAbnormal ? "Normal"
? 'AbNormal' : exam.isAbnormal
: "Not Examined", ? 'AbNormal'
isNew: exam.isNew)); : "Not Examined",
isNew: exam.isNew));
}); });
if (model.patientPhysicalExamList.isEmpty) { if (model.patientPhysicalExamList.isEmpty) {
@ -241,10 +257,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
} }
} else { } else {
@ -253,12 +269,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination.where((element) => Iterable<MySelectedExamination> history = mySelectedExamination.where(
masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); (element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) if (history.length > 0)
setState(() { setState(() {
widget.mySelectedExamination.remove(history.first); mySelectedExamination.remove(history.first);
}); });
} }
@ -267,7 +285,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
context, context,
FadePage( FadePage(
page: AddExaminationPage( page: AddExaminationPage(
mySelectedExamination: widget.mySelectedExamination, mySelectedExamination: mySelectedExamination,
addSelectedExamination: () { addSelectedExamination: () {
setState(() { setState(() {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -276,21 +294,6 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
removeExamination: (masterKey) => removeExamination(masterKey)), removeExamination: (masterKey) => removeExamination(masterKey)),
), ),
); );
/*showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),
);
});*/
} }
} }
@ -299,7 +302,11 @@ class AddExaminationDailog extends StatefulWidget {
final Function addSelectedExamination; final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog({Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key); : super(key: key);
@override @override
@ -314,7 +321,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -324,19 +332,21 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: Container( child: Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 16, children: [
), SizedBox(
AppText( height: 16,
TranslationBase.of(context).physicalSystemExamination, ),
fontWeight: FontWeight.bold, AppText(
fontSize: 16, TranslationBase.of(context).physicalSystemExamination,
), fontWeight: FontWeight.bold,
SizedBox( fontSize: 16,
height: 16, ),
), SizedBox(
]), height: 16,
),
]),
))), ))),
)), )),
); );

@ -27,14 +27,12 @@ class UpdatePlanPage extends StatefulWidget {
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
GetPatientProgressNoteResModel patientProgressNote;
UpdatePlanPage( UpdatePlanPage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.patientProgressNote,
this.currentIndex}); this.currentIndex});
@override @override
@ -44,10 +42,14 @@ class UpdatePlanPage extends StatefulWidget {
class _UpdatePlanPageState extends State<UpdatePlanPage> { class _UpdatePlanPageState extends State<UpdatePlanPage> {
bool isAddProgress = true; bool isAddProgress = true;
bool isProgressExpanded = true; bool isProgressExpanded = true;
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
TextEditingController progressNoteController = TextEditingController(text: null); TextEditingController progressNoteController =
TextEditingController(text: null);
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -62,32 +64,74 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (widget.patientProgressNote.planNote != null) { if (patientProgressNote.planNote != null) {
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
}); });
} }
} }
getPatientProgressNote(model, {bool isAddProgress = false}) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = isAddProgress;
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( GetGetProgressNoteReqModel getGetProgressNoteReqModel =
appointmentNo: int.parse(widget.patientInfo.appointmentNo), GetGetProgressNoteReqModel(
patientMRN: widget.patientInfo.patientMRN, appointmentNo:
episodeID: widget.patientInfo.episodeNo.toString(), int.parse(widget.patientInfo.appointmentNo.toString()),
editedBy: '', patientMRN: widget.patientInfo.patientMRN,
doctorID: ''); episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel); await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) { if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(model.patientProgressNoteList[0].planNote); progressNoteController.text = Helpers.parseHtmlString(
widget.patientProgressNote.planNote = progressNoteController.text; model.patientProgressNoteList[0].planNote);
widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; patientProgressNote.planNote = progressNoteController.text;
widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; patientProgressNote.createdByName =
widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; model.patientProgressNoteList[0].createdByName;
widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
}); });
@ -104,7 +148,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
widthFactor: 0.90, widthFactor: 0.90,
child: Column( child: Column(
children: [ children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -123,33 +169,41 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
children: [ children: [
if (isAddProgress) if (isAddProgress)
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).progressNote, hintText: TranslationBase.of(context)
.progressNote,
controller: progressNoteController, controller: progressNoteController,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (value) { onChanged: (value) {
widget.patientProgressNote.planNote = value; setState(() {
patientProgressNote.planNote = value;
});
}, },
), ),
), ),
SizedBox( SizedBox(
height: 9, height: 9,
), ),
if (widget.patientProgressNote.planNote != null && !isAddProgress) if (patientProgressNote.planNote != null &&
!isAddProgress)
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5, left: 5,
right: 5, right: 5,
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
@ -158,40 +212,61 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
fontSize: 12, fontSize: 12,
), ),
AppText( AppText(
widget.patientProgressNote.appointmentNo ?? '', patientProgressNote
.appointmentNo !=
null
? patientProgressNote
.appointmentNo
.toString()
: '',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14,
), ),
], ],
), ),
AppText( AppText(
widget.patientProgressNote.createdOn != null patientProgressNote.createdOn !=
? AppDateUtils.getDayMonthYearDateFormatted( null
DateTime.parse(widget.patientProgressNote.createdOn)) ? AppDateUtils
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), .getDayMonthYearDateFormatted(
DateTime.parse(
patientProgressNote
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
) )
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( // Row(
children: [ // children: [
AppText( // AppText(
'Condition: ', // 'Condition: ',
fontSize: 12, // fontSize: 12,
), // ),
AppText(widget.patientProgressNote.mName ?? '', // AppText(
fontWeight: FontWeight.w600), // patientProgressNote.mName ??
], // '',
), // fontWeight: FontWeight.w600),
// ],
// ),
AppText( AppText(
widget.patientProgressNote.createdOn != null patientProgressNote.createdOn !=
null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse(widget.patientProgressNote.createdOn)) DateTime.parse(
: AppDateUtils.getHour(DateTime.now()), patientProgressNote
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
) )
@ -201,7 +276,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
height: 8, height: 8,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
@ -213,7 +289,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
onTap: () { onTap: () {
setState(() { setState(() {
isAddProgress = true; isAddProgress = true;
widget.changePageViewIndex(3, isChangeState: false);
}); });
}, },
child: Icon( child: Icon(
@ -274,30 +349,23 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
Expanded( Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: isAddProgress
? TranslationBase.of(context).next
: TranslationBase.of(context).finish,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red[700], color: Colors.red[700],
loading: model.state == ViewState.BusyLocal,
disabled: progressNoteController.text.isEmpty, disabled: progressNoteController.text.isEmpty,
onPressed: () async { onPressed: () async {
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) { if (isAddProgress) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
setState(() {
widget.patientProgressNote.createdByName =
widget.patientProgressNote.createdByName ?? doctorProfile.doctorName;
widget.patientProgressNote.editedByName = doctorProfile.doctorName;
widget.patientProgressNote.createdOn = DateTime.now().toString();
widget.patientProgressNote.planNote = progressNoteController.text;
isAddProgress = !isAddProgress;
});
submitPlan(model); submitPlan(model);
} else { } else {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); Helpers.showErrorToast(
TranslationBase.of(context)
.progressNoteErrorMsg);
} }
}, },
), ),
@ -318,19 +386,20 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
submitPlan(SOAPViewModel model) async { submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( widget.changeLoadingState(true);
patientMRN: widget.patientInfo.patientMRN, PostProgressNoteRequestModel postProgressNoteRequestModel =
episodeId: widget.patientInfo.episodeNo, new PostProgressNoteRequestModel(
appointmentNo: widget.patientInfo.appointmentNo, patientMRN: widget.patientInfo.patientMRN,
planNote: widget.patientProgressNote.planNote, episodeId: widget.patientInfo.episodeNo,
doctorID: '', appointmentNo: widget.patientInfo.appointmentNo,
editedBy: ''); planNote: patientProgressNote.planNote,
doctorID: '',
editedBy: '');
if (model.patientProgressNoteList.isEmpty) { if (model.patientProgressNoteList.isEmpty) {
await model.postProgressNote(postProgressNoteRequestModel); await model.postProgressNote(postProgressNoteRequestModel);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await model.patchProgressNote(postProgressNoteRequestModel); await model.patchProgressNote(postProgressNoteRequestModel);
@ -339,8 +408,37 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
widget.changePageViewIndex(4, isChangeState: false);
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = false;
});
}
} }
widget.changeLoadingState(false);
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} }

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget { class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
const BottomSheetTitle({ const BottomSheetTitle({
Key key, this.title, Key key, this.title,
}) : super(key: key); }) : super(key: key);
@ -57,4 +57,7 @@ class BottomSheetTitle extends StatelessWidget {
), ),
); );
} }
@override
Size get preferredSize => Size(double.maxFinite,115);
} }

@ -247,6 +247,8 @@ class StepsWidget extends StatelessWidget {
"Plan", "Plan",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
textAlign: TextAlign.end,
marginLeft: 25,
), ),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
@ -530,20 +532,22 @@ class StatusLabel extends StatelessWidget {
), ),
border: Border.all(color: HexColor('#707070'), width: 0.30), border: Border.all(color: HexColor('#707070'), width: 0.30),
), ),
child: AppText( child: Center(
stepId == selectedStepId child: AppText(
? "inProgress" stepId == selectedStepId
: stepId < selectedStepId ? "inProgress"
? "Completed" : stepId < selectedStepId
: " Locked ", ? "Completed"
fontWeight: FontWeight.bold, : "Locked",
textAlign: TextAlign.center, fontWeight: FontWeight.bold,
fontSize: 10, textAlign: TextAlign.center,
color: stepId == selectedStepId fontSize: 10,
? Color(0xFFCC9B14) color: stepId == selectedStepId
: stepId < selectedStepId ? Color(0xFFCC9B14)
? Color(0xFF359846) : stepId < selectedStepId
: Color(0xFF969696), ? Color(0xFF359846)
: Color(0xFF969696),
),
), ),
); );
} }

@ -1,5 +1,6 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.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/enum/viewstate.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/models/SOAP/master_key_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/models/SOAP/my_selected_allergy.dart';
@ -8,12 +9,12 @@ import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.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:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../shared_soap_widgets/bottom_sheet_title.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart';
import 'master_key_checkbox_search_allergies_widget.dart';
class AddAllergies extends StatefulWidget { class AddAllergies extends StatefulWidget {
final Function addAllergiesFun; final Function addAllergiesFun;
@ -83,95 +84,107 @@ class _AddAllergiesState extends State<AddAllergies> {
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
body: Center( appBar: BottomSheetTitle(
child: Container( title: TranslationBase.of(context).addAllergies,
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, body: Center(
children: [ child: Container(
BottomSheetTitle( child: Column(
title: TranslationBase.of(context).addAllergies, crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () {
setState(() {
widget
.addAllergiesFun(myAllergiesListLocal);
});
},
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
),
),
), ),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
),
]),
),
),
bottomSheet: model.state == ViewState.Busy
? Container(
height: 0,
)
: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SizedBox( Container(
height: 16, child: FractionallySizedBox(
), widthFactor: .80,
Expanded( child: Center(
child: Center( child: AppButton(
child: FractionallySizedBox( title: TranslationBase.of(context).addAllergies,
widthFactor: 0.9, padding: 10,
child: Center( color: Color(0xFF359846),
child: NetworkBaseView( onPressed: () {
baseViewModel: model, setState(() {
child: MasterKeyCheckboxSearchAllergiesWidget( widget.addAllergiesFun(myAllergiesListLocal);
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),
),
),
), ),
), ),
), ),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.11, height: 5,
), ),
]), ],
),
),bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
TranslationBase.of(context).addAllergies,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addAllergiesFun(myAllergiesListLocal);
},
),
), ),
), ),
), ),
SizedBox(
height: 5,
),
],
),
),),
), ),
); );
} }
@ -207,17 +220,15 @@ class _AddAllergiesState extends State<AddAllergies> {
addAllergyLocally(MySelectedAllergy mySelectedAllergy) { addAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (mySelectedAllergy.selectedAllergy == null) { if (mySelectedAllergy.selectedAllergy == null) {
Helpers.showErrorToast(TranslationBase Helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
.of(context)
.requiredMsg);
} else { } else {
setState(() { setState(() {
List<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
// ignore: missing_return // ignore: missing_return
myAllergiesListLocal myAllergiesListLocal
.where((element) => .where((element) =>
mySelectedAllergy.selectedAllergy.id == mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id) element.selectedAllergy.id)
.toList(); .toList();
if (allergy.isEmpty) { if (allergy.isEmpty) {

@ -0,0 +1,197 @@
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/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.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';
class AddAllergiesItem extends StatefulWidget {
final SOAPViewModel model;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final MasterKeyModel item;
const AddAllergiesItem(
{Key key,
this.model,
this.removeAllergy,
this.addAllergy,
this.isServiceSelected,
this.getServiceSelectedAllergy,
this.item})
: super(key: key);
@override
_AddAllergiesItemState createState() => _AddAllergiesItemState();
}
class _AddAllergiesItemState extends State<AddAllergiesItem> {
MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
bool isSelected = widget.isServiceSelected(widget.item);
MySelectedAllergy mySelectedAllergy;
if (isSelected) {
mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item);
}
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(widget.item),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
onTapItem();
}),
InkWell(
onTap:onTapItem,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: Container(
child: AppText(
projectViewModel.isArabic
? widget.item.nameAr != ""
? widget.item.nameAr
: widget.item.nameEn
: widget.item.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: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: Column(
children: [
AppTextFieldCustom(
onClick: widget.model.allergySeverityList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: widget.model.allergySeverityList,
selectedValue:
mySelectedAllergy.selectedAllergySeverity,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
mySelectedAllergy.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity,
enabled: false,
maxLines: 2,
minLines: 2,
validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError
? TranslationBase.of(context).emptyMessage
: null,
controller: severityController,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
controller: remarkController,
maxLines: 25,
minLines: 3,
hasBorder: true,
onChanged: (value){
mySelectedAllergy.remark = value;
},
inputType: TextInputType.multiline,
),
SizedBox(
height: 10,
),
],
),
),
),
),
isExpand:
mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false,
);
}
onTapItem(){
setState(() {
if (widget.isServiceSelected(widget.item)) {
widget.removeAllergy(widget.item);
} else {
MySelectedAllergy mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy: widget.item,
selectedAllergySeverity: _selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);
widget.addAllergy(mySelectedAllergy);
}
});
}
}

@ -0,0 +1,148 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_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/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'allergies_item.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();
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.70,
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
AppTextFieldCustom(
// height:
// MediaQuery.of(context).size.height * 0.070,
hintText:
TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: false,
// controller: filteredSearchController,
onChanged: (value) {
filterSearchResults(value);
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
)),
),
DividerWithSpacesAround(),
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) {
return AddAllergiesItem(
item:items[index],
model: widget.model,
removeAllergy: widget.removeAllergy,
addAllergy:widget.addAllergy,
isServiceSelected: widget.isServiceSelected,
getServiceSelectedAllergy: widget.getServiceSelectedAllergy,
);
},
),
),
),
),
],
))),
),
),
SizedBox(
height: 10,
),
],
),
);
}
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);
});
}
}
}

@ -34,10 +34,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
return Column( return Column(
children: [ children: [
SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () {
openAllergiesList(context, changeAllState); openAllergiesList(context, changeAllState, removeAllergy);
},), },),
SizedBox( SizedBox(
height: 20, height: 20,
@ -153,16 +151,18 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
).toList(); ).toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if(allergy.first.isLocal) {
setState(() {
widget.myAllergiesList.remove(allergy.first);
});
}
setState(() { setState(() {
allergy[0].isChecked = false; allergy[0].isChecked = false;
}); });
} }
print(allergy);
} }
openAllergiesList(BuildContext context, Function changeParentState) { openAllergiesList(BuildContext context, Function changeParentState, removeAllergy) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
@ -175,15 +175,29 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
bool isAllDataFilled = true; bool isAllDataFilled = true;
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if (element.selectedAllergySeverity == null) { if (element.selectedAllergySeverity == null) {
element.hasValidationError = true;
isAllDataFilled = false; isAllDataFilled = false;
} }
}); });
if (isAllDataFilled) { if (isAllDataFilled) {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) { if ((widget.myAllergiesList.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id,
orElse: () => null)) == null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
}); });
/// remove items.
List<MySelectedAllergy> removedList= [];
widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id,
orElse: () => null)) == null) {
removedList.add(element);
}});
removedList.forEach((element) {
removeAllergy(element);
});
changeParentState(); changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {

@ -1,4 +1,5 @@
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/enum/viewstate.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/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
@ -19,10 +20,15 @@ class AddHistoryDialog extends StatefulWidget {
final PageController controller; final PageController controller;
final List<MySelectedHistory> myHistoryList; final List<MySelectedHistory> myHistoryList;
final Function addSelectedHistories; final Function addSelectedHistories;
final Function (MasterKeyModel) removeHistory; final Function(MasterKeyModel) removeHistory;
const AddHistoryDialog( const AddHistoryDialog(
{Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) {Key key,
this.changePageViewIndex,
this.controller,
this.myHistoryList,
this.addSelectedHistories,
this.removeHistory})
: super(key: key); : super(key: key);
@override @override
@ -51,96 +57,96 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addHistory),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
BottomSheetTitle(title:TranslationBase.of(context).addHistory), SizedBox(
SizedBox( height: 10,
height: 10, ),
), PriorityBar(onTap: (activePriority) async {
PriorityBar(onTap: (activePriority) async { widget.changePageViewIndex(activePriority);
widget.changePageViewIndex(activePriority); }),
}), SizedBox(
SizedBox( height: 20,
height: 20, ),
), Expanded(
Expanded( child: FractionallySizedBox(
child: FractionallySizedBox( widthFactor: 0.9,
widthFactor: 0.9, child: PageView(
child: PageView( physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), controller: widget.controller,
controller: widget.controller, onPageChanged: (index) {
onPageChanged: (index) { setState(() {});
setState(() { },
}); scrollDirection: Axis.horizontal,
}, children: <Widget>[
scrollDirection: Axis.horizontal, NetworkBaseView(
children: <Widget>[ baseViewModel: model,
NetworkBaseView( child: MasterKeyCheckboxSearchWidget(
baseViewModel: model, model: model,
child: MasterKeyCheckboxSearchWidget( masterList: model.historyFamilyList,
model: model, removeHistory: (history) {
masterList: model.historyFamilyList, setState(() {
removeHistory: (history){ widget.removeHistory(history);
setState(() { });
widget.removeHistory(history); },
}); addHistory: (history) {
}, setState(() {
addHistory: (history){ createAndAddHistory(history);
setState(() { });
createAndAddHistory( },
history); addSelectedHistories: () {
}); widget.addSelectedHistories();
}, },
addSelectedHistories: (){ isServiceSelected: (master) =>
widget.addSelectedHistories(); isServiceSelected(master),
}, ),
isServiceSelected: (master) =>isServiceSelected(master), ),
), NetworkBaseView(
), baseViewModel: model,
NetworkBaseView( child: MasterKeyCheckboxSearchWidget(
baseViewModel: model, model: model,
child: MasterKeyCheckboxSearchWidget( masterList: model
model: model, .mergeHistorySurgicalWithHistorySportList,
masterList: model.mergeHistorySurgicalWithHistorySportList, removeHistory: (history) {
removeHistory: (history){ setState(() {
setState(() { widget.removeHistory(history);
widget.removeHistory(history); });
}); },
}, addHistory: (history) {
addHistory: (history){ setState(() {
setState(() { createAndAddHistory(history);
createAndAddHistory( });
history); },
}); addSelectedHistories: () {
}, widget.addSelectedHistories();
addSelectedHistories: (){ },
widget.addSelectedHistories(); isServiceSelected: (master) =>
}, isServiceSelected(master),
isServiceSelected: (master) =>isServiceSelected(master), ),
), ),
), NetworkBaseView(
NetworkBaseView( baseViewModel: model,
baseViewModel: model, child: MasterKeyCheckboxSearchWidget(
child: MasterKeyCheckboxSearchWidget( model: model,
model: model, masterList: model.historyMedicalList,
masterList: model.historyMedicalList, removeHistory: (history) {
removeHistory: (history){ setState(() {
setState(() { widget.removeHistory(history);
widget.removeHistory(history); });
}); },
}, addHistory: (history) {
addHistory: (history){ setState(() {
setState(() { createAndAddHistory(history);
createAndAddHistory( });
history); },
}); addSelectedHistories: () {
}, widget.addSelectedHistories();
addSelectedHistories: (){ },
widget.addSelectedHistories();
},
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
), ),
@ -149,59 +155,63 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
), ),
), ),
), ),
SizedBox(height:MediaQuery.of(context).size.height * 0.11 ,) SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
)
], ],
) )),
),
), ),
bottomSheet: Container( bottomSheet: model.state == ViewState.Busy
decoration: BoxDecoration( ? Container(
color: Colors.white, height: 0,
borderRadius: BorderRadius.all( )
Radius.circular(0.0), : Container(
), decoration: BoxDecoration(
border: Border.all(color: HexColor('#707070'), width: 0), color: Colors.white,
), borderRadius: BorderRadius.all(
height: MediaQuery.of(context).size.height * 0.1, Radius.circular(0.0),
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
TranslationBase.of(context).addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
), ),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context)
.addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
),
),
),
SizedBox(
height: 5,
),
],
), ),
), ),
SizedBox(
height: 5,
),
],
),
),
), ),
)); ));
} }
createAndAddHistory(MasterKeyModel history) { createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList.where((element) => List<MySelectedHistory> myhistory = widget.myHistoryList
history.id == .where((element) =>
element.selectedHistory.id && history.id == element.selectedHistory.id &&
history.typeId == history.typeId == element.selectedHistory.typeId)
element.selectedHistory.typeId .toList();
).toList();
if (myhistory.isEmpty) { if (myhistory.isEmpty) {
setState(() { setState(() {
@ -217,18 +227,14 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedHistory> history = Iterable<MySelectedHistory> history = widget.myHistoryList.where(
widget (element) =>
.myHistoryList masterKey.id == element.selectedHistory.id &&
.where((element) => masterKey.typeId == element.selectedHistory.typeId &&
masterKey.id == element.selectedHistory.id && element.isChecked);
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }
return false; return false;
} }
} }

@ -123,10 +123,19 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
).toList(); ).toList();
if (history.length > 0) if (history.length > 0) {
setState(() { if(history.first.isLocal) {
history[0].isChecked = false; setState(() {
}); widget.myHistoryList.remove(history.first);
});
} else {
setState(() {
history[0].isChecked = false;
});
}
}
} }
openHistoryList(BuildContext context) { openHistoryList(BuildContext context) {

@ -1,6 +1,7 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.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/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.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';
@ -74,15 +75,15 @@ class _AddMedicationState extends State<AddMedication> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addMedication,
),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
BottomSheetTitle(
title: TranslationBase.of(context).addMedication,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -187,6 +188,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationDoseTimeList, list: model.medicationDoseTimeList,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
selectedValue: _selectedMedicationDose,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedMedicationDose = _selectedMedicationDose =
@ -235,6 +237,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationStrengthList, list: model.medicationStrengthList,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
selectedValue: _selectedMedicationStrength,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedMedicationStrength = _selectedMedicationStrength =
@ -283,6 +286,7 @@ class _AddMedicationState extends State<AddMedication> {
MasterKeyDailog dialog = MasterKeyDailog dialog =
MasterKeyDailog( MasterKeyDailog(
list: model.medicationRouteList, list: model.medicationRouteList,
selectedValue: _selectedMedicationRoute,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
@ -332,6 +336,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationFrequencyList, list: model.medicationFrequencyList,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
selectedValue: _selectedMedicationFrequency,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedMedicationFrequency = _selectedMedicationFrequency =
@ -381,7 +386,7 @@ class _AddMedicationState extends State<AddMedication> {
]), ]),
), ),
), ),
bottomSheet: Container( bottomSheet:model.state == ViewState.Busy?Container(height: 0,): Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(

@ -30,16 +30,12 @@ import 'history/update_history_widget.dart';
class UpdateSubjectivePage extends StatefulWidget { class UpdateSubjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final Function changeLoadingState; final Function changeLoadingState;
final List<MySelectedAllergy> myAllergiesList;
final List<MySelectedHistory> myHistoryList;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final int currentIndex; final int currentIndex;
UpdateSubjectivePage( UpdateSubjectivePage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.myAllergiesList,
this.myHistoryList,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.currentIndex}); this.currentIndex});
@ -59,6 +55,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
String medicationControllerError = ''; String medicationControllerError = '';
String illnessControllerError = ''; String illnessControllerError = '';
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList=List();
List<MySelectedHistory> myHistoryList=List();
getHistory(SOAPViewModel model) async { getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true); widget.changeLoadingState(true);
@ -93,9 +91,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
@ -105,9 +103,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
@ -117,9 +115,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
@ -129,9 +127,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
}); });
@ -169,8 +167,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
isChecked: element.isChecked, isChecked: element.isChecked,
createdBy: element.createdBy, createdBy: element.createdBy,
remark: element.remarks, remark: element.remarks,
isLocal : false,
selectedAllergySeverity: selectedAllergySeverity); selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
}); });
} }
} }
@ -179,8 +178,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.myAllergiesList.clear(); myAllergiesList.clear();
widget.myHistoryList.clear(); myHistoryList.clear();
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
@ -246,7 +245,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}); });
}, },
child: Column( child: Column(
children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)], children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
), ),
isExpanded: isHistoryExpand, isExpanded: isHistoryExpand,
), ),
@ -264,7 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
child: Column( child: Column(
children: [ children: [
UpdateAllergiesWidget( UpdateAllergiesWidget(
myAllergiesList: widget.myAllergiesList, myAllergiesList: myAllergiesList,
), ),
SizedBox( SizedBox(
height: 30, height: 30,
@ -304,10 +303,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red[700], color: Colors.red[700],
loading: model.state == ViewState.BusyLocal, // loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
addSubjectiveInfo( addSubjectiveInfo(
model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList); model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
}, },
), ),
), ),
@ -325,6 +324,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
addSubjectiveInfo( addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async { {SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
if(FocusScope.of(context).hasFocus)
FocusScope.of(context).unfocus();
widget.changeLoadingState(true);
formKey.currentState.save(); formKey.currentState.save();
formKey.currentState.validate(); formKey.currentState.validate();
@ -338,7 +340,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
if (myHistoryList.length != 0) { if (myHistoryList.length != 0) {
await postHistories(model: model, myHistoryList: myHistoryList); await postHistories(model: model, myHistoryList: myHistoryList);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -370,6 +371,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
medicationControllerError = TranslationBase.of(context).emptyMessage; medicationControllerError = TranslationBase.of(context).emptyMessage;
} }
}); });
widget.changeLoadingState(false);
Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
} }
} }
@ -380,7 +383,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
widget.myAllergiesList.forEach((allergy) { myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
@ -404,6 +407,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
await model.patchAllergy(postAllergyRequestModel); await model.patchAllergy(postAllergyRequestModel);
} }
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
@ -419,7 +425,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async { postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
widget.myHistoryList.forEach((history) { myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,

@ -31,11 +31,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
int _currentIndex = 0; int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList = List(); List<MySelectedAllergy> myAllergiesList = List();
List<MySelectedHistory> myHistoryList = List(); List<MySelectedHistory> myHistoryList = List();
List<MySelectedExamination> mySelectedExamination = List();
List<MySelectedAssessment> mySelectedAssessment = List();
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex,{isChangeState = true}) { changePageViewIndex(pageIndex,{isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) if (pageIndex != _currentIndex && isChangeState)
@ -65,12 +61,11 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Widget build(BuildContext context) { Widget build(BuildContext context) {
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'];
return BaseView<DoctorReplayViewModel>( return AppScaffold(
builder: (_, model, w) => AppScaffold( isLoading: _isLoading,
isLoading: _isLoading, isShowAppBar: false,
isShowAppBar: false, body: SingleChildScrollView(
body: SingleChildScrollView( child: SingleChildScrollView(
child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -105,27 +100,22 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
UpdateSubjectivePage( UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState), changeLoadingState: changeLoadingState),
UpdateObjectivePage( UpdateObjectivePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
mySelectedExamination: mySelectedExamination,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState), changeLoadingState: changeLoadingState),
UpdateAssessmentPage( UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
mySelectedAssessmentList: mySelectedAssessment,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState), changeLoadingState: changeLoadingState),
UpdatePlanPage( UpdatePlanPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
patientInfo: patient, patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState) changeLoadingState: changeLoadingState)
], ],
), ),
@ -137,6 +127,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
), ),
), ),
), ),
)); );
} }
} }

@ -562,6 +562,7 @@ class TranslationBase {
localizedValues['no-priscription-listed'][locale.languageCode]; localizedValues['no-priscription-listed'][locale.languageCode];
String get next => localizedValues['next'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode];
String get finish => localizedValues['finish'][locale.languageCode];
String get previous => localizedValues['previous'][locale.languageCode]; String get previous => localizedValues['previous'][locale.languageCode];

@ -1,421 +0,0 @@
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/shared/text_fields/new_text_Field.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.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 'divider_with_spaces_around.dart';
import 'expandable-widget-header-body.dart';
import 'text_fields/app-textfield-custom.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.70,
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
AppTextFieldCustom(
// height:
// MediaQuery.of(context).size.height * 0.070,
hintText:
TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: false,
// controller: filteredSearchController,
onChanged: (value) {
filterSearchResults(value);
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
)),
),
DividerWithSpacesAround(),
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.removeAllergy(
items[index]);
} else {
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[
index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked:
true,
isExpanded:
true);
widget.addAllergy(
mySelectedAllergy);
}
});
}),
InkWell(
onTap: () {
setState(() {
if (widget
.isServiceSelected(
items[index])) {
widget.removeAllergy(
items[index]);
} else {
MySelectedAllergy mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[
index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded:
true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
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: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: Column(
children: [
AppTextFieldCustom(
onClick: 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,
isTextFieldHasSuffix: true,
hintText:
TranslationBase.of(
context)
.selectSeverity,
enabled: false,
maxLines: 2,
minLines: 2,
controller:
severityController,
),
SizedBox(
height: 5,
),
if (isSubmitted &&
mySelectedAllergy !=
null &&
mySelectedAllergy
.selectedAllergySeverity ==
null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment:
MainAxisAlignment
.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0,
right: 0,
top: 15),
child: NewTextFields(
hintText:
TranslationBase.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight:
FontWeight.w600,
maxLines: 25,
minLines: 3,
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,
);
},
),
),
),
),
],
))),
),
),
SizedBox(
height: 10,
),
],
),
);
}
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);
});
}
}
}

@ -27,6 +27,7 @@ class AppTextFieldCustom extends StatefulWidget {
final String validationError; final String validationError;
final bool isPrscription; final bool isPrscription;
final bool isSecure; final bool isSecure;
final bool focus;
AppTextFieldCustom({ AppTextFieldCustom({
this.height = 0, this.height = 0,
@ -47,6 +48,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.validationError, this.validationError,
this.isPrscription = false, this.isPrscription = false,
this.isSecure = false, this.isSecure = false,
this.focus = false,
}); });
@override @override
@ -54,6 +56,32 @@ class AppTextFieldCustom extends StatefulWidget {
} }
class _AppTextFieldCustomState extends State<AppTextFieldCustom> { class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
final FocusNode _focusNode = FocusNode();
bool focus = false;
bool view = false;
@override
void initState() {
super.initState();
_focusNode.addListener(() {
setState(() {
focus = _focusNode.hasFocus;
});
});
}
@override
void didUpdateWidget(AppTextFieldCustom oldWidget) {
if (widget.focus) _focusNode.requestFocus();
super.didUpdateWidget(oldWidget);
}
@override
void dispose() {
_focusNode.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -104,10 +132,11 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.height != 0 && widget.maxLines == 1 widget.height != 0 && widget.maxLines == 1
? widget.height - 22 ? widget.height - 22
: null, : null,
child: TextField( child: TextFormField(
textAlign: projectViewModel.isArabic textAlign: projectViewModel.isArabic
? TextAlign.right ? TextAlign.right
: TextAlign.left, : TextAlign.left,
focusNode: _focusNode,
decoration: TextFieldsUtils decoration: TextFieldsUtils
.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText, null, true),
@ -129,7 +158,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? widget.inputFormatters ? widget.inputFormatters
: [], : [],
onChanged: (value) { onChanged: (value) {
setState(() {}); // setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
widget.onChanged(value); widget.onChanged(value);
} }
@ -162,9 +191,10 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
), ),
if (widget.validationError != null) if (widget.validationError != null && widget.validationError.isNotEmpty)
TextFieldsError(error: widget.validationError), TextFieldsError(error: widget.validationError),
], ],
); );
} }
} }

@ -13,9 +13,9 @@ class CustomValidationError extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if(error == null ) if(error == null )
error = TranslationBase error = TranslationBase
.of(context) .of(context)
.emptyMessage; .emptyMessage;
return Column( return Column(
children: [ children: [
SizedBox( SizedBox(

Loading…
Cancel
Save