first step from change steper

merge-requests/787/head
Elham Rababh 5 years ago
parent 13be1c6a00
commit 80b976dff3

@ -45,7 +45,8 @@ class UpdateAssessmentPage extends StatefulWidget {
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
} }
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack{ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
implements AssessmentCallBack {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List(); List<MySelectedAssessment> mySelectedAssessmentList = List();
@ -112,184 +113,237 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex), changePageViewIndex: widget.changePageViewIndex,
ExpandableSOAPWidget( patientInfo: widget.patientInfo,
headerTitle: TranslationBase.of(context).assessment, ),
onTap: () { ExpandableSOAPWidget(
setState(() { headerTitle: TranslationBase.of(context).assessment,
isAssessmentExpand = !isAssessmentExpand; onTap: () {
}); setState(() {
}, isAssessmentExpand = !isAssessmentExpand;
child: Column(children: [ });
SizedBox( },
height: 20, child: Column(children: [
), SizedBox(
Column( height: 20,
children: [ ),
SOAPOpenItems( Column(
label: children: [
"${TranslationBase.of(context).addAssessment}", SOAPOpenItems(
onTap: () { label:
openAssessmentDialog(context, "${TranslationBase.of(context).addAssessment}",
isUpdate: false, model: model); onTap: () {
}, openAssessmentDialog(context,
), isUpdate: false, model: model);
SizedBox( },
height: 20, ),
), SizedBox(
Column( height: 20,
children: ),
mySelectedAssessmentList.map((assessment) { Column(
return Container( children:
margin: EdgeInsets.only( mySelectedAssessmentList.map((assessment) {
left: 5, right: 5, top: 15, bottom: 15), return Container(
child: Row( margin: EdgeInsets.only(
mainAxisAlignment: left: 5, right: 5, top: 15, bottom: 15),
MainAxisAlignment.spaceBetween, child: Row(
crossAxisAlignment: mainAxisAlignment:
CrossAxisAlignment.start, MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment:
Column( CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment:
RichText( CrossAxisAlignment.start,
text: new TextSpan( children: [
style: new TextStyle( RichText(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, text: new TextSpan(
color: Color(0xFF2E303A), style: new TextStyle(
fontFamily: 'Poppins', fontSize: SizeConfig
fontWeight: FontWeight.w600, .getTextMultiplierBasedOnWidth() *
letterSpacing: -0.4), 3.6,
children: <TextSpan>[ color: Color(0xFF2E303A),
new TextSpan( fontFamily: 'Poppins',
text: fontWeight: FontWeight.w600,
"ICD : ".toUpperCase(), letterSpacing: -0.4),
), children: <TextSpan>[
new TextSpan( new TextSpan(
text: "ICD : ".toUpperCase(),
),
new TextSpan(
text: assessment text: assessment
.selectedICD.code .selectedICD.code
.trim() .trim()
.toUpperCase() ?? .toUpperCase() ??
"" ""),
],
),
],
),
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.50,
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *5,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
children: <TextSpan>[
new TextSpan(
text: assessment
.selectedICD
.description
.toString(),
),
],
),
),
), ),
RichText( ),
Container(
width: MediaQuery.of(context)
.size
.width *
0.50,
child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.appointmentNo,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
new TextSpan( new TextSpan(
text: assessment text: assessment
.appointmentId .selectedICD.description
.toString() ?? .toString(),
"",
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
), ),
], ],
), ),
), ),
RichText( ),
text: new TextSpan( RichText(
style: new TextStyle( text: new TextSpan(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, style: new TextStyle(
color: Color(0xFF2E303A), fontSize: SizeConfig
fontFamily: 'Poppins', .getTextMultiplierBasedOnWidth() *
fontWeight: 3.5,
FontWeight.w600), color: Color(0xFF2E303A),
children: <TextSpan>[ fontFamily: 'Poppins',
new TextSpan( fontWeight: FontWeight.w600,
text: TranslationBase.of( ),
context) children: <TextSpan>[
.condition + new TextSpan(
" : ", text: TranslationBase.of(
style: new TextStyle( context)
letterSpacing: -0.4, .appointmentNo,
color: Color(0xFF575757), style: new TextStyle(
), fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757),
), ),
new TextSpan( ),
text: projectViewModel new TextSpan(
.isArabic text: assessment.appointmentId
? assessment .toString() ??
.selectedDiagnosisCondition "",
.nameAr style: new TextStyle(
: assessment fontSize: SizeConfig
.selectedDiagnosisCondition .getTextMultiplierBasedOnWidth() *
.nameEn, 3.6,
style: new TextStyle( letterSpacing: -0.48,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, color: Color(0xFF2B353E),
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
), ),
], ),
), ],
),
),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.condition +
" : ",
style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
new TextSpan(
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisCondition
.nameAr
: assessment
.selectedDiagnosisCondition
.nameEn,
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
),
],
), ),
),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.dType +
' : ',
style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
new TextSpan(
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisType
.nameAr
: assessment
.selectedDiagnosisType
.nameEn,
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
),
],
),
),
if (assessment.doctorName != null)
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight:
@ -298,24 +352,24 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.dType + .doctor +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
new TextSpan( new TextSpan(
text: projectViewModel text:
.isArabic assessment.doctorName ??
? assessment '',
.selectedDiagnosisType
.nameAr
: assessment
.selectedDiagnosisType
.nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
@ -323,159 +377,123 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
], ],
), ),
), ),
if (assessment.doctorName != null) SizedBox(
RichText( height: 6,
text: new TextSpan( ),
style: new TextStyle( Row(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, mainAxisAlignment:
color: Color(0xFF2E303A), MainAxisAlignment.start,
fontFamily: 'Poppins', crossAxisAlignment:
fontWeight: CrossAxisAlignment.start,
FontWeight.w600), children: [
children: <TextSpan>[ SizedBox(
new TextSpan( height: 6,
text: TranslationBase.of( ),
AppText(
(assessment.remark != null &&
assessment.remark !=
'')
? TranslationBase.of(
context) context)
.doctor + .remarks +
' : ', " : "
style: new TextStyle( : '',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,letterSpacing: -0.4, fontSize: SizeConfig
color: .getTextMultiplierBasedOnWidth() *
Color(0xFF575757), 3,
), color: Color(0xFF2E303A),
), fontFamily: 'Poppins',
new TextSpan( fontWeight: FontWeight.w600),
text: assessment RemarkText(
.doctorName ?? remark: assessment.remark ?? "",
'',
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,letterSpacing: -0.48,
color:
Color(0xFF2B353E),
),
),
],
),
), ),
SizedBox( ],
height: 6, ),
), ],
Row( ),
mainAxisAlignment: Column(
MainAxisAlignment.start, crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.start, children: [
children: [ Row(
SizedBox( children: [
height: 6, Column(
), crossAxisAlignment:
AppText( CrossAxisAlignment.end,
(assessment.remark != children: [
null && AppText(
assessment.remark != assessment.createdOn != null
'') ? AppDateUtils
? TranslationBase.of( .getDayMonthYearDateFormatted(
context) DateTime.parse(
.remarks + assessment
" : " .createdOn))
: '', : AppDateUtils
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, .getDayMonthYearDateFormatted(
color: Color(0xFF2E303A), DateTime.now()),
fontFamily: 'Poppins', fontWeight: FontWeight.w600,
fontWeight: fontSize: SizeConfig
FontWeight.w600), .getTextMultiplierBasedOnWidth() *
RemarkText( 3.6,
remark: ),
assessment.remark ?? "", AppText(
), assessment.createdOn != null
], ? AppDateUtils.getHour(
), DateTime.parse(
], assessment
), .createdOn))
Column( : AppDateUtils.getHour(
crossAxisAlignment: DateTime.now()),
CrossAxisAlignment.end, fontWeight: FontWeight.w600,
children: [ color: Color(0xFF575757),
Row( fontSize: SizeConfig
children: [ .getTextMultiplierBasedOnWidth() *
Column( 3.6,
crossAxisAlignment: ),
CrossAxisAlignment.end, ],
children: [
AppText(
assessment.createdOn !=
null
? AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.parse(
assessment
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime
.now()),
fontWeight:
FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
),
AppText(
assessment.createdOn !=
null
? AppDateUtils.getHour(
DateTime.parse(
assessment
.createdOn))
: AppDateUtils
.getHour(DateTime
.now()),
fontWeight:
FontWeight.w600,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
),
],
),
],
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
0.05,
),
InkWell(
onTap: () {
openAssessmentDialog(context,
isUpdate: true,
assessment: assessment,
model: model);
},
child: Icon(
DoctorApp.edit,
size: 18,
), ),
) ],
], ),
), SizedBox(
], height: MediaQuery.of(context)
), .size
); .height *
}).toList(), 0.05,
) ),
], InkWell(
) onTap: () {
]), openAssessmentDialog(context,
isExpanded: isAssessmentExpand, isUpdate: true,
), assessment: assessment,
SizedBox( model: model);
height: 130, },
), child: Icon(
], DoctorApp.edit,
), size: 18,
),
)
],
),
],
),
);
}).toList(),
)
],
)
]),
isExpanded: isAssessmentExpand,
),
SizedBox(
height: 130,
),
],
), ),
), ),
), ),
),), ),
),
),
); );
} }
@ -508,9 +526,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
@override @override
nextFunction(model) { nextFunction(model) {
if (mySelectedAssessmentList.isEmpty) { if (mySelectedAssessmentList.isEmpty) {
Helpers.showErrorToast( Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg);
TranslationBase.of(context)
.assessmentErrorMsg);
} else { } else {
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(3); widget.changePageViewIndex(3);

@ -111,7 +111,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex), changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: headerTitle:
TranslationBase.of(context).physicalSystemExamination, TranslationBase.of(context).physicalSystemExamination,

@ -29,7 +29,7 @@ class UpdatePlanPage extends StatefulWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final Function changeLoadingState; final Function changeLoadingState;
final Function changeStateFun; final Function changeStateFun;
final SOAPViewModel sOAPViewModel; final SOAPViewModel sOAPViewModel;
final int currentIndex; final int currentIndex;
@ -38,13 +38,16 @@ class UpdatePlanPage extends StatefulWidget {
this.changePageViewIndex, this.changePageViewIndex,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.currentIndex, this.sOAPViewModel, this.changeStateFun}); this.currentIndex,
this.sOAPViewModel,
this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
} }
class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack { class _UpdatePlanPageState extends State<UpdatePlanPage>
implements PlanCallBack {
bool isAddProgress = true; bool isAddProgress = true;
bool isProgressExpanded = true; bool isProgressExpanded = true;
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel patientProgressNote =
@ -76,17 +79,19 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
} }
} }
getPatientProgressNote(SOAPViewModel model,
getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async { {bool isAddProgress = false}) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel( GetGetProgressNoteReqModel(
appointmentNo: appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
///TODO set progressNote in model; ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
@ -103,238 +108,251 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
widget.sOAPViewModel.patientProgressNoteList[0].editedByName; widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = isAddProgress; isAddProgress = isAddProgress;
widget.sOAPViewModel.isAddProgress = isAddProgress; widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel.progressNoteText = progressNoteController.text; widget.sOAPViewModel.progressNoteText = progressNoteController.text;
}); });
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.sOAPViewModel.setPlanCallBack(this); widget.sOAPViewModel.setPlanCallBack(this);
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel( GetGetProgressNoteReqModel(
appointmentNo: appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = patientProgressNote.createdOn =
widget.sOAPViewModel.patientProgressNoteList[0].createdOn; widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = patientProgressNote.editedOn =
widget.sOAPViewModel.patientProgressNoteList[0].editedOn; widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = patientProgressNote.editedByName =
widget.sOAPViewModel.patientProgressNoteList[0].editedByName; widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = patientProgressNote.appointmentNo =
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel.progressNoteText = progressNoteController.text; widget.sOAPViewModel.progressNoteText = progressNoteController.text;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
widget.sOAPViewModel.isAddProgress = false; widget.sOAPViewModel.isAddProgress = false;
}); });
} }
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.90, widthFactor: 0.90,
child: Column( child: Column(
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex), changePageViewIndex: widget.changePageViewIndex,
SizedBox( patientInfo: widget.patientInfo,
height: 10, ),
), SizedBox(
ExpandableSOAPWidget( height: 10,
headerTitle: TranslationBase.of(context).progressNote, ),
onTap: () { ExpandableSOAPWidget(
setState(() { headerTitle: TranslationBase.of(context).progressNote,
isProgressExpanded = !isProgressExpanded; onTap: () {
}); setState(() {
}, isProgressExpanded = !isProgressExpanded;
child: Column( });
mainAxisAlignment: MainAxisAlignment.start, },
children: [ child: Column(
Column( mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (isAddProgress) Column(
Container( crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only( children: [
left: 10, right: 10, top: 15), if (isAddProgress)
child: AppTextFieldCustom( Container(
hintText: TranslationBase.of(context) margin: EdgeInsets.only(
.progressNote, left: 10, right: 10, top: 15),
controller: progressNoteController, child: AppTextFieldCustom(
minLines: 2, hintText: TranslationBase.of(context)
maxLines: 4, .progressNote,
inputType: TextInputType.multiline, controller: progressNoteController,
onChanged: (value) { minLines: 2,
setState(() { maxLines: 4,
patientProgressNote.planNote = value; inputType: TextInputType.multiline,
model.progressNoteText = value; onChanged: (value) {
widget.changeStateFun(); setState(() {
}); patientProgressNote.planNote =
}, value;
), model.progressNoteText = value;
), widget.changeStateFun();
SizedBox( });
height: 9, },
), ),
if (patientProgressNote.planNote != null && ),
!isAddProgress) SizedBox(
Container( height: 9,
margin: EdgeInsets.only(
left: 5,
right: 5,
), ),
child: Column( if (patientProgressNote.planNote != null &&
crossAxisAlignment: !isAddProgress)
CrossAxisAlignment.start, Container(
children: [ margin: EdgeInsets.only(
Row( left: 5,
mainAxisAlignment: right: 5,
MainAxisAlignment.spaceBetween, ),
child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( Row(
'Appointment No: ', children: [
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, AppText(
letterSpacing: -0.4, 'Appointment No: ',
color: Color(0xFF575757), fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757),
),
AppText(
patientProgressNote
.appointmentNo !=
null
? patientProgressNote
.appointmentNo
.toString()
: '',
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
],
), ),
AppText( AppText(
patientProgressNote patientProgressNote.createdOn !=
.appointmentNo !=
null null
? patientProgressNote ? AppDateUtils
.appointmentNo .getDayMonthYearDateFormatted(
.toString() DateTime.parse(
: '', patientProgressNote
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, fontSize: SizeConfig
color: Color(0xFF2B353E), .getTextMultiplierBasedOnWidth() *
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, 3.6,
), )
], ],
), ),
AppText( Row(
patientProgressNote.createdOn != mainAxisAlignment:
null MainAxisAlignment.end,
? AppDateUtils crossAxisAlignment:
.getDayMonthYearDateFormatted( CrossAxisAlignment.start,
children: [
// Row(
// children: [
// AppText(
// 'Condition: ',
// fontSize: 12,
// ),
// AppText(
// patientProgressNote.mName ??
// '',
// fontWeight: FontWeight.w600),
// ],
// ),
AppText(
patientProgressNote.createdOn !=
null
? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn))
: AppDateUtils : AppDateUtils.getHour(
.getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, color: Color(0xFF575757),
) fontSize: SizeConfig
], .getTextMultiplierBasedOnWidth() *
), 3.6,
Row( )
mainAxisAlignment: ],
MainAxisAlignment.end, ),
crossAxisAlignment: SizedBox(
CrossAxisAlignment.start, height: 8,
children: [ ),
// Row( Row(
// children: [ mainAxisAlignment:
// AppText( MainAxisAlignment.start,
// 'Condition: ', children: [
// fontSize: 12, Expanded(
// ), child: AppText(
// AppText( progressNoteController.text,
// patientProgressNote.mName ?? fontSize: 10,
// '', ),
// fontWeight: FontWeight.w600), ),
// ], InkWell(
// ), onTap: () {
AppText( setState(() {
patientProgressNote.createdOn != isAddProgress = true;
null widget.sOAPViewModel
? AppDateUtils.getHour( .isAddProgress = true;
DateTime.parse( });
patientProgressNote },
.createdOn)) child: Icon(
: AppDateUtils.getHour( DoctorApp.edit,
DateTime.now()), size: 18,
fontWeight: FontWeight.w600, ))
color: Color(0xFF575757), ],
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
progressNoteController.text,
fontSize: 10,
),
), ),
InkWell(
onTap: () {
setState(() {
isAddProgress = true;
widget.sOAPViewModel.isAddProgress = true;
});
},
child: Icon(
DoctorApp.edit,
size: 18,
))
], ],
), ),
], )
), ],
) ),
], ],
), ),
], isExpanded: isProgressExpanded,
), ),
isExpanded: isProgressExpanded, SizedBox(
), height: SizeConfig.heightMultiplier *
SizedBox( (SizeConfig.isHeightVeryShort ? 20 : 10),
height: SizeConfig.heightMultiplier * ),
(SizeConfig.isHeightVeryShort ? 20 : 10), ],
), ),
], ),
), ),
), ),
), ));
),)
);
} }
submitPlan(SOAPViewModel model) async { submitPlan(SOAPViewModel model) async {
@ -350,27 +368,29 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
editedBy: ''); editedBy: '');
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel
.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 widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel
.patchProgressNote(postProgressNoteRequestModel);
} }
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.sOAPViewModel.error); Helpers.showErrorToast(widget.sOAPViewModel.error);
} else { } else {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel( GetGetProgressNoteReqModel(
appointmentNo: appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()), int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote);
@ -407,9 +427,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
Helpers.showErrorToast( Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
TranslationBase.of(context)
.progressNoteErrorMsg);
} }
} }
} }

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.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_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -7,11 +8,12 @@ import 'package:flutter/material.dart';
class SOAPStepHeader extends StatelessWidget { class SOAPStepHeader extends StatelessWidget {
const SOAPStepHeader({ const SOAPStepHeader({
Key key, Key key,
this.currentIndex, this.changePageViewIndex, this.currentIndex, this.changePageViewIndex, this.patientInfo,
}) : super(key: key); }) : super(key: key);
final int currentIndex; final int currentIndex;
final Function changePageViewIndex; final Function changePageViewIndex;
final PatiantInformtion patientInfo;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -39,6 +41,7 @@ class SOAPStepHeader extends StatelessWidget {
child: StepsWidget( child: StepsWidget(
index: currentIndex, index: currentIndex,
changeCurrentTab: changePageViewIndex, changeCurrentTab: changePageViewIndex,
patientInfo: patientInfo,
), ),
), ),
SizedBox( SizedBox(

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -12,8 +13,9 @@ class StepsWidget extends StatelessWidget {
final int index; final int index;
final Function changeCurrentTab; final Function changeCurrentTab;
final double height; final double height;
final PatiantInformtion patientInfo;
StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0, this.patientInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -219,8 +219,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
? 0 ? 0
: int.parse(widget.patientInfo.admissionNo), : int.parse(widget.patientInfo.admissionNo),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
appointmentNo:widget.patientInfo.appointmentNo == null?0: appointmentNo: widget.patientInfo.appointmentNo == null
int.parse(widget.patientInfo.appointmentNo.toString()), ? 0
: int.parse(widget.patientInfo.appointmentNo.toString()),
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo,
doctorID: ''); doctorID: '');
@ -236,12 +237,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
'\n \n' '\n \n'
: model.patientChiefComplaintList[0].currentMedication; : model.patientChiefComplaintList[0].currentMedication;
} }
if(widget.patientInfo.appointmentNo != null) { if (widget.patientInfo.appointmentNo != null) {
await getHistory(model); await getHistory(model);
await getAllergies(model); await getAllergies(model);
} }
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -257,8 +257,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex), changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).chiefComplaints, headerTitle: TranslationBase.of(context).chiefComplaints,
onTap: () { onTap: () {
@ -271,9 +273,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
complaintsController: complaintsController, complaintsController: complaintsController,
illnessController: illnessController, illnessController: illnessController,
medicationController: medicationController, medicationController: medicationController,
complaintsControllerError: model.complaintsControllerError, complaintsControllerError:
model.complaintsControllerError,
illnessControllerError: model.illnessControllerError, illnessControllerError: model.illnessControllerError,
medicationControllerError: model.medicationControllerError, medicationControllerError:
model.medicationControllerError,
), ),
isExpanded: isChiefExpand, isExpanded: isChiefExpand,
), ),
@ -370,18 +374,21 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
} else { } else {
setState(() { setState(() {
if (complaintsController.text.isEmpty) { if (complaintsController.text.isEmpty) {
model.complaintsControllerError = TranslationBase.of(context).emptyMessage; model.complaintsControllerError =
TranslationBase.of(context).emptyMessage;
} else if (complaintsController.text.length < 25) { } else if (complaintsController.text.length < 25) {
model.complaintsControllerError = model.complaintsControllerError =
TranslationBase.of(context).chiefComplaintLength; TranslationBase.of(context).chiefComplaintLength;
} }
if (illnessController.text.isEmpty) { if (illnessController.text.isEmpty) {
model.illnessControllerError = TranslationBase.of(context).emptyMessage; model.illnessControllerError =
TranslationBase.of(context).emptyMessage;
} }
if (medicationController.text.isEmpty) { if (medicationController.text.isEmpty) {
model.medicationControllerError = TranslationBase.of(context).emptyMessage; model.medicationControllerError =
TranslationBase.of(context).emptyMessage;
} }
}); });

Loading…
Cancel
Save