diff --git a/assets/images/create-episod.png b/assets/images/create-episod.png new file mode 100644 index 00000000..02386fd1 Binary files /dev/null and b/assets/images/create-episod.png differ diff --git a/assets/images/modilfy-episode.png b/assets/images/modilfy-episode.png new file mode 100644 index 00000000..6fdd224f Binary files /dev/null and b/assets/images/modilfy-episode.png differ 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)