From 15774e5b05391c9b36251fe869e5775efc2ae88f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 18 Mar 2021 19:54:40 +0200 Subject: [PATCH 1/4] hussam --- .../medical-file/medical_file_details.dart | 1421 +++++++++-------- .../medical-file/medical_file_page.dart | 221 +-- .../prescription/prescription_screen.dart | 14 +- .../prescription_screen_history.dart | 2 + lib/screens/procedures/procedure_screen.dart | 7 +- .../profile/profile_medical_info_widget.dart | 3 +- 6 files changed, 852 insertions(+), 816 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index bab2cd2c..e93bab49 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -70,144 +70,174 @@ class _MedicalFileDetailsState extends State { body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - gender == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - firstName + ' ' + lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).age2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - age, - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], + child: Center( + child: Container( + color: Colors.white, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + gender == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - ], - ) - ], + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstName + ' ' + lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).age2, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 5.0, + ), + AppText( + age, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ) + ], + ), ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0 - ? Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).visitDate + - ": ", - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0 + ? Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).visitDate + + ": ", + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .appointmentDate + .toString()), + SizedBox(width: 35.0), + // AppText( + // 'Appt Date : ', + // fontWeight: FontWeight.w700, + // ), + // AppText( + // '23/12/2020', + // ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).doctorName + + ": ".toUpperCase(), + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + Expanded( + child: AppText( + model .medicalFileList[0] .entityList[0] .timelines[encounterNumber] .timeLineEvents[0] - .consulations - .length != - 0) - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .appointmentDate - .toString()), - SizedBox(width: 35.0), - // AppText( - // 'Appt Date : ', - // fontWeight: FontWeight.w700, - // ), - // AppText( - // '23/12/2020', - // ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).doctorName + - ": ".toUpperCase(), - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), + ), + ], + ), + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinicName + + ": ", + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model .medicalFileList[0] .entityList[0] .timelines[encounterNumber] .timeLineEvents[0] - .consulations - .length != - 0) - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, - ), - ), - ], - ), - if (model.medicalFileList.length != 0) + .consulations[0] + .clinicName, + ), + ], + ), Row( children: [ AppText( - TranslationBase.of(context).clinicName + + TranslationBase.of(context).episode + ": ", fontWeight: FontWeight.w700, ), @@ -227,111 +257,190 @@ class _MedicalFileDetailsState extends State { .timelines[encounterNumber] .timeLineEvents[0] .consulations[0] - .clinicName, + .episodeID + .toString(), ), ], ), - Row( - children: [ - AppText( - TranslationBase.of(context).episode + - ": ", - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .episodeID - .toString(), + SizedBox(height: 15.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ), + SizedBox(height: 25.0), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context) + .historyOfPresentIllness + .toUpperCase(), + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = + !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) + ], ), - ], - ), - SizedBox(height: 15.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ), - SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = - !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstCheifComplaint + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstCheifComplaint[ + index] + .hOPI + .trim(), + ), + ), + SizedBox(width: 35.0), + ], + ), + ], + ), + ), + ); + }), + isExpand: isHistoryExpand, ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( - children: [ - Expanded( - child: AppText( + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context) + .assessment + .toUpperCase(), + variant: isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + AppText( + 'ICD', + fontWeight: + FontWeight.w700, + ), + AppText( model .medicalFileList[ 0] @@ -340,140 +449,60 @@ class _MedicalFileDetailsState extends State { encounterNumber] .timeLineEvents[0] .consulations[0] - .lstCheifComplaint[ + .lstAssessments[ index] - .hOPI + .iCD10 .trim(), ), - ), - SizedBox(width: 35.0), - ], - ), - ], - ), - ), - ); - }), - isExpand: isHistoryExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context) - .assessment - .toUpperCase(), - variant: isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( - children: [ - AppText( - 'ICD', - fontWeight: - FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .iCD10 - .trim(), - ), - SizedBox(width: 35.0), - AppText( - 'Condition: ', - fontWeight: - FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .condition - .trim(), - ), - ], - ), - Row( - children: [ - AppText( - model + SizedBox(width: 35.0), + AppText( + 'Condition: ', + fontWeight: + FontWeight.w700, + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[ + index] + .condition + .trim(), + ), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[ + index] + .description, + fontWeight: + FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Type: ', + fontWeight: + FontWeight.w700, + ), + AppText(model .medicalFileList[0] .entityList[0] .timelines[ @@ -482,20 +511,14 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstAssessments[ index] - .description, - fontWeight: - FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Type: ', - fontWeight: - FontWeight.w700, - ), - AppText(model + .type), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( + model .medicalFileList[0] .entityList[0] .timelines[ @@ -503,139 +526,106 @@ class _MedicalFileDetailsState extends State { .timeLineEvents[0] .consulations[0] .lstAssessments[index] - .type), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .remarks - .trim(), - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], + .remarks + .trim(), + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), ), - ), - ); - }), - isExpand: isAssessmentExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = - !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], + ); + }), + isExpand: isAssessmentExpand, ), - bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( - children: [ - AppText( - 'Procedure ID: ', - fontWeight: - FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .procedureId - .trim(), - ), - SizedBox(width: 35.0), - AppText( - 'Order Date: ', - fontWeight: - FontWeight.w700, - ), - Expanded( - child: AppText( + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context) + .test + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + AppText( + 'Procedure ID: ', + fontWeight: + FontWeight.w700, + ), + AppText( model .medicalFileList[ 0] @@ -646,16 +636,187 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstProcedure[ index] - .orderDate + .procedureId .trim(), ), - ), - ], - ), - Row( - children: [ - Expanded( - child: AppText( + SizedBox(width: 35.0), + AppText( + 'Order Date: ', + fontWeight: + FontWeight.w700, + ), + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstProcedure[ + index] + .orderDate + .trim(), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstProcedure[ + index] + .procName, + fontWeight: + FontWeight.w700, + ), + ) + ], + ), + Row( + children: [ + AppText( + 'CPT Code : ', + fontWeight: + FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[index] + .patientID + .toString()), + ], + ), + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isProcedureExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context) + .physicalSystemExamination + .toUpperCase(), + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = + !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + 'Exam Type: ', + fontWeight: + FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[ + index] + .examDesc), + ], + ), + Row( + children: [ + AppText( model .medicalFileList[ 0] @@ -664,146 +825,22 @@ class _MedicalFileDetailsState extends State { encounterNumber] .timeLineEvents[0] .consulations[0] - .lstProcedure[ + .lstPhysicalExam[ index] - .procName, + .examDesc, + fontWeight: + FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', fontWeight: FontWeight.w700, ), - ) - ], - ), - Row( - children: [ - AppText( - 'CPT Code : ', - fontWeight: - FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .patientID - .toString()), - ], - ), - SizedBox( - height: 15.0, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isProcedureExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = - !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - 'Exam Type: ', - fontWeight: - FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .examDesc), - ], - ), - Row( - children: [ - AppText( - model + AppText(model .medicalFileList[0] .entityList[0] .timelines[ @@ -812,20 +849,14 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstPhysicalExam[ index] - .examDesc, - fontWeight: - FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: - FontWeight.w700, - ), - AppText(model + .abnormal), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( + model .medicalFileList[0] .entityList[0] .timelines[ @@ -834,52 +865,38 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstPhysicalExam[ index] - .abnormal), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[index] - .remarks, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), ), - ), - ); - }), - isExpand: isPhysicalExam, + ); + }), + isExpand: isPhysicalExam, + ), + SizedBox( + height: 30, ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ], + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], + ), ), - ), - ) - : Text("There's no medical file for this patient") - ], + ) + : Text("There's no medical file for this patient") + ], + ), ), ), ), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index d6552a01..2b817d8b 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -31,123 +31,128 @@ class _MedicalFilePageState extends State { body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( - child: Container( - child: Column( - // mainAxisAlignment: model.medicalFileList.length != 0 && - // model.medicalFileList != null - // ? MainAxisAlignment.start - // : MainAxisAlignment.center, - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.medicalFileList.length != 0 && - model.medicalFileList != null) - ? ListView.builder( - //physics: , - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0] - .timelines.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 8.0), - child: InkWell( - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .projectName), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .doctorName - .toUpperCase() + - ": ", - fontWeight: FontWeight.w700, - ), - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, + child: Center( + child: Container( + color: Colors.white, + child: Column( + // mainAxisAlignment: model.medicalFileList.length != 0 && + // model.medicalFileList != null + // ? MainAxisAlignment.start + // : MainAxisAlignment.center, + children: [ + PatientPageHeaderWidget(patient), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.medicalFileList.length != 0 && + model.medicalFileList != null) + ? ListView.builder( + //physics: , + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList[0] + .timelines.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 8.0), + child: InkWell( + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .branch + + ": ", fontWeight: FontWeight.w700, ), - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, - ), - AppText( - model + AppText(model .medicalFileList[0] .entityList[0] .timelines[index] - .clinicName, - ), - ], - ), - SizedBox(height: 10.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ) - ], + .projectName), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .doctorName + .toUpperCase() + + ": ", + fontWeight: FontWeight.w700, + ), + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinicName + + ": ", + fontWeight: FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName, + ), + ], + ), + SizedBox(height: 10.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ) + ], + ), ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MedicalFileDetails( + age: patient.age, + firstName: patient.firstName, + lastName: patient.lastName, + gender: + patient.genderDescription, + encounterNumber: index, + pp: patient.patientId, + )), + ); + }, ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MedicalFileDetails( - age: patient.age, - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, - encounterNumber: index, - pp: patient.patientId, - )), - ); - }, + ); + }) + : Center( + child: Container( + child: AppText( + 'THERES NO MEDICAL FILE FOR THIS Patient', ), - ); - }) - : Center( - child: Container( - child: AppText( - 'THERES NO MEDICAL FILE FOR THIS Patient', ), - ), - ) - ], + ) + ], + ), ), ), ), diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index f09c99bb..87202979 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -35,7 +35,7 @@ class _NewPrescriptionScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getPrescription(mrn: patient.patientMRN), + onModelReady: (model) => model.getPrescription(mrn: 0), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold( @@ -45,6 +45,7 @@ class _NewPrescriptionScreenState extends State { baseViewModel: model, child: SingleChildScrollView( child: Container( + color: Colors.white, child: Column( children: [ PatientPageHeaderWidget(patient), @@ -135,6 +136,7 @@ class _NewPrescriptionScreenState extends State { height: 50.0, width: 450.0, decoration: BoxDecoration( + color: Colors.white, border: Border.all( color: Colors.grey), borderRadius: @@ -174,12 +176,13 @@ class _NewPrescriptionScreenState extends State { }, ), SizedBox( - height: 15.0, + height: 10.0, ), ...List.generate( model.prescriptionList[0] .rowcount, (index) => Container( + color: Colors.white, child: Column( children: [ SizedBox( @@ -197,6 +200,7 @@ class _NewPrescriptionScreenState extends State { // CrossAxisAlignment.start, children: [ Container( + color: Colors.white, height: MediaQuery.of( context) .size @@ -260,6 +264,7 @@ class _NewPrescriptionScreenState extends State { ), ), Container( + color: Colors.white, // height: MediaQuery.of( // context) // .size @@ -324,6 +329,8 @@ class _NewPrescriptionScreenState extends State { Row( children: [ Container( + color: Colors + .white, child: Expanded( child: @@ -533,6 +540,8 @@ class _NewPrescriptionScreenState extends State { Expanded( child: Container( + color: Colors + .white, // height: MediaQuery.of(context).size.height * // 0.038, child: @@ -567,6 +576,7 @@ class _NewPrescriptionScreenState extends State { ), ), Container( + color: Colors.white, height: MediaQuery.of( context) .size diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart index eb20b83e..940cfc2a 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -47,6 +47,7 @@ class _NewPrescriptionHistoryScreenState baseViewModel: model, child: SingleChildScrollView( child: Container( + color: Colors.white, child: Column( children: [ PatientPageHeaderWidget(patient), @@ -83,6 +84,7 @@ class _NewPrescriptionHistoryScreenState model.prescriptionList[0] .rowcount, (index) => Container( + color: Colors.white, child: Column( children: [ SizedBox( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index c7da891e..a03e1348 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -34,7 +34,7 @@ class _ProcedureScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getProcedure(mrn: patient.patientMRN), + onModelReady: (model) => model.getProcedure(mrn: 0), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, @@ -43,6 +43,7 @@ class _ProcedureScreenState extends State { baseViewModel: model, child: SingleChildScrollView( child: Container( + color: Colors.white, child: Column( children: [ PatientPageHeaderWidget(patient), @@ -130,6 +131,7 @@ class _ProcedureScreenState extends State { height: 50.0, width: 450.0, decoration: BoxDecoration( + color: Colors.white, border: Border.all( color: Colors.grey), borderRadius: @@ -189,11 +191,12 @@ class _ProcedureScreenState extends State { // ), // ), SizedBox( - height: 35.0, + height: 10.0, ), ...List.generate( model.procedureList[0].rowcount, (index) => Container( + color: Colors.white, child: Column( children: [ SizedBox( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 3c67cb6a..ee500957 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -17,7 +17,6 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { - String from; String to; PatiantInformtion patient; @@ -132,7 +131,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION, + route: ORDER_PRESCRIPTION_HISTORY, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png') From cf7d494944daaefd7b710c5b4facc8e2eec7d3f8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 21 Mar 2021 10:05:19 +0300 Subject: [PATCH 2/4] search pages and dashboard updated --- assets/fonts/DoctorApp.ttf | Bin 18544 -> 18876 bytes assets/images/filter-512.png | Bin 0 -> 2535 bytes lib/config/localized_values.dart | 4 +- lib/icons_app/config.json | 12 + lib/icons_app/doctor_app_icons.dart | 8 + .../medicine/medicine_search_screen.dart | 208 +++-- .../search_medicine_patient_screen.dart | 85 +- .../patients/patient_search_screen.dart | 735 ++++++++++-------- lib/screens/patients/patients_screen.dart | 154 +++- lib/util/translations_delegate_base.dart | 3 + lib/widgets/patients/PatientCard.dart | 442 ++++++----- lib/widgets/patients/dynamic_elements.dart | 120 +-- 12 files changed, 1009 insertions(+), 762 deletions(-) create mode 100644 assets/images/filter-512.png diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index dbf930ff8f68bef59e692cbe5cd54eeb397e0e09..0cf366461d3c2dc51d32a17f393b98f4e88cb659 100644 GIT binary patch delta 906 zcmXw#OH30{6o${eEdvMv6qtbmWtbLd1PYYW%Bz5Z%ClfXNYkKYEQLZ^DAE|jM2sN> z1BvKt3@Z~O8`$B_#)S(Xi7O)k5*994+^|9uj2o?II&yEmIgk0zBlm2R#1*n>TIK-A z1^|o(B674Qu(Jz5!vMOCsqp>DvH95<0ImbTwH6A>6UOkg4Yl79M+g(?J1M8=#}RWV z5?fq-gr{_(;l&J(vdS$7BHG@xo0k6I@w zMlw$f$|l*(q(5*5OPted07?gSb{-}r0AE3u^s3Qb!n#Ay!!{P@K@Mj0EQb}bQYNu- z=3u?7pA9Aw01Q~J5~rqIf;u~Nfg5j+c9mbWJ5_`-?8Uw6)R8OLEE56pM*ZS3?G5V% zvRsIL5a7`oG}PB%MH+z5#EcrCYD+ah)k+$mYRwu@jJ8|@O3*qqK<&}10cwwajVut+ z8PtF>)lvOS|@r+}o;UeA>hb{Yei%f*OF!b{7?F zg3}~fiKB(scp*P8i&QupQ+c$Nn04myPMgDCQ7Lg&Pq_J}d#Y9tsX70%AQGusBB3hJ z>ab_kv+iqa_xajgUXtDt9;hQ%L!wm_1(cz8qmyk3E4ce(1l%QtY=ho9PgrxfN*h(vgQF`Z3(7 zpy72ck(77t4n2{GY45L_l2R@rhl4e?tc9R_HxTki<=Av^HkLLSOy=vA>>l|arbpBI delta 569 zcmXw$&ubG=5XZl7H(gpAnnI{aw{5yM&8aR diff --git a/assets/images/filter-512.png b/assets/images/filter-512.png new file mode 100644 index 0000000000000000000000000000000000000000..ce2f89b81036ea9d0b8673a93a00ca70fea2def4 GIT binary patch literal 2535 zcmd5;c{J1u8=gfocCv)=(O6QJp<<*-vNtnVWb6@hvt+%-Iv8IKU7{LBmMct?OqeWV zOSbq~CT>L;W4*H8a$V~bA>niX|Gxjf_q@;hoOe0zIqx~|A5Z#K`^yrd2vHCSB!R

>R?P4DRs_0 zjc+@So?3FKlux<@T|&EN@Kv|K%2{UP*Q&iaNU@|lkq*chzB(l2!uN}PQ@|EgUQ~2j zxrQ|(Aas;MmX4X;Qmc_7;j(Sol;ZAfe8T@}!kFS*<@sGXGN9J3&lLJB`8>ZlC*@DQ z8`Cead-<@UpFB)rm7^V74R$l1+VpqR%j1WrU(-3=C#ly{T_&sF?so@9ETEL>{9hM= zm+732Uh1e+Yu`Cgrh?oKN<3XF9J2^5`Kx93+nF62TsPYLy{l?BG{xr4XCg3WKI zYMgTMO#hPve2I;Z`FJl^hGkG?px!>93XZKLEJiM4@gWV{VuBVKZa+w0tG!(n7F$jT zdR>8K(M=XG*~w&V3Lv`W&@!!P0nf@kdE$ zLChC7;#ZwqN#HYU$?EBy12p?*gj5A&RNCkGZLo0_VG$H&i*Roc8Koo21{)DU8ZZB9 zX;K(t;h$NppXJ2>g8@JC_~x`y^!A$M-K=?4;{4&V!Pl%L+rmf{b`}B^0vVO{fs?`Y zA#&HcLwVGa{^rO0tF+V?)SaG%0|x-+qEi)U#RE#N6gUJ|wybagTF=5>ChMbAFHesE zecIoW#V5uLVSxUggcgAL0-x*7yd|kbXYHb#7ea;Bxyc*pBTn|YN(ED~JxYmu(xHj(Jv^M^M zwlP3K8N=h~anlA|hGB(AdP7W5be$>-N_p8h)|j*M>W7o~t z-&V7{t#@NpQ%mYg!3#3X<&#MtpF2-TQs@cNE2E~w;9UH0J{vfnlj8SFE`BLNc3nh}RB}o(On2CK0v;cJj;{exO|V}iX~!n8VF98fgutdoI_{@j{N0dn;!#0+BDDKV zT`8zc#z*`<^`#3t+GNV!!=yc9Rxw@{a7#D1#|6w>bW|$I^w-B$x_`sH8dA&$wOc1f zm`W_WJ>zwbF^x+9+IHw9Jz$8;_`R|GGN6-dyaamF6(N)A8+rwFQpQK`JqYf~ZctiN zr>SA4-us%oo)TI=e>l3TlWRXfp`PgJ-SH5=oA(H0W|b(=14}-43}jAS_AoJ{&3-t@ z2iZT-(}a(nYWM(8%M8*cB{I$q%QK&bTBs1p-qEE9#(DF9=di2K=hdZb7GwMaRPf`9 zW{zccF~etaP&M6u=QMjAFRuKSIjrq;oowVUwvvYNH|x#H8BTO&oJH$oJPGYoxn5=m zGAm$*#P`m|yy2H??`40Qmk(b4!u%Bheioi^cju3t@~(-A?c!uxK&?k%R-HH^9b9l_ zyxApe-~F1#3~_E6e>+Zi)B50tC#3DR@a6+KgIn5USWq!a!ZcQKYcFHcEM9vtI@=KL z^|tQ}a_@X$w7#pR<_i>f>Zge&%M@|!!DsNxVSRNXc)fqZCOQ}Vs7SvpIlB1u$XO&I z6`XZeJT2#EbCx(%-Ct2!yPJwtf?2;g{r}a%ZdJLrQXK=#TS8Q3jArsDQXbR=y%4)v zs|3sfCzD)sM$di`$CB+pyAU5xfWnW-xy~FzRdMXOcVK&P?CSi@@W7_L+Bph6)>Fy^ z+LW>1B`{j&+Ug<<+mjoH#AmQG?!-@K%z4KdB=MFN8pr(wmKTsAE6NOqj2&;P=>7UR z<0jQ9>BX)}4nIc=TBkyC$y`{9@q&e-o7HgrLF!1uqHJp^u+7>g>`pu@`9R8!%9rLGwo-Oy5|b6NFaql&S!ywi4CNCjx2 zREJ+s+;@>a6flY4;=7HRai>*5lH3rIk*)f4h5^hT=E`v{aqc%}flPf&^o5M8Tp4`G zE+lh(k~k@}>|K8f-7Py^P^(h|Uu>Ws0diSRyc7RJ`e@=3@(w`dMO_9m@yT6>N)3dw LvA3?aBqsj{{mhc( literal 0 HcmV?d00001 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 01d0a58e..356c321d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -57,7 +57,7 @@ const Map> localizedValues = { 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'}, 'lastName': {'en': 'Last Name', 'ar': 'اسم العائلة'}, - 'phoneNumber': {'en': 'Phone Number ', 'ar': 'رقم الجوال'}, + 'phoneNumber': {'en': "Patient's Phone Number ", 'ar': 'رقم الجوال'}, 'patientID': {'en': 'Patient ID', 'ar': 'رقم المريض'}, 'patientFile': {'en': 'Patient File', 'ar': 'ملف المريض'}, 'familyMedicine': {'en': 'Family Medicine Clinic', 'ar': 'عيادة طب الأسرة'}, @@ -746,4 +746,6 @@ const Map> localizedValues = { 'en': "Search patient or Medicines", 'ar': "مریض یا دوائیں تلاش کریں" }, + 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, + 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, }; diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index 0b02017e..ee0723f4 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -468,6 +468,18 @@ "arrival-patients" ] }, + { + "uid": "23c2239369a69f752e790de95123b9e9", + "css": "male-2", + "code": 59417, + "src": "mfglabs" + }, + { + "uid": "10b2be8b48bebc1974d6f94bac9de71d", + "css": "female-1", + "code": 59419, + "src": "mfglabs" + }, { "uid": "740f78c2b53c8cc100a8b0d283bbd34f", "css": "home_icon-1", diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 902de116..1ed8d895 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -12,6 +12,10 @@ /// - asset: fonts/DoctorApp.ttf /// /// +/// * MFG Labs, Copyright (C) 2012 by Daniel Bruce +/// Author: MFG Labs +/// License: SIL (http://scripts.sil.org/OFL) +/// Homepage: http://www.mfglabs.com/ /// import 'package:flutter/widgets.dart'; @@ -67,8 +71,12 @@ class DoctorApp { IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData referral = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male_2 = + IconData(0xe819, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData search_patient = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female_1 = + IconData(0xe81b, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData medicine_search = diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 187d1b9a..ea891f3e 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -128,129 +128,111 @@ class _MedicineSearchState extends State { child: FractionallySizedBox( widthFactor: 0.97, child: SingleChildScrollView( + child: Container( + // height: SizeConfig.screenHeight, child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ SizedBox( - height: 50, + height: SizeConfig.screenHeight * .16, ), - Column( - children: [ - Container( - child: Icon( - DoctorApp.medicine_search, - size: 100, - color: Colors.black, - ), - margin: EdgeInsets.only(top: 50), - ), - Padding( - padding: const EdgeInsets.only(top: 12.0), - child: AppText( - TranslationBase.of(context).type.toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: SizeConfig.heightMultiplier * 2.5, - ), + Column(children: [ + FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + // height: MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication.genericName + : null, + true, + icon: EvaIcons.search), + itemSubmitted: (item) => setState( + () => _selectedMedication = item), + key: key, + suggestions: model.allMedicationList, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts( + suggestion.description + + '/' + + suggestion.genericName), + padding: EdgeInsets.all(10.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith(input.toLowerCase()), + ) + : TextField( + minLines: 2, + maxLines: 2, + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : null, + true, + icon: EvaIcons.search), + enabled: false, + ), + ), + ), + ], ), - Padding( - padding: const EdgeInsets.only(top: 5.0), - child: AppText( - TranslationBase.of(context) - .searchMedicineImageCaption, - fontSize: SizeConfig.heightMultiplier * 2, - ), - ) - ], - ), + ) + ]), SizedBox( - height: 15, + height: SizeConfig.screenHeight * .5, ), - FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.genericName - : null, - true, - icon: EvaIcons.search), - itemSubmitted: (item) => setState( - () => _selectedMedication = item), - key: key, - suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - suggestion.description + - '/' + - suggestion.genericName), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith(input.toLowerCase()), - ) - : TextField( - minLines: 2, - maxLines: 2, - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.description + - (' (${_selectedMedication.genericName} )') - : null, - true, - icon: EvaIcons.search), - enabled: false, - ), - ), - ), - SizedBox( - height: 15, - ), - Container( - child: Wrap( - alignment: WrapAlignment.center, - children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of(context).search, - onPressed: () async { - await searchMedicine(context, model); - }, - ), - ], - ), + Column( + children: [ + FractionallySizedBox( + widthFactor: 0.97, + child: Wrap( + alignment: WrapAlignment.center, + children: [ + // TODO change it secondary button and add loading + AppButton( + title: TranslationBase.of(context).search, + onPressed: () async { + await searchMedicine(context, model); + }, + ), + ], ), - ], - ), - ), + ) + ], + ) ], ), - ), + )), ), ), ), diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart index 39c0deae..d16bfc2c 100644 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -24,7 +24,7 @@ class SearchMedicinePatientScreen extends StatefulWidget { class _SearchMedicinePatientScreen extends State with SingleTickerProviderStateMixin { TabController _tabController; - + var activeIndex = 0; @override void initState() { super.initState(); @@ -50,42 +50,63 @@ class _SearchMedicinePatientScreen extends State child: Center( child: Container( height: 60.0, + color: Colors.white, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: AppText( - TranslationBase.of(context).searchPatient), + width: MediaQuery.of(context).size.width, // 0.9, + // decoration: BoxDecoration( + // border: Border( + // bottom: BorderSide( + // color: Theme.of(context).dividerColor, + // width: 0.9), //width: 0.7 + // ), + // color: Colors.white), + child: TabBar( + isScrollable: true, + onTap: (index) { + setState(() { + activeIndex = index; + }); + }, + controller: _tabController, + indicatorWeight: 0.01, + indicatorSize: TabBarIndicatorSize.label, + labelColor: Theme.of(context).primaryColor, + indicatorColor: Colors.grey[800], + // labelPadding: + // EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.40, + decoration: BoxDecoration( + color: activeIndex == 0 + ? Colors.red[700] + : Colors.grey[200], + borderRadius: BorderRadius.circular(5)), + child: Center( + child: AppText( + TranslationBase.of(context).searchPatient, + color: activeIndex == 0 ? Colors.white : Colors.black, + fontWeight: FontWeight.bold, ), ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: AppText( - TranslationBase.of(context).searchMedicine), + ), + Container( + width: MediaQuery.of(context).size.width * 0.40, + decoration: BoxDecoration( + color: activeIndex == 1 + ? Colors.red[700] + : Colors.grey[200], + borderRadius: BorderRadius.circular(5)), + child: Center( + child: AppText( + TranslationBase.of(context).searchMedicine, + fontWeight: FontWeight.bold, + color: activeIndex == 1 ? Colors.white : Colors.black, ), ), - ], - ), + ), + ], ), ), ), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 6e43657b..21eb3614 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -43,7 +43,7 @@ class _PatientSearchScreenState extends State { final GlobalKey _formKey = GlobalKey(); bool _autoValidate = false; bool onlyArrived = true; - + bool isView = false; bool isFormSubmitted = false; FocusNode _nodeText1 = FocusNode(); @@ -120,324 +120,293 @@ class _PatientSearchScreenState extends State { FocusScope.of(context).requestFocus(new FocusNode()); }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).searchPatient, - isShowAppBar: false, - body: ListView( - children: [ - RoundedContainer( - child: Column( - children: [ - Column( - children: [ - Container( - child: Icon( - DoctorApp.search_patient_1, - size: 100, - color: Colors.black, - ), - margin: EdgeInsets.only(top: 10), - ), - Padding( - padding: const EdgeInsets.only(top: 12.0), - child: AppText( - TranslationBase.of(context) - .searchPatientImageCaptionTitle - .toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: SizeConfig.heightMultiplier * 2.5, - ), - ), - Padding( - padding: const EdgeInsets.only(top: 5.0), - child: AppText( - TranslationBase.of(context) - .searchPatientImageCaptionBody, - fontSize: SizeConfig.heightMultiplier * 2, + appBarTitle: TranslationBase.of(context).searchPatient, + isShowAppBar: false, + body: ListView( + children: [ + RoundedContainer( + child: Column( + children: [ + Column( + children: [ + // Container( + // child: Icon( + // DoctorApp.search_patient_1, + // size: 100, + // color: Colors.black, + // ), + // margin: EdgeInsets.only(top: 10), + // ), + // Padding( + // padding: const EdgeInsets.only(top: 12.0), + // child: AppText( + // TranslationBase.of(context) + // .searchPatientImageCaptionTitle + // .toUpperCase(), + // fontWeight: FontWeight.bold, + // fontSize: SizeConfig.heightMultiplier * 2.5, + // ), + // ), + // Padding( + // padding: const EdgeInsets.only(top: 5.0), + // child: AppText( + // TranslationBase.of(context) + // .searchPatientImageCaptionBody, + // fontSize: SizeConfig.heightMultiplier * 2, + // ), + // ) + ], + ), + Container( + padding: EdgeInsets.all(15), + width: SizeConfig.screenWidth * 1, + child: Form( + key: _formKey, + autovalidate: _autoValidate, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 15, ), - ) - ], - ), - Container( - padding: EdgeInsets.all(15), - width: SizeConfig.screenWidth * 1, - child: Form( - key: _formKey, - autovalidate: _autoValidate, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - Container( - height: 40.0, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1.0, - style: BorderStyle.solid, - color: HexColor("#CCCCCC")), - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - ), - ), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: _selectedType, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return PATIENT_TYPE.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - !projectsProvider.isArabic - ? AppText( - item['text'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ) - : AppText( - item['text_ar'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (String newValue) => { - setState(() { - _selectedType = newValue; - selectedPatientType = - int.parse(_selectedType); - }) - }, - items: PATIENT_TYPE.map((item) { - !projectsProvider.isArabic - ? itemText = item['text'] - : itemText = item['text_ar']; - return DropdownMenuItem( - child: Text( - itemText, - textAlign: TextAlign.end, - ), - value: item['val'], - ); - }).toList(), - )), - ), - ], - ), - ), - ), - SizedBox( - height: 10, - ), + if (_selectedType != '7') Container( decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.only(top: 5), - child: AppTextFormField( - labelText: - TranslationBase.of(context).firstName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setFirstName = "0" - : _patientSearchFormValues - .setFirstName = value; - - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues.setFirstName = - "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.only(top: 5), - child: AppTextFormField( - labelText: - TranslationBase.of(context).middleName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setMiddleName = "0" - : _patientSearchFormValues - .setMiddleName = value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues.setMiddleName = - "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.only(top: 5), - child: AppTextFormField( - labelText: - TranslationBase.of(context).lastName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues.setLastName = - "0" - : _patientSearchFormValues.setLastName = - value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues.setLastName = - "0"; - } - }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - if (_selectedType != '7') - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.only(top: 5), - child: AppTextFormField( - labelText: - TranslationBase.of(context).phoneNumber, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientMobileNumber = "0" - : _patientSearchFormValues - .setPatientMobileNumber = value; - - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setPatientMobileNumber = "0"; - } - }, - ), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.only(top: 5), - child: AppTextFormField( - labelText: - TranslationBase.of(context).patientID, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText2, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientID = 0 - : _patientSearchFormValues - .setPatientID = int.parse(value); - if (value != null && - value.trim().toString().isEmpty) { - _patientSearchFormValues.setPatientID = 0; - } - }), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.only(top: 5), + padding: EdgeInsets.all(10), child: AppTextFormField( labelText: - TranslationBase.of(context).patientFile, + TranslationBase.of(context).phoneNumber, borderColor: Colors.white, textInputType: TextInputType.number, - focusNode: _nodeText3, + textInputAction: TextInputAction.done, inputFormatter: ONLY_NUMBERS, - onSaved: (value) {}, + focusNode: _nodeText1, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientMobileNumber = "0" + : _patientSearchFormValues + .setPatientMobileNumber = value; + + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues + .setPatientMobileNumber = "0"; + } + }, ), ), - (!(_selectedType == '2' || _selectedType == '4')) - ? DynamicElements( - _patientSearchFormValues, isFormSubmitted) - : SizedBox( - height: 0, + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + InkWell( + child: this.isView == false + ? AppText( + 'Search With Other Critearia', + color: Colors.red, + fontWeight: FontWeight.bold, + ) + : AppText('Hide Other Criteria', + color: Colors.red, + fontWeight: FontWeight.bold), + onTap: () { + setState(() { + this.isView = !this.isView; + }); + }, + ) + ], + ), + isView == true + ? Column(children: [ + SizedBox( + height: 10, + ), + Container( + height: 65.0, + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1.0, + style: BorderStyle.solid, + color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + ), + ), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedType, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return PATIENT_TYPE.map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + !projectsProvider.isArabic + ? AppText( + item['text'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ) + : AppText( + item['text_ar'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (String newValue) => { + setState(() { + _selectedType = newValue; + selectedPatientType = + int.parse(_selectedType); + }) + }, + items: PATIENT_TYPE.map((item) { + !projectsProvider.isArabic + ? itemText = item['text'] + : itemText = + item['text_ar']; + return DropdownMenuItem( + child: Text( + itemText, + textAlign: TextAlign.end, + ), + value: item['val'], + ); + }).toList(), + )), + ), + ], + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .firstName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setFirstName = "0" + : _patientSearchFormValues + .setFirstName = value; + + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues + .setFirstName = "0"; + } + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), + ), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .middleName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setMiddleName = "0" + : _patientSearchFormValues + .setMiddleName = value; + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues + .setMiddleName = "0"; + } + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), + ), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .lastName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setLastName = "0" + : _patientSearchFormValues + .setLastName = value; + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues + .setLastName = "0"; + } + }, + inputFormatter: ONLY_LETTERS), + ), + SizedBox( + height: 10, ), - SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -445,52 +414,132 @@ class _PatientSearchScreenState extends State { border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), - height: 25, - width: 25, - child: Checkbox( - value: onlyArrived, - checkColor: HexColor("#2A930A"), - activeColor: Colors.white, - onChanged: (bool newValue) { - setState(() { - onlyArrived = newValue; - }); + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .patientID, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText2, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientID = 0 + : _patientSearchFormValues + .setPatientID = + int.parse(value); + if (value != null && + value.trim().toString().isEmpty) { + _patientSearchFormValues + .setPatientID = 0; + } }), ), SizedBox( - width: 12, + height: 10, ), - AppText( - TranslationBase.of(context) - .onlyArrivedPatient, - fontSize: SizeConfig.textMultiplier * 2), - ])), - SizedBox( - height: 10, - ), - ], - ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .patientFile, + borderColor: Colors.white, + textInputType: TextInputType.number, + focusNode: _nodeText3, + inputFormatter: ONLY_NUMBERS, + onSaved: (value) {}, + ), + ), + (!(_selectedType == '2' || + _selectedType == '4')) + ? DynamicElements( + _patientSearchFormValues, + isFormSubmitted) + : SizedBox( + height: 0, + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 10, + ), + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + height: 25, + width: 25, + child: Checkbox( + value: onlyArrived, + checkColor: HexColor("#2A930A"), + activeColor: Colors.white, + onChanged: (bool newValue) { + setState(() { + onlyArrived = newValue; + }); + }), + ), + SizedBox( + width: 12, + ), + AppText( + TranslationBase.of(context) + .onlyArrivedPatient, + fontSize: + SizeConfig.textMultiplier * 2), + ])), + SizedBox( + height: 10, + ), + ]) + : SizedBox( + height: SizeConfig.screenHeight * .4, + ), + ], ), - ) - ], - ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).search, - onPressed: () { - _validateInputs(); - }, ), - ], - ), + ), + ], ), - ], - )), + ), + Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).search, + onPressed: () { + _validateInputs(); + }, + ), + ], + ), + ), + ], + ), + ], + ), + ), ); } } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 8244cea2..86f3bd0b 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -11,6 +11,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; @@ -55,7 +57,7 @@ class _PatientsScreenState extends State { String patientType; String patientTypeTitle; var _isLoading = true; - + var selectedFilter = 1; bool _isError = false; String error = ""; ProjectViewModel projectsProvider; @@ -292,6 +294,7 @@ class _PatientsScreenState extends State { error: TranslationBase.of(context).youDontHaveAnyPatient) : Container( + color: Colors.grey[200], child: ListView( scrollDirection: Axis.vertical, children: [ @@ -314,23 +317,11 @@ class _PatientsScreenState extends State { ) : Column( children: [ - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), - child: SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient" - ? _locationBar(context) - : Container(), - ), SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, height: - SizeConfig.screenHeight * 0.05, + SizeConfig.screenHeight * 0.07, child: TextField( controller: _controller, onChanged: (String str) { @@ -345,17 +336,100 @@ class _PatientsScreenState extends State { SizedBox( height: 10.0, ), - Divider( - thickness: 0.8, - color: Color(0xffCCCCCC), + Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context) + .size + .height * + 0.03), + child: SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient" + ? _locationBar(context) + : Container(), + ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceEvenly, + // children: [ + // AppButton( + // title: TranslationBase.of(context) + // .all, + // onPressed: () { + // setState(() { + // selectedFilter = 1; + // filterPatients(); + // }); + // }, + // color: selectedFilter == 1 + // ? Colors.red[800] + // : Colors.grey[300], + // fontColor: selectedFilter == 1 + // ? Colors.white + // : Colors.black, + // ), + // AppButton( + // title: TranslationBase.of(context) + // .today, + // onPressed: () { + // setState(() { + // selectedFilter = 2; + // filterPatients(); + // }); + // }, + // color: selectedFilter == 2 + // ? Colors.red[800] + // : Colors.grey[300], + // fontColor: selectedFilter == 2 + // ? Colors.white + // : Colors.black, + // ), + // AppButton( + // title: TranslationBase.of(context) + // .tomorrow, + // onPressed: () { + // setState(() { + // selectedFilter = 3; + // filterPatients(); + // }); + // }, + // color: selectedFilter == 3 + // ? Colors.red[800] + // : Colors.grey[300], + // fontColor: selectedFilter == 3 + // ? Colors.white + // : Colors.black, + // ), + // AppButton( + // title: TranslationBase.of(context) + // .nextWeek, + // onPressed: () { + // setState(() { + // selectedFilter = 4; + // // filterPatients(); + // }); + // }, + // color: selectedFilter == 4 + // ? Colors.red[800] + // : Colors.grey[300], + // fontColor: selectedFilter == 4 + // ? Colors.white + // : Colors.black, + // ), + // ], + // ), + SizedBox( + height: 10.0, ), + // Divider( + // thickness: 0.8, + // color: Color(0xffCCCCCC), + // ), Container( - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: - BorderRadius.circular(20)), - margin: - EdgeInsets.fromLTRB(0, 0, 0, 0), + // decoration: BoxDecoration( + // color: Color(0Xffffffff), + // borderRadius: + // BorderRadius.circular(20)), child: (responseModelList.length > 0) ? Column( // mainAxisAlignment: MainAxisAlignment.center, @@ -399,9 +473,35 @@ class _PatientsScreenState extends State { ); } + // filterPatients() { + // responseModelList = []; + // //if (selectedFilter > 1) { + // responseModelList2.forEach((element) { + // DateTime arrivedOn = DateTime.parse(element.arrivedOn); + // Duration dur = DateTime.now().difference(arrivedOn); + // if (selectedFilter == 2 && dur.inDays == 0) { + // responseModelList.add(element); + // } else if (selectedFilter == 3 && dur.inDays == 1) { + // responseModelList.add(element); + // } else if (selectedFilter == 4 && dur.inDays > 7) { + // responseModelList.add(element); + // } else if (selectedFilter == 1) { + // responseModelList.add(element); + // } + // }); + // } else { + // responseModelList = responseModelList2; + // } + //} + InputDecoration buildInputDecoration(BuildContext context, hint) { return InputDecoration( - prefixIcon: Icon(Icons.search, color: Colors.grey), + suffixIcon: IconButton( + icon: new Image.asset("assets/images/filter-512.png"), + color: Colors.grey, + onPressed: () {}, + iconSize: 20, + ), filled: true, fillColor: Colors.white, hintText: hint, @@ -423,9 +523,9 @@ class _PatientsScreenState extends State { decoration: BoxDecoration( color: Color(0Xffffffff), borderRadius: BorderRadius.circular(12.5), - border: Border.all( - width: 0.5, - ), + // border: Border.all( + // width: 0.5, + // ), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 43fae7a6..8c8afde2 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1133,6 +1133,9 @@ class TranslationBase { localizedValues['arrivalpatient'][locale.languageCode]; String get searchmedicinepatient => localizedValues['searchmedicinepatient'][locale.languageCode]; + String get appointmentDate => + localizedValues['appointmentDate'][locale.languageCode]; + String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 5ccae18f..94585e75 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -13,203 +14,264 @@ class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; final Function onTap; final String patientType; - const PatientCard({Key key, this.patientInfo, this.onTap, this.patientType}) : super(key: key); + const PatientCard({Key key, this.patientInfo, this.onTap, this.patientType}) + : super(key: key); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.all(10), - decoration: myBoxDecoration(), - margin: EdgeInsets.only(bottom: 12), - child: InkWell( - child: Row( - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - children: < - Widget>[ - Padding( - padding: EdgeInsets - .only( - left: - 12.0), - child: - Container( - decoration: - BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO( - 0, - 0, - 0, - 0.08), - offset: Offset(0.0, - 5.0), - blurRadius: - 16.0) + width: SizeConfig.screenWidth * 0.95, + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), color: Colors.white), + margin: EdgeInsets.all(5), + child: InkWell( + child: Column( + children: [ + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" + ? Container(height: 5, color: Colors.green[800]) + : Container(), + SizedBox( + height: 10, + ), + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green[800], + fontWeight: FontWeight.bold, + ), + AppText(patientInfo.arrivedOn) ], - borderRadius: - BorderRadius.all( - Radius.circular(35.0)), - color: Color( - 0xffCCCCCC), - ), - width: 70, - height: 70, - child: Icon( - patientInfo.genderDescription == - "Male" - ? DoctorApp - .male - : DoctorApp - .female_icon, - size: 70, - color: Colors - .white, - ), - ), - ), - ], - ), - - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment:CrossAxisAlignment.start, - children: [ - AppText( - patientInfo.firstName + - " " + - patientInfo.lastName, - fontSize: - 2.0 * SizeConfig.textMultiplier, - fontWeight: - FontWeight.bold, - backGroundcolor: - Colors.white, - ), - SizedBox(height: 12,), - Table( - border: TableBorder.symmetric( - // inside: BorderSide(width: 2.0, color: Colors.white), - ), - // defaultVerticalAlignment:TableCellVerticalAlignment.middle , + ) + : SizedBox(), + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - TableRow(children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNo, - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 2.2 * SizeConfig.textMultiplier)), - new TextSpan(text: patientInfo.patientId.toString()), - ],),), + Row(children: [ + AppText( + patientInfo.firstName + " " + patientInfo.lastName, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).age+ " : ", - style: TextStyle(fontWeight: FontWeight.w700, )), - new TextSpan(text: "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}"), - ],),), - ), - ] - ), - TableRow(children: [ - SizedBox(height: 5,), - SizedBox(height: 5,) + patientInfo.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), ]), - TableRow(children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).nationality + " : ", - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 2.2 * SizeConfig.textMultiplier)), - new TextSpan(text: (patientInfo.nationalityName ?? patientInfo.nationality)), - ],),), + AppText( + patientInfo.nationalityName ?? patientInfo.nationality, + fontWeight: FontWeight.bold, + ) + ], + )), + Row(children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), ), - - - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).gender + " : ", - style: TextStyle(fontWeight: FontWeight.w700, )), - new TextSpan(text: patientInfo.gender.toString() == '1' ? 'Male' : 'Female'), - ],),), + width: 70, + height: 70, + child: Icon( + patientInfo.gender == 1 + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - ] ), - - ], - ), - if(SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient") - Container( - - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), - ), - child: AppText( - patientInfo.startTime, - color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - ), - SizedBox( - width: 3.5, + ), + ], + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNo, + style: TextStyle( + fontSize: + 2.2 * SizeConfig.textMultiplier)), + new TextSpan( + text: patientInfo.patientId.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + )), + ], ), - Container( - child: AppText( - convertDateFormat2(patientInfo.appointmentDate.toString()), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).age + " : ", + ), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + )), + ], ), - SizedBox( - height: 0.5, - ) - ], + ), ), - margin: EdgeInsets.only(top: 8,), - ) - ], - ), - ), + if (SERVICES_PATIANT2[int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).appointmentDate + + " : ", + fontSize: 14, + ), + Container( + height: 15, + width: 60, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: HexColor("#20A169"), + ), + child: AppText( + patientInfo.startTime, + color: Colors.white, + fontSize: 1.5 * SizeConfig.textMultiplier, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2( + patientInfo.appointmentDate.toString()), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ) + ])) + ]), + ], + ), + onTap: onTap, + )); - // Divider(color: Colors.grey) - ], - ), - onTap: onTap, - ), - ); + // ]), + // TableRow(children: [ + // SizedBox( + // height: 5, + // ), + // SizedBox( + // height: 5, + // ) + // ]), + // TableRow(children: [ + // Container( + // child: RichText( + // text: new TextSpan( + // style: new TextStyle( + // fontSize: 2.0 * SizeConfig.textMultiplier, + // color: Colors.black), + // children: [ + // new TextSpan( + // text: TranslationBase.of(context) + // .nationality + + // " : ", + // style: TextStyle( + // fontWeight: FontWeight.w700, + // fontSize: 2.2 * + // SizeConfig.textMultiplier)), + // // , + // ], + // ), + // ), + // ), + // Container( + // child: RichText( + // text: new TextSpan( + // style: new TextStyle( + // fontSize: 2.0 * SizeConfig.textMultiplier, + // color: Colors.black), + // children: [ + // new TextSpan( + // text: + // TranslationBase.of(context).gender + + // " : ", + // style: TextStyle( + // fontWeight: FontWeight.w700, + // )), + // new TextSpan( + // text: + // patientInfo.gender.toString() == '1' + // ? 'Male' + // : 'Female'), + // ], + // ), + // ), + // ), + // ]), + // ], + //), + + // ), + + // Divider(color: Colors.grey) + //], + //), + //], + //), + // onTap: onTap, + // ), + //); } convertDateFormat2(String str) { @@ -233,12 +295,12 @@ class PatientCard extends StatelessWidget { myBoxDecoration() { return BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color(0xffCCCCCC), - width: 0.5, + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), ), - ), - ); + borderRadius: BorderRadius.circular(10)); } -} \ No newline at end of file +} diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 60b681d7..a6a492ca 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; class DynamicElements extends StatefulWidget { @@ -32,20 +33,15 @@ class _DynamicElementsState extends State { var selectedDate = DateFormat.yMd().format(pickedDate); if (id == '_selectedFromDate') { - // _fromDateController.text = selectedDate; + // _fromDateController.text = selectedDate; selectedDate = pickedDate.year.toString() + "-" + pickedDate.month.toString().padLeft(2, '0') + "-" + pickedDate.day.toString().padLeft(2, '0'); - _fromDateController.text = selectedDate; - - - + _fromDateController.text = selectedDate; } else { - - selectedDate = pickedDate.year.toString() + "-" + pickedDate.month.toString().padLeft(2, '0') + @@ -53,7 +49,7 @@ class _DynamicElementsState extends State { pickedDate.day.toString().padLeft(2, '0'); _toDateController.text = selectedDate; - // _toDateController.text = selectedDate; + // _toDateController.text = selectedDate; } }); }); @@ -61,11 +57,12 @@ class _DynamicElementsState extends State { @override Widget build(BuildContext context) { - final screenSize = MediaQuery - .of(context) - .size; - InputDecoration textFieldSelectorDecoration({String hintText, - String selectedText, bool isDropDown,IconData icon}) { + final screenSize = MediaQuery.of(context).size; + InputDecoration textFieldSelectorDecoration( + {String hintText, + String selectedText, + bool isDropDown, + IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -85,9 +82,9 @@ class _DynamicElementsState extends State { fontSize: 14, color: Colors.grey.shade600, ), - ) - ; + ); } + return LayoutBuilder( builder: (ctx, constraints) { return Column( @@ -99,52 +96,63 @@ class _DynamicElementsState extends State { SizedBox( height: 10, ), - AppTextFormField( - onTap: ()=> _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, - controller: _fromDateController, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_fromDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.From = "0"; - } else { - widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-"); - } - }, - readOnly: true, - - ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + borderColor: Colors.white, + onTap: () => _presentDatePicker('_selectedFromDate'), + hintText: TranslationBase.of(context).fromDate, + controller: _fromDateController, + inputFormatter: ONLY_DATE, + onSaved: (value) { + if (_fromDateController.text.toString().trim().isEmpty) { + widget._patientSearchFormValues.From = "0"; + } else { + widget._patientSearchFormValues.From = + _fromDateController.text.replaceAll("/", "-"); + } + }, + readOnly: true, + )), SizedBox( height: 5, ), - if(widget._patientSearchFormValues.From == "0" && widget.isFormSubmitted) - CustomValidationError(),SizedBox( + if (widget._patientSearchFormValues.From == "0" && + widget.isFormSubmitted) + CustomValidationError(), + SizedBox( height: 10, ), - AppTextFormField( - readOnly: true, - hintText: TranslationBase - .of(context) - .toDate, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_toDateController.text - .toString() - .trim() - .isEmpty) { - widget._patientSearchFormValues.To = "0"; - } else { - widget._patientSearchFormValues.To = - _toDateController.text.replaceAll("/", "-"); - } - }, - ), - if(widget._patientSearchFormValues.To == "0" && widget.isFormSubmitted) - CustomValidationError(),SizedBox( + Container( + decoration: BoxDecoration( + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + readOnly: true, + borderColor: Colors.white, + hintText: TranslationBase.of(context).toDate, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onSaved: (value) { + if (_toDateController.text.toString().trim().isEmpty) { + widget._patientSearchFormValues.To = "0"; + } else { + widget._patientSearchFormValues.To = + _toDateController.text.replaceAll("/", "-"); + } + }, + )), + if (widget._patientSearchFormValues.To == "0" && + widget.isFormSubmitted) + CustomValidationError(), + SizedBox( height: 10, ), ], From e7e4aad9624d3eeb5a810704a95453f0964eb73b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 21 Mar 2021 09:09:37 +0200 Subject: [PATCH 3/4] add ECG service --- ios/Podfile.lock | 2 +- lib/config/config.dart | 3 + lib/core/model/PatientMuseResultsModel.dart | 64 +++++++++++++++++++ lib/core/service/PatientMuseService.dart | 28 ++++++++ lib/core/viewModel/PatientMuseViewModel.dart | 23 +++++++ lib/locator.dart | 4 ++ .../profile/patient_profile_screen.dart | 2 +- lib/screens/sick-leave/add-sickleave.dart | 1 + .../profile/profile_medical_info_widget.dart | 2 +- pubspec.lock | 6 +- 10 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 lib/core/model/PatientMuseResultsModel.dart create mode 100644 lib/core/service/PatientMuseService.dart create mode 100644 lib/core/viewModel/PatientMuseViewModel.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9c86879d..46d7599e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -292,4 +292,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index 35c35ef3..4ba98b6b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -212,6 +212,9 @@ const GET_PROCEDURE_VALIDATION = const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +///GET ECG +const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/PatientMuseResultsModel.dart b/lib/core/model/PatientMuseResultsModel.dart new file mode 100644 index 00000000..8b10de83 --- /dev/null +++ b/lib/core/model/PatientMuseResultsModel.dart @@ -0,0 +1,64 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class PatientMuseResultsModel { + int rowID; + String setupID; + int projectID; + String orderNo; + int lineItemNo; + int patientType; + int patientID; + String procedureID; + dynamic reportData; + String imageURL; + String createdBy; + String createdOn; + DateTime createdOnDateTime; + + PatientMuseResultsModel( + {this.rowID, + this.setupID, + this.projectID, + this.orderNo, + this.lineItemNo, + this.patientType, + this.patientID, + this.procedureID, + this.reportData, + this.imageURL, + this.createdBy, + this.createdOn}); + + PatientMuseResultsModel.fromJson(Map json) { + rowID = json['RowID']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + orderNo = json['OrderNo']; + lineItemNo = json['LineItemNo']; + patientType = json['PatientType']; + patientID = json['PatientID']; + procedureID = json['ProcedureID']; + reportData = json['ReportData']; + imageURL = json['ImageURL']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + createdOnDateTime = DateUtils.getDateTimeFromServerFormat(json['CreatedOn']); + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['OrderNo'] = this.orderNo; + data['LineItemNo'] = this.lineItemNo; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ProcedureID'] = this.procedureID; + data['ReportData'] = this.reportData; + data['ImageURL'] = this.imageURL; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + return data; + } +} diff --git a/lib/core/service/PatientMuseService.dart b/lib/core/service/PatientMuseService.dart new file mode 100644 index 00000000..891029c3 --- /dev/null +++ b/lib/core/service/PatientMuseService.dart @@ -0,0 +1,28 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class PatientMuseService extends BaseService { + List patientMuseResultsModelList = List(); + + getECGPatient({int patientType, int patientOutSA,int patientID}) async { + Map body = Map(); + body['PatientType'] = patientType; + body['PatientOutSA'] = patientOutSA; + body['PatientID'] = patientID; + await baseAppClient.post( + GET_ECG, + onSuccess: (dynamic response, int statusCode) { + patientMuseResultsModelList.clear(); + response['HIS_GetPatientMuseResultsList'].forEach((v) { + patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } +} diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart new file mode 100644 index 00000000..3f5e82ed --- /dev/null +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -0,0 +1,23 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/PatientMuseService.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class PatientMuseViewModel extends BaseViewModel { + + PatientMuseService _patientMuseService = locator(); + + getECGPatient({int patientType, int patientOutSA, int patientID}) async { + setState(ViewState.Busy); + await _patientMuseService.getECGPatient( + patientID: patientID, + patientOutSA: patientOutSA, + patientType: patientType); + if (_patientMuseService.hasError) { + error = _patientMuseService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index f939effc..3a5b94b2 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/PatientMuseService.dart'; import 'core/service/SOAP_service.dart'; import 'core/service/patient-admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; @@ -25,6 +26,7 @@ import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/referral_patient_service.dart'; import 'core/service/referred_patient_service.dart'; import 'core/service/schedule_service.dart'; +import 'core/viewModel/PatientMuseViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; @@ -58,6 +60,7 @@ void setupLocator() { locator.registerLazySingleton(() => AdmissionRequestService()); locator.registerLazySingleton(() => UcafService()); locator.registerLazySingleton(() => AuthService()); + locator.registerLazySingleton(() => PatientMuseService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -77,4 +80,5 @@ void setupLocator() { locator.registerFactory(() => AdmissionRequestViewModel()); locator.registerFactory(() => UcafViewModel()); locator.registerFactory(() => MedicalFileViewModel()); + locator.registerFactory(() => PatientMuseViewModel()); } diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ba42173e..24b59f8e 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -27,7 +27,7 @@ class PatientProfileScreen extends StatelessWidget { PatiantInformtion patient; - + //TODO change it @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index ad74b760..a0546d98 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -17,6 +17,7 @@ import 'package:hexcolor/hexcolor.dart'; class AddSickLeavScreen extends StatelessWidget { PatiantInformtion patient; + //TODO jammal @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 9bd2230d..c2b2d8a4 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -28,7 +28,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { String from; String to; - + //TODO change it PatiantInformtion patient; String patientType; @override diff --git a/pubspec.lock b/pubspec.lock index 909670db..d044f1fb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -573,7 +573,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -844,7 +844,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: @@ -986,5 +986,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0" From 1af6115365aea868b406623c65f1140ef3c8322e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 21 Mar 2021 09:53:25 +0200 Subject: [PATCH 4/4] add ECG and Show sick leave --- lib/core/viewModel/PatientMuseViewModel.dart | 3 + lib/routes.dart | 6 + lib/screens/patients/ECGPage.dart | 49 +++++++ lib/screens/sick-leave/add-sickleave.dart | 1 - lib/screens/sick-leave/show-sickleave.dart | 133 ++++++++++++++++++ .../profile_medical_info_widget_search.dart | 14 ++ 6 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 lib/screens/patients/ECGPage.dart create mode 100644 lib/screens/sick-leave/show-sickleave.dart diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 3f5e82ed..890b24d6 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart'; import 'package:doctor_app_flutter/core/service/PatientMuseService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; @@ -8,6 +9,8 @@ class PatientMuseViewModel extends BaseViewModel { PatientMuseService _patientMuseService = locator(); + List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; + getECGPatient({int patientType, int patientOutSA, int patientID}) async { setState(ViewState.Busy); await _patientMuseService.getECGPatient( diff --git a/lib/routes.dart b/lib/routes.dart index fe280d40..210396fe 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_page.dart'; +import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_pat import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen_history.dart'; import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_soap_index.dart'; @@ -95,6 +97,7 @@ const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second'; const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third'; const String PATIENT_UCAF_REQUEST = 'patients/ucaf'; const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail'; +const String PATIENT_ECG = 'patients/ecg'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -106,6 +109,7 @@ const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; const String ADD_SICKLEAVE = 'add-sickleave'; +const String SHOW_SICKLEAVE = 'show-sickleave'; const String RADIOLOGY = 'radiology'; //todo: change the routing way. var routes = { @@ -159,6 +163,7 @@ var routes = { // LIVECARE_END_DIALOG: (_) => EndCallDialogBox(), PATIENT_SICKLEAVE: (_) => SickLeaveScreen(), ADD_SICKLEAVE: (_) => AddSickLeavScreen(), + SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(), ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(), @@ -167,4 +172,5 @@ var routes = { MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), + PATIENT_ECG: (_) => ECGPage(), }; diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart new file mode 100644 index 00000000..ba76c031 --- /dev/null +++ b/lib/screens/patients/ECGPage.dart @@ -0,0 +1,49 @@ +import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class ECGPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return BaseView( + onModelReady: (model) => model.getECGPatient( + patientType: patient.patientType, + patientOutSA: 0, + patientID: patient.patientId), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: 'ECG', + body: ListView.builder( + itemCount: model.patientMuseResultsModelList.length, + itemBuilder: (context, index) => InkWell( + onTap: () async { + await launch( + model.patientMuseResultsModelList[index].imageURL); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 2) + ), + child: Center( + child: Texts( + "${model.patientMuseResultsModelList[index].createdOnDateTime}"), + ), + ), + )), + ), + ); + } +} diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index a0546d98..ad74b760 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -17,7 +17,6 @@ import 'package:hexcolor/hexcolor.dart'; class AddSickLeavScreen extends StatelessWidget { PatiantInformtion patient; - //TODO jammal @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart new file mode 100644 index 00000000..c3bd3178 --- /dev/null +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -0,0 +1,133 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-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/card_with_bgNew_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ShowSickLeaveScreen extends StatelessWidget { + PatiantInformtion patient; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).sickleave, + body: SingleChildScrollView( + child: Column( + children: [ + PatientPageHeaderWidget(patient), + Column( + children: model.getAllSIckLeave + .map((GetAllSickLeaveResponse item) { + return CardWithBgWidgetNew( + widget: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + child: AppText( + item.status == 1 + ? TranslationBase.of(context) + .hold + : item.status == 2 + ? TranslationBase.of( + context) + .active + : TranslationBase.of( + context) + .all, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .leaveStartDate + + ' ', + fontWeight: FontWeight.bold, + ), + Flexible( + child: Text( + item.startDate, + overflow: TextOverflow.ellipsis, + )) + ], + ), + AppText( + item.noOfDays.toString() + + ' ' + + TranslationBase.of(context) + .daysSickleave, + fontWeight: FontWeight.bold, + ), + Row(children: [ + AppText( + item.remarks ?? "", + ) + ]), + ], + ), + SizedBox( + width: 20, + ), + ], + ), + ), + + ], + )), + SizedBox( + height: 20, + ), + Divider( + height: 1, + ), + ], + )); + }).toList(), + ) + ], + ), + ), + ), + ); + } + + +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index a3f84804..5b4d5593 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -87,6 +87,20 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: SHOW_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'sick_leaves_icons.png'), ], ), );