From e65740761ae71dd50ff9032f4980777eed7b615e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sat, 2 Jan 2021 19:45:48 +0200 Subject: [PATCH] add improvement on create episode --- assets/images/create-episod.png | Bin 0 -> 651 bytes assets/images/modilfy-episode.png | Bin 0 -> 987 bytes lib/client/base_app_client.dart | 11 ++-- lib/screens/patients/patients_screen.dart | 52 +++++++++--------- .../profile/patient_profile_widget.dart | 3 +- .../profile/profile_medical_info_widget.dart | 9 ++- .../subjective/update_allergies_widget.dart | 12 +++- .../subjective/update_history_widget.dart | 9 ++- .../subjective/update_subjective_page.dart | 2 +- .../soap_update/update_assessment_page.dart | 21 ++++--- .../soap_update/update_objective_page.dart | 4 +- 11 files changed, 73 insertions(+), 50 deletions(-) create mode 100644 assets/images/create-episod.png create mode 100644 assets/images/modilfy-episode.png diff --git a/assets/images/create-episod.png b/assets/images/create-episod.png new file mode 100644 index 0000000000000000000000000000000000000000..02386fd1503c7628aa933022bf219d2fe5c4e6e4 GIT binary patch literal 651 zcmeAS@N?(olHy`uVBq!ia0vp^sz7YO!3HF!wQkl1QjEnx?oJHr&dIz4ax79KJkxxA z8MJ_G4hF{dOa>N^5+IfWVg?4L1x#=e)dkFOwgE^|n!)-wPzj@_i(^Ox=i7+afrlIf z+>ZZW!t6bP&x2D_QS}C6$pYC1*$a&6>=BG*32PYkw??O#?>s9jA!nbLKCRaN)6+>a z4WweHX>Iw>_?~IcjyD;*e`{^%i7|-yDe{HyxsJC>~f+<#Fb%3bi#TEJ=R_2i^JmL$)T z#^je7FLS?`cL>X`Y*SlbP}w6R!hZ1Mrw3jCtWpYi)!S=iZhPAWo9Z}qycB8Kk!Ikz zeLd6ZR;e4&A9!?LMoOi>$d3O!DM*|DD<7+-jb~=hoX{onZ>pto&fIKhUCJyP!y9qU zdv7%3`DXnE55#{=ox*W3$mB&#k;a@~Nwe-N{`6YlxNdSGGrN7QxkPUN8Sk4nUU;~9 zJx+|4)RdN%J?W8YlcTMin!H$9QnR-`H+4x)PKk>0(vKU~_Dt#R?Mqo=BDZbo#7!G7 zPTcL{Ro8RrzsH}atHR~4z52aB%ignY8^5*H+UO6P=jPqdkNW!{@>$HTTGbs=H7R=* cZVvj#u<`f>>$%*!Zh;bor>mdKI;Vst09o1y#sB~S literal 0 HcmV?d00001 diff --git a/assets/images/modilfy-episode.png b/assets/images/modilfy-episode.png new file mode 100644 index 0000000000000000000000000000000000000000..6fdd224f02e9bdca5090677c626d31f99b80e428 GIT binary patch literal 987 zcmV<110?*3P)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91D4+uX z1ONa40RR91D*ylh03MD$MgRZ@l!i!j`v?s z^G(8Ui0!L<@MoL54dNZR1pj~zUV~iv0Dc2$LNFv(Iv}nyL#dqV6Qy#yST$62k0xk} zXhGHEleAD*-%+cAE~F~;>oQkEI3eU3{s~{sOs|``L zsm*bP=lP6PkeLLvfjZA&4&y&=kpJq>ZSE+8r!aT4!MR>5jR}r~4})=3*cUBmYkq;=T?WP?h37Ds#*F<}{l9I~Db)!?Co%v4002ov JPDHLkV1grMxn=+W literal 0 HcmV?d00001 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ff9d957d..75894465 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -82,12 +82,11 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - // if (!parsed['IsAuthenticated']) { - // // TODO: return it back when IsAuthenticated work fine in all service - // // await helpers.logout(); - // - // helpers.showErrorToast('Your session expired Please login agian'); - // } else + if (!parsed['IsAuthenticated']) { + // TODO: return it back when IsAuthenticated work fine in all service + await helpers.logout(); + helpers.showErrorToast('Your session expired Please login agian'); + } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 74c9234c..33b2606c 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -274,34 +274,35 @@ class _PatientsScreenState extends State { .then((res) { setState(() { _isLoading = false; - // if (res['MessageStatus'] == 1) { - if (val2 == 7) { - print("Assad"); - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); + if (res['MessageStatus'] == 1) { + if (val2 == 7) { + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + var localList = []; + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient = { + ...v, + ...v["patientDetails"] + }; + localList.add(mergedPatient); + }); + print(localList.toString()); + lItems = localList; + } } else { - - var localList=[]; - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient= {...v,...v["patientDetails"]}; - localList.add(mergedPatient); - }); - print(localList.toString()); - lItems = localList;//res[SERVICES_PATIANT2[val2]]["entityList"]; + lItems = res[SERVICES_PATIANT2[val2]]; } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList2 = responseModelList; + _isError = false; } else { - lItems = res[SERVICES_PATIANT2[val2]]; + _isError = true; + error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList2 = responseModelList; - _isError = false; - // } else { - // _isError = true; - // error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; - // } }); }).catchError((error) { setState(() { @@ -679,7 +680,8 @@ class _PatientsScreenState extends State { .pushNamed( PATIENTS_PROFILE, arguments: { - "patient": item + "patient": item, + "patientType":patientType }); }, ), diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 792eb49e..f50c7669 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -22,6 +22,7 @@ class PatientProfileWidget extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; return Container( color: Color(0XFFF2F2F2), @@ -437,7 +438,7 @@ class PatientProfileWidget extends StatelessWidget { SliverPadding( padding: const EdgeInsets.all(16.0), sliver: ProfileMedicalInfoWidget( - patient: patient, + patient: patient, patientType:patientType )) ]), ); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 468a1b9d..886b2c9d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -18,8 +18,9 @@ import 'PatientProfileButton.dart'; *@desc: Profile Medical Info Widget */ class ProfileMedicalInfoWidget extends StatelessWidget { - ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); + ProfileMedicalInfoWidget({Key key, this.patient, this.patientType}); PatiantInformtion patient; + String patientType; @override Widget build(BuildContext context) { return SliverGrid.count( @@ -28,20 +29,22 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ + if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, nameLine1: "Create New", nameLine2: "Episode", route: CREATE_EPISODE, - icon: 'heartbeat.png'), + icon: 'create-episod.png'), + if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, nameLine1: "Update", nameLine2: "Episode", route: UPDATE_EPISODE, - icon: 'heartbeat.png'), + icon: 'modilfy-episode.png'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index fa6b8acb..f03025ae 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -70,13 +70,21 @@ class _UpdateAllergiesWidgetState extends State { children: widget.myAllergiesList.map((selectedAllergy) { return Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), - variant: "bodyText", bold: true, color: Colors.black), + Container( + + child: Expanded( + child: Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), + variant: "bodyText", bold: true, color: Colors.black), + ), + width: MediaQuery.of(context).size.width * 0.5, + ), Texts( selectedAllergy.selectedAllergySeverity.nameEn .toUpperCase(), diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index 5e033127..f720fdfd 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -81,8 +81,13 @@ class _UpdateHistoryWidgetState extends State Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(myHistory.nameEn, - variant: "bodyText", bold: true, color: Colors.black), + Container( + child: Expanded( + child: Texts(myHistory.nameEn, + variant: "bodyText", bold: true, color: Colors.black), + ), + width: MediaQuery.of(context).size.width * 0.7, + ), InkWell( child: Icon( FontAwesomeIcons.trash, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index d9828795..53007123 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -414,7 +414,7 @@ class _UpdateSubjectivePageState extends State { postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM .add(ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index c25b0d5b..86e98e4b 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -277,10 +277,13 @@ class _UpdateAssessmentPageState extends State { SizedBox( height: 6, ), - AppText( - widget.mySelectedAssessment.remark??"", - fontSize: 10, - color: Colors.grey, + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: AppText( + widget.mySelectedAssessment.remark??"", + fontSize: 10, + color: Colors.grey, + ), ), ], ), @@ -298,10 +301,12 @@ class _UpdateAssessmentPageState extends State { fontWeight: FontWeight.bold, fontSize: 16, ), - AppText( - widget.mySelectedAssessment.selectedICD.code.toUpperCase()??"", - fontSize: 10, - color: Colors.grey, + Container( + child: AppText( + widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"", + fontSize: 10, + color: Colors.grey, + ), ), ], ) diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 2a342542..2abdfbae 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -304,14 +304,14 @@ class _UpdateObjectivePageState extends State { ), Container( margin: EdgeInsets.only( - left: 10, right: 10, top: 15), + left: 0, right: 0, top: 15), child: TextFields( hintText: "Remarks", fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, maxLines: 25, - minLines: 13, + minLines: 4, controller: remarksController, validator: (value) { if (value == null)