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();
}
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack{
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
implements AssessmentCallBack {
bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List();
@ -126,7 +127,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).assessment,
onTap: () {
@ -170,24 +173,23 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.4),
children: <TextSpan>[
new TextSpan(
text:
"ICD : ".toUpperCase(),
text: "ICD : ".toUpperCase(),
),
new TextSpan(
text: assessment
.selectedICD.code
.trim()
.toUpperCase() ??
""
),
""),
],
),
),
@ -199,7 +201,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
5,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
@ -208,8 +212,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
children: <TextSpan>[
new TextSpan(
text: assessment
.selectedICD
.description
.selectedICD.description
.toString(),
),
],
@ -219,7 +222,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
@ -230,18 +235,21 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
context)
.appointmentNo,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
new TextSpan(
text: assessment
.appointmentId
text: assessment.appointmentId
.toString() ??
"",
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
@ -252,11 +260,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
@ -278,7 +287,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
.selectedDiagnosisCondition
.nameEn,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
@ -289,11 +300,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
fontWeight: FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
@ -315,7 +327,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
.selectedDiagnosisType
.nameEn,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
@ -327,7 +341,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
@ -339,19 +355,23 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
.doctor +
' : ',
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,letterSpacing: -0.4,
color:
Color(0xFF575757),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
new TextSpan(
text: assessment
.doctorName ??
text:
assessment.doctorName ??
'',
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,letterSpacing: -0.48,
color:
Color(0xFF2B353E),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
),
],
@ -370,8 +390,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
height: 6,
),
AppText(
(assessment.remark !=
null &&
(assessment.remark != null &&
assessment.remark !=
'')
? TranslationBase.of(
@ -379,14 +398,14 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
.remarks +
" : "
: '',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
fontWeight: FontWeight.w600),
RemarkText(
remark:
assessment.remark ?? "",
remark: assessment.remark ?? "",
),
],
),
@ -403,8 +422,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
CrossAxisAlignment.end,
children: [
AppText(
assessment.createdOn !=
null
assessment.createdOn != null
? AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.parse(
@ -412,26 +430,25 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime
.now()),
fontWeight:
FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
AppText(
assessment.createdOn !=
null
assessment.createdOn != null
? AppDateUtils.getHour(
DateTime.parse(
assessment
.createdOn))
: AppDateUtils
.getHour(DateTime
.now()),
fontWeight:
FontWeight.w600,
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
],
),
@ -475,7 +492,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
),
),
),
),),
),
),
);
}
@ -508,9 +526,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
@override
nextFunction(model) {
if (mySelectedAssessmentList.isEmpty) {
Helpers.showErrorToast(
TranslationBase.of(context)
.assessmentErrorMsg);
Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(3);

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

@ -38,13 +38,16 @@ class UpdatePlanPage extends StatefulWidget {
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex, this.sOAPViewModel, this.changeStateFun});
this.currentIndex,
this.sOAPViewModel,
this.changeStateFun});
@override
_UpdatePlanPageState createState() => _UpdatePlanPageState();
}
class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack {
class _UpdatePlanPageState extends State<UpdatePlanPage>
implements PlanCallBack {
bool isAddProgress = true;
bool isProgressExpanded = true;
GetPatientProgressNoteResModel patientProgressNote =
@ -76,8 +79,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
}
}
getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async {
getPatientProgressNote(SOAPViewModel model,
{bool isAddProgress = false}) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
@ -86,7 +89,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
@ -124,7 +129,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
@ -161,7 +167,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo,
),
SizedBox(
height: 10,
),
@ -191,7 +199,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
inputType: TextInputType.multiline,
onChanged: (value) {
setState(() {
patientProgressNote.planNote = value;
patientProgressNote.planNote =
value;
model.progressNoteText = value;
widget.changeStateFun();
});
@ -222,7 +231,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
children: [
AppText(
'Appointment No: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757),
),
@ -237,7 +248,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
],
),
@ -253,7 +266,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
)
],
),
@ -286,7 +301,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
DateTime.now()),
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
)
],
),
@ -307,7 +324,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
onTap: () {
setState(() {
isAddProgress = true;
widget.sOAPViewModel.isAddProgress = true;
widget.sOAPViewModel
.isAddProgress = true;
});
},
child: Icon(
@ -333,8 +351,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
),
),
),
),)
);
),
));
}
submitPlan(SOAPViewModel model) async {
@ -350,18 +368,19 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
editedBy: '');
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel);
await widget.sOAPViewModel
.postProgressNote(postProgressNoteRequestModel);
} else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel);
await widget.sOAPViewModel
.patchProgressNote(postProgressNoteRequestModel);
}
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.sOAPViewModel.error);
} else {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
@ -370,7 +389,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
await widget.sOAPViewModel
.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
@ -407,9 +427,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
Navigator.of(context).pop();
}
} else {
Helpers.showErrorToast(
TranslationBase.of(context)
.progressNoteErrorMsg);
Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
}
}
}

@ -1,4 +1,5 @@
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/util/translations_delegate_base.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 {
const SOAPStepHeader({
Key key,
this.currentIndex, this.changePageViewIndex,
this.currentIndex, this.changePageViewIndex, this.patientInfo,
}) : super(key: key);
final int currentIndex;
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
@override
Widget build(BuildContext context) {
@ -39,6 +41,7 @@ class SOAPStepHeader extends StatelessWidget {
child: StepsWidget(
index: currentIndex,
changeCurrentTab: changePageViewIndex,
patientInfo: patientInfo,
),
),
SizedBox(

@ -1,5 +1,6 @@
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/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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -12,8 +13,9 @@ class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
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
Widget build(BuildContext context) {

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

Loading…
Cancel
Save